I am writing a native iOS app and need to serve property boundary data as a layer on top of a Google Map. I am an experienced iOS developer, but have little experience in GIS or server-side work (may become obvious as you read on..)!
The raw data is in the form of five shapefiles, each up to three GB in size. I am relaxed about whether these are combined into a single layer or shown separately. I would receive updates to these shapefiles every few months.
I need to display this property boundary layer at high levels of zoom (16+), as i will be working with single properties at a time.
As I understand it, my options (roughly) are:
1:
Build a system that generates the raster or vector tiles on the fly as I request the data for a specific region at a specific zoom level. The nice thing about this is that shapefile updates are easy to handle, as I just need to replace the old shapefiles in my database each time. I understand there would be a bit of a delay serving the tiles but this is not a deal breaker as long as the delay is not too long.
If I am going to use raster tiles I need to receive them using a URL format like this: http://www.mytileserver.com/tiles/somesortofsecuritykey/layeridentifier/[x]/[y]/[z].png
2:
Use TileMill or similar to create raster tiles for the entire dataset at the levels of zoom I need. This may not be practical as my database would be enormous (I am planning to use AWS S3/EC2 or similar, but still...), but if it did work there would be low latency for my users. This would also be a pain when dealing with updates as I would have to regenerate the entire tile set each time I received updates.
3:
Convert the data to GeoJSON or similar and use the Google Maps functionality to draw polylines to represent the boundary data based on the polygon coordinates. I would only want to do this at the higher zoom levels so Iām not drawing thousands of polylines to the screen.
I understand QGIS or ogr2ogr will convert a shapefile to GeoJSON. Would a large (3-4 GB) file pose a problem?
If I am going to receive the GeoJSON data I can query it so I only get back the geometry for the portion of the map that is displayed on the screen at any one time?
4:
Some sort of hybrid system of #2 and #3 where I use tiles at say zoom levels of 16-18 and draw polylines based on GeoJSON for zoom 19+.
Given my requirements, can anyone recommend an option to pursue further?
Or is there a totally different approach to consider?
geojson(your option 3) you need to simplify it. Usetopojsonto make yourgeojsonsmaller (https://github.com/topojson/topojson). You further need to simplify the geometries. At a high zoomlevel there is no need to display thegeojsonin its full resolution. See http://mapshaper.org/ for example. BUT, do you have to usegooglemaps? You could createvectortileshttp://gis.stackexchange.com/questions/190390/how-to-load-a-vector-tile-layer-in-a-leaflet-map and load it ā four-eyes Feb 04 '17 at 12:02