问题
I am developing a Map based iPhone application where I have to draw a map of any specific region depending upon the current location of that device. Client is supplying me the .shapefile consisting of all the co-ordinates and data to draw the map. We can store the shape file on the server and i think to draw the map on device with the data presented on .shapefile I need the tiles with different zoom level. So on the server side I have to convert the .shapefile into tile based file. But I don't know how to do that conversion. Can anyone please guide me?
Thanks in advance. Ritz
回答1:
Its a lot of work.
First, shapefiles only define the geometry - you need to decide what the features are going to look like. Are they points, lines, or polygons? Do you want them all in the same colour, or depending on their attributes?
Then get mapnik or TileMill and learn how to use that. Do you just want to present the shapefile, or do you want that on a base map? In which case you'll have to generate a transparent tile set and do raster image overlays in your application.
Is it the whole world? And to the same resolution as Google Maps zooms? Get a big bank of disk storage.
http://mapbox.com/tilemill/
http://mapnik.org/
Personally I'd look into converting the shapefile into a vector form that you could render on the client - GeoJSON perhaps. Then serve that.
来源:https://stackoverflow.com/questions/13985329/how-to-convert-shapefile-to-tile-based-file