logo separator

[mkgmap-dev] Generating location bounds info from shape file?

From WanMil wmgcnfg at web.de on Thu Jan 12 20:16:28 GMT 2012

> On Thu, Jan 12, 2012 at 06:55:35PM +0100, Gerd Petermann wrote:
>> I am not sure about your goal. do you mean that you want to evaluate
>> the data in the shape file by creating an *.img with it?
>
> I would like to import the equivalent of boundary=administrative
> relations from shape file(s) to mkgmap, for generating the address
> search index with accurate city or region boundaries. The
> boundary=administrative data for Finland in OSM is incomplete, and it
> would be quite a bit of work to import the recently freed official data
> to OSM.
>
> I do not care that much if the boundaries are shown on the map.  What I
> mostly care about is that streets will be associated with the correct
> region, city or suburb.
>
> In the long term, I think that the boundary data does belong to OSM. So,
> if importing the boundaries in a different format is too complicated, I
> guess we will have to bite the bullet and import them to OSM.
>
> 	Marko

Marko,

that's quite easy. (from my point of view ;-)))

You have to write your own BoundaryPreparer.
All you have to do is
1. Load your data
2. For each boundary create a Boundary object.
    For a Boundary object you need:
    1. The shape (as java.awt.geom.Area object) with Garmin coordinates
    2. The OSM tags
3. Save each Boundary using the BoundarySaver.addBoundary method.
4. Call BoundarySaver.end()
=> That's it

You receive extra points when you call
BoundaryPreparer.workoutBoundaryRelations(boundsDirectory);
after that :-)

WanMil



More information about the mkgmap-dev mailing list