TileJSON 3.0 support with layer fields discovery and cached /capabilities responses#1071
TileJSON 3.0 support with layer fields discovery and cached /capabilities responses#1071Rub21 wants to merge 12 commits intogo-spatial:masterfrom
Conversation
iwpnd
left a comment
There was a problem hiding this comment.
Hey. This is an update that is well overdue. The implementation is alright. The LayerFielder makes sense. Yet incrementing the version to 3.0.0 is an increment to all providers alike even though they do not (yet) implement the LayerFielder. This in turn makes a capabilities.json from any other provider but the postgis provider an invalid TileJSON v3.
The handle_map_capabilities.go should therefor determine whether the provider implements the LayerFielder and if it doesn't yet, it should respond with a valid TileJSON v2.
This PR lacks some tests. Take a look into the postgis_test.go and snoop around in the testdata we setup locally. It should be straight forward to write a small test that covers the creation of the TileJSON v2 and v3 in handle_map_capabilities_test.go.
All in all, good work. Some nits, some questions, some potential redundancy and the question how to handle providers that do not yet impl a LayerFielder.
Co-authored-by: Ben <iwpnd@users.noreply.github.com>
Co-authored-by: Ben <iwpnd@users.noreply.github.com>
Co-authored-by: Ben <iwpnd@users.noreply.github.com>
Co-authored-by: Ben <iwpnd@users.noreply.github.com>
Co-authored-by: Ben <iwpnd@users.noreply.github.com>
Co-authored-by: Ben <iwpnd@users.noreply.github.com>
* Add testing for TileJSON 3.0.0 * Updates for testing
|
Thanks for taking the time to review this PR and for the helpful suggestions. https://vtiles.staging.openhistoricalmap.org/capabilities |
|
@Rub21 thank you! i still think that the rwmutex will become a bottleneck in high concurrency environments and I have an idea how to address this. if you're in a rush you can keep your fork deployed, as I will not touch on functionality. i will however need some time to work on this and am unsure when I can get to it - this weekend maybe. |
That would be great, Thank you!! |
|
@Rub21 thanks for tackling the code review comments. I'm traveling and wont get a chance to look at this until next week. Does look like govulncheck is failing too. Looks like we need to update go to 1.25.6. I will get this done. |
|
@Rub21 can you please verify that you enabled us to commit to your branch? See here. I simplified the caching from a dual-map + The main fix was versioning logic however, and looking into this in more detail I want to propose a different approach here. We were using TileJSON 3.0.0 if any provider supported field metadata. However if you mix providers, this is causing inconsistent Then I added error handling so failed builds don't get cached permanently - if When I was working through the TileJSON creation itself I was struggling to read the logic, tbh. I added a helper to find layers by ID - and removed that nested loop with the skip flag, and replaced the I have my changes tucked away in a separate commit, that I could contribute here if you give me the permission. |
|
@Rub21 bumping this once more to your attention. |
Update TileJSON version to 3.0.0 and adds the required fields property to VectorLayer.
cc. @1ec5