-
-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configurable tile systems for projections other than web mercator #611
base: main
Are you sure you want to change the base?
Conversation
…cator. To help address maplibre#343
Codecov ReportPatch coverage:
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## main #611 +/- ##
==========================================
- Coverage 59.17% 58.83% -0.35%
==========================================
Files 30 31 +1
Lines 2756 2806 +50
==========================================
+ Hits 1631 1651 +20
- Misses 1125 1155 +30
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
Thanks @burleight for working on this! How common would you think it would be for the users to want all projections for all table sources? What do you think as the most common use cases? We need to address two basic cases: table sources when auto-configuring PG connection, and a case when the user wants to pre-configure a specific source with a given projection. I think for auto-config, we should add something to the The individual per-table configurations may be better off to support only a single projection using |
This is our use case, we have a lot of data we display in EPSG:2193, and we'd like to experiment with using martin to serve it. There are global coordinate systems, such as EPSG:4326 and EPSG:3857, as well as local coordinate systems, such as EPSG:2193, which is the current New Zealand mainland coordinate system. Global to global, global to local and local to global transformations almost always make sense, but local to local systems don't always apply. I.e. it wouldn't make sense to project from the New Zealand coordinate system into the Swiss coordinate system. So, I may help if we had a way to filter our transformations that don't make sense. We could configure which transformations to a tile system are allowed: tile_systems:
swiss:
srid: 2056
bounds: ...
nztm:
srid: 2193
bounds: [1000000, 4700000, 2600000, 6300000]
restrict_to_srids: [4326, 3857, 27200] # 27200 is an older New Zealand local projection If
How about keeping So, by default, if someone specifies the tile systems global, all of them are used by auto_publish but, this could be overriden in postgres:
auto_publish:
tables:
# only auto publish the default Web Mercator system
tile_systems: ['default']
# or allow the default and some custom systems
tile_systems: ['default', 'nztm']
# only auto publish a custom system
tile_systems: ['nztm']
# individual table sources may override which tile systems apply
tables:
table_source_id:
schema: public
table: my_swiss_data
tile_systems: ['default', 'swiss'] |
Thanks, but do you think that for each table source you would want to publish all possible projections? Or should the projection simply be a setting on the source itself? At the end of the day, there will still be an internal I propose we break this problem into parts:
|
Our use case is, we have a bunch of datasets, most of them NZTM. We'd be setting up a vector tile server that publishes these datasets. For the apps that we write, we'd be picking the best projection for the job. So, if we're making something which only applies to the NZ mainland, we'd tile the data with NZTM2000Quad, in other cases we'd use web mercator.
Should martin lift these variants into source setting. Instead of
I still think the definition of a tile system should sit outside of the postgres context. I'd also like to have a route, similar to |
|
No, i think we should not expose this as a parameter at all, at least not in the first iteration. Instead, given a table of "my_geometries", you can configure two sources (in yaml): so once it is possible to configure two separate data sources, each with its own geometry transofrmation function and its own tiling schema, we could proceed to other optimizations - like making it possible to auto-generate such configurations, etc |
Is there anything that should be done to anticipate the needs of the proposed Adaptive Composite Map Projection support maplibre/maplibre#190? Perhaps particular SRIDs are only required at certain zoom levels, for instance. |
That's a good question... I am not an expert on projection and globe re-projection, so can't tell for certain - but my understanding was that it is possible to construct a globe view from web mercator ... some-magically-how... One concern though is that web mercator hides the poles, so it would have to fake them by simply showing them as snow |
postgres.auto_publish.tile_systems now accepts a list of tile systems, replacing the global tile_systems property
hi @burleight, do you need help with this PR? Any blockers? Thx! |
I believe I got to the point where the code was working but the configuration was a bit verbose/ugly and there wasn't much test coverage of the new changes. Thank you. |
When can it be used? |
This comment has been minimized.
This comment has been minimized.
As mentioned above, this PR is blocked on testing. If you want to contribute in this area, this would be appreciated 🙏. As for timelines: sorry, we don't have any. This is a volunteer project and things get done when they get done. |
This is first attempt at addressing #343
Adds a
tile_systems
section to the yml config:Then, the tile URL becomes
/{source}:{tile_system}/{z}/{x}/{y}
Issues:
table1
,table1:nztm
,table1:wgs84
etc/{source}:{tile_system},{source2}:{tile_system}/{z}/{x}/{y}
.For the OpenLayer users out there. the trick to using this is to giving
VectorTile
source a custom tile grid: