Skip to content
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

Dynamic Tiles #2

Closed
BHare1985 opened this issue May 11, 2015 · 6 comments
Closed

Dynamic Tiles #2

BHare1985 opened this issue May 11, 2015 · 6 comments

Comments

@BHare1985
Copy link

Great work on this so far. I am using Mapnik and currently looking for a solution on how to make dynamic tiles based on a query call. Something like take additional GET parameters in the tileserver such as /{z}/{y}/{z}/png?sql=SELECT id,lng,lat,type FROM LOCATIONS and then have a Mapnik OGR layer XML dynamically created to handle those specific tiles.

Would something like this be possible using tilestrata as is? or something you would consider adding.

The demand for dynamic tile serving is high and the only one I know who does it is https://github.com/CartoDB/Windshaft but only for postgres (I would like to use Mapniks virtual layer to do non postgres servers) and ArcGIS server (commercial ), both are beasts and hard to grasp.

@brianreavis
Copy link
Member

I don't see why it wouldn't be possible. Tricky, but possible. A plugin would have to generate the Mapnik XML dynamically (and cache it probably). I just dug through Windshaft and, at a glance, that's what they seem to be doing. I think @brandonreavis was wanting to tackle this eventually.

@vjpr
Copy link

vjpr commented Nov 12, 2015

I am looking for this feature too. I want to serve an bunch of different GeoJSON layers/maps from a database. Has there been any progress on this?

At the moment I am thinking about creating the Mapnik XML file and the TileLayer on the fly when a request comes in. Would this work? There could be potentially 1000s of layers being served though, so wondering whether this will blow out memory usage.

@BHare1985
Copy link
Author

@vjpr I ended up forking a very old windshaft https://github.com/BHare1985/Windwalker

I have tested it with amazon's Linux AMI using unixODBC connecting to SQL server, and also windows 7 with sql server. I am currently using it in a Linux production environment with Amazon beanstalk using load balanced (tilestrata's load balancer is smarter) nodejs servers running a derivation of this module.

A few versions ago I also tested it with postgres and it worked fine (I also made a version that worked with mongoDB/GeoJSON temporarily but that code may be lost)

It's not as polished as tilestrata or as modular with the plugins, but it does the job. using the beforeTile and afterTile render hooks i implemented caching (using filesystem and s3) but sadly can't release that code on github because it's for work.

If you wanted to use it with sql server I recommend https://github.com/gaspardle/mapnik-mssql plugin.

@volkanunsal
Copy link

@BHare1985 Just out of curiosity, why did you fork an early version of Windshaft? I've been thinking of using it as well.

@BHare1985
Copy link
Author

@volkanunsal I wanted the base functionality but a codebase that was more manageable and every line of code understood by me. The latest windshaft has many improvements but is also a lot more complex.

@brandonreavis
Copy link
Member

I recently wrote the tilestrata-postgis-geojson-tiles plugin which will do most of what is mentioned in this thread... so I'm going to close it. Doing dynamic tiles with mapnik ended up feeling silly since PostGIS can do it all (and can even do real vector tiles with the latest versions).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants