simplegeo / polymaps

Polymaps is a free JavaScript library for making dynamic, interactive maps in modern web browsers.
http://polymaps.org/
Other
1.6k stars 213 forks source link

GeoJSON tiling #57

Closed donovanhide closed 13 years ago

donovanhide commented 13 years ago

Hi, a few of the example maps make use of tiled GeoJSON to allow for progressively more detailed vectors. This can be seen here:

http://polymaps.org/ex/statehood.html

Is there any chance you could release some of the code or detail the methodology by which you created these individual GeoJSON files? Would be very grateful!

Cheers, Donovan.

migurski commented 13 years ago

Hi Donovan,

You can find a discussion with links relevant to your question here: http://gis.stackexchange.com/questions/3712/create-vector-geojson-tiles-for-polymaps

The code for GeoJSON tile generation is all public in the TileStache project (http://tilestache.org/), look for the PostGeoJSON provider (http://tilestache.org/doc/TileStache.Goodies.Providers.PostGeoJSON.html)

In the particular case of the Polymaps examples, we decided to host the generated GeoJSON tiles on Appspot because it offers support for the cross-origin resource sharing needed to read the JSON tiles from any web page. It's not necessary to choose AppSpot if you're doing everything under a single domain.

donovanhide commented 13 years ago

Hi Mike,

thanks for the reply. I read that stackexchange post, but got a bit confused - I'm new to GIS and all the various file formats associated with it.

I have a number of shapefiles from:

http://www.ordnancesurvey.co.uk/oswebsite/products/boundaryline/techinfo.html

I can make them into GeoJSON files using:

ogr2ogr -f "GeoJSON" output.json input.shp

but obviously this results in highly detailed, untiled polygons. Tilestache looks like it requires a working PostGIS db to do the conversion from .shp to multiple .json files. I would like to use AppEngine too for the project and would be happy to serve static files as polymaps.org does.

I suppose my question is, how would you get from a shapefile to a directory full of GeoJSON files in the shortest amount of steps!

Thanks for your time!!!

Donovan.

migurski commented 13 years ago

Hi Donovan,

You're right that PostGeoJSON requires a working PostGIS database. I think it would be worthwhile to support the use of Shapefiles and other file-based data sources like you describe - it's something I can add to TileStache, but it might take me a few days to do. Are you in a hurry? Contact me via Github mail, maybe I can help if you're not willing to wait.