Ok, likely my bad for not making it to WhereCamp5280 and asking the FortiusOne geeks directly, but what's the process for creating GeoJSON 'tiles' for use in Polymaps?

The Population example over at polymaps.org notes that the data for the demo runs on Google AppEngine, and alludes to "rolling your own" vector tiles, but I can't seem to find any more information...

Anyone got some insight they can share?



TileStache will definitely do it, specifically the PostGeoJSON provider in the extra providers collection. The main difference between this and what we did for the Polymaps examples is polygon clipping - after seeing how large Alaska can get at higher zoom levels, we clipped all the features in the Polymaps examples to cut down on load times and so on. We also hosted them out of AppSpot to make it possible to add the Access-Control-Allow-Origin header for cross-domain permissions.

PostGeoJSON doesn't clip out of the box, but as it says in the docs I'd be happy to develop the code further if there's interest!

Update: It appears that as of Tilestache 1.9.0 the Vector Provider appears to be favored over the PostGeoJSON Provider.

| improve this answer | |

I've definitely wondered about this myself as it's something I want to make use of in Tile5 (http://tile5.org/) also. I've seen Mike Bostock (who worked with Stamen to produce Polymaps) respond via Twitter on the topic before and here is the link:


Would definitely like to find a nice standalone solution to the problem. A couple of products that look like steps in the right direction are:

  • Tilestache (http://tilestache.org/)
  • Geocouch (https://github.com/vmx/couchdb)

Will be watching this question with interest.



| improve this answer | |
  • Apparently I can only comment on my own answer :/ – Damon Oehlman Nov 23 '10 at 3:58
  • @Michal - Would definitely love to see clipping added to TileStache - any possibility of having it handle a callback parameter as well? I know JSONP isn't to everyone's tastes, but I think it would be pretty useful here... – Damon Oehlman Nov 23 '10 at 4:04
  • I can definitely add clipping to TileStache - will put it on the list! Less sure about a callback, mostly because the results are supposed to be completely cacheable and callbacks break that. Maybe I make a special except for JSON because it's such a common need... – Michal Migurski Nov 23 '10 at 16:53
  • Good point re caching on the JSONP front. The JSONP should still be quite cacheable given callbacks in the URL map directly to the function wrapper in the output. It would definitely cause cache bloat though which would be a pain. I think I might fork on Github and have a play (time permitting) :) – Damon Oehlman Nov 24 '10 at 5:44
  • Okay, I added clipping as an option in TileStache: tilestache.org/doc/… – Michal Migurski Nov 29 '10 at 19:49

You could use ogr2ogr to create a static GeoJSON file for serving, but it appears that for the time being you do have to write your own web services if you want to enable clipping or any of the other dynamic URL functions (zoom level, etc), and I'm not aware of any tiling tool that would create a tile cache of a data set, but again that could be fairly easily done with a batch process and ogr2ogr's various -clip* options. Though for vector data this doesn't seem to make sense because it'd cut polygons into pieces per tile when they overlap, you'd probably be better off with a bounding box search.

| improve this answer | |

Dave - There does seem to be a gap to fill here. A nice stand alone json tile cutter would be great to have (& good for those who aren't using tilestache). Check out the python module Bloch (via M. Migurski): https://github.com/migurski/Bloch (think mapshaper.org on the command line & python).

As Jason pointed out the process of tiling data is rather straightforward and could be accomplished pretty quickly by using something like gdal2tiles as a starting point and morphing it into the vector world.


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.