-
Notifications
You must be signed in to change notification settings - Fork 35
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
Example Code for PostGIS to VectorTile? #7
Comments
Feeding in a Mapnik XML is the right way to generate vector tiles. You are correct that the The critical thing when generating vector tiles is to avoid querying too much or unneeded data in your Mapnik XML datasource definitions. This is the same for when rendering image tiles if you care about performance, but it becomes even more critical with vector tiles since you want to avoid them being too large. Mapbox.com for example will not allow you to upload individual tiles > 500 Kb for example (at the time of this writing). To avoid "querying too much" you want to be thoughtful about your SQL queries. And you likely want to use min/max zoom denominators. The Mapbox Studio Classic project helps you author Mapnik XML styles with like this that restrict zoom. There are also probably other tools out there that make this easier. Take a look at https://github.com/mapbox/awesome-vector-tiles/. I noticed (when looking at that myself) that https://github.com/faradayio/tilesplash might be interesting to you. |
So the reason it goes through the Mapnik XML is to pick up the datasource, correct? What if we generate the datasource via the api ( As for "querying too much", I'm unclear on how to use the denominators as passing variables through the options object for Side issue: size in our vector tiles is a bit of an issue (I've seen ~240kb for a pbf with un-gzipped data, where same tile was ~30kb for the png version and ~90kb for a fully compressed data pbf) as we deal with weather contours and they're fairly complex. Where is the performance benefit to vectors at this point? The browser render end? Node 7.10 /cc @ddproxy |
Could we get some example code for the right way to do PostGIS -> VectorTile? RIght now my app feeds it through the stylesheet for the datasource, but since none of the style information (color, text) it doesn't seem necessary.
The text was updated successfully, but these errors were encountered: