We are working on a project to add vector map data from OSM and NAVTEQ to a iOS GPS app.
Currently, the app displays raster map images and provides moving map navigation features. We now want to take it a step further by integration vector maps but don't know where to start.
Guidance from developers with experience on GPS navigation would be great.
Here is the brief on the requirements:
Target Devices: iOS. C++ is preferred for the core for future compatibility with other platforms.
Data integration and packaging: Map data source: - NAVTEQ - OpenStreetMap
File format: - Ideal for mobile devices with considerations of device limitations. - Either find an already established format, or create one in house.
Compiling: - Determine a format for source data (Shp, MapInfo etc) - Compile source format to required format.
Map rendering engine:开发者_StackOverflow中文版 Display of maps: - Vector map view will be separate to the current raster map view. - Render data into lines, points, polygons etc in real time. Tiled or pre-rendered is not acceptable. - 2D birdseye view. (3D is planned for future versions). - Shade relief to illustrate elevation. - Display user generated data such as routes, tracklogs, waypoints. - A scale, e.g. 500 metres. - Speedy performance is essential to provide better user experience. - Good examples would be the Tom Tom iOS app. Map Interactions: - Pan, Zoom, rotate. - Make use of multitouch functionality. Search - Address, locations, POI (Geo Coding) - Address from location (Reverse Geo Coding)
Style sheets - Easily customise the look of the map been displayed. - Every element can be cusomised.
We would like to find out where to start our research. What libraries and SDKs are out there that are worth spending the time investigating?
Some notes based on my experience:
Source data format: you'll probably want to be able to import data from ESRI shapefiles and OpenStreetMap (which comes as XML or a more compact but equivalent binary format). NAVTEQ data can be obtained as ESRI shapefiles. Shaded relief can be obtained by processing USGS height data (http://dds.cr.usgs.gov/srtm/).
2D versus 3D: the step from one to the other is a big one. 2D data is almost invariably provided as latitude and longitude and projected to a plane: Google Maps and OpenStreetMap use a very simple but much derided spherical Mercator projection. Moving to 3D requires a decision on the coordinate system - projected plane plus height versus true 3D based on the shape of the earth - and possibly problems involving level of detail. A good way to proceed might be to draw the shape of the earth (hills and valleys) as a triangle mesh, then drape the rest of the map on it as a texture. You might want to consider "two and a half D" - using a perspective transformation to display the map as if viewing it from a height.
Libraries: there's quite a big list of map rendering libraries here, both commercial and non-commercial (disclosure: mine is one of them). Many of these libraries have style sheet systems for customising the map look and feel.
A very good open-source rendering library (not mine) is Mapnik, but I am not sure whether that will port very easily on to iOS. However, it's a very good idea to read up on how Mapnik and other rendering libraries do their work, to get a feel for the problem. The OpenStreetMap wiki is a good portal for learning more about the field.
Text rendering on maps is nearly always done using FreeType, an open-source rasterizer library with an unrestrictive license.
Try out MapBox library: http://mapbox.com/
There is a list on the OSM Wiki but it is sadly not complete.
Two vector libraries that I know of are CartoType (which you can see in use in the newer Lonely Planet Guides) and Skobbler - Skobbler don't have an off the shelf product but I bellieve they will integrate their vector maps and routing for you.
There is also a related question on the OSM StackExchange
精彩评论