route-me together with libosmscout (offline vector maps for iOS)

1.1k views Asked by At

I´m trying to use the route-me framework together with C++ library libosmscout.

What I have done so far:

  • import OSM data into libosmscout format
  • compiling the iOS example-project from libosmscout-repo

The example project only draws one image of the map depending on given lat, long and zoom-factor.

What I want to do is, using the map view functionality of route-me but with map source data from libosmscout.

Is there anybody who has been managed this problem or could give me some hints?

1

There are 1 answers

1
M. Porooshani On

I'm trying to do exactly the same thing.
But I haven' been able to compile the libosmscout for iOS up to now.

Anyway, I'm no sure how comfortable you are with route-me but I'm gonna try and answer your question. If you are going to use libosmscout to leverage map data form osm xml or pbf files (probably for offline use) you're gonna need to implement a new MapSource and write the code yourself.

you'd better inherit from RMAbstractWebMapSource and implement imageForTile:tile inCache:tileCache method to meet your requirements. Route-me is a tile based map viewer, therefore you need to convert those vector data to tiles, for that you're gonna need to convert tile requests to boundingbox (a few examples are available in OSM wiki) and then try and extract the data from your OSM file and pass it to route-me as an image instance (a png for example).

Don't forget that Route-me caches loaded images, so you have to consider passing the right image for future uses. don't be fooled with the fact that your data is on device, reading vector files can be as demanding as reading raster files from web.