logo separator

[mkgmap-dev] POI for buildings

From Stefan Schunck stefan.florenz.schunck at googlemail.com on Sun Feb 15 20:16:40 GMT 2009

Hi Bernhard,

Thanks
I'll try the patch. There seems to be a similar issue with buildings
and addresses:

building yes
addr:street ..
addr:housenumber

Stefan


2009/2/15 Bernhard Heibler <bernhard at heibler.de>:
> Hi Stefan,
>
> I think the problem is that a building is a area and not a single point. As
> far as I know the garmin devices will only mention points as POI in the
> lists. I already noticed the same problem with parking lots.
>
> We could insert a virtual point in the middle of the area. In the attachment
> there is experimental code for the nod branch to do so. My simple and dirty
> implementation could result in duplicated POIs since some parking lots are
> already tagged with a extra single point. This could be prevented by
> checking if the area already contains such a point.
>
> To make this also working with buildings I think you have to add building
> into resources/styles/default/polygons first. osm2mp uses garmin type 0x13
> for buildings. Otherwise mkgmap just ignore such polygons ...
>
> Berni.
>
> Stefan Schunck schrieb:
>>
>> Hi,
>>
>> It seems to be valid in osm to tag a building with something like
>>
>> building yes
>> name Pinakothek
>> tourism museum
>>
>> Is there a way to generate POIs from something like this by mkgmap?
>>
>> Stefan
>> _______________________________________________
>> mkgmap-dev mailing list
>> mkgmap-dev at lists.mkgmap.org.uk
>> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
>>
>
>
> Index: src/uk/me/parabola/mkgmap/osmstyle/StyledConverter.java
> ===================================================================
> --- src/uk/me/parabola/mkgmap/osmstyle/StyledConverter.java     (revision
> 221)
> +++ src/uk/me/parabola/mkgmap/osmstyle/StyledConverter.java     (working
> copy)
> @@ -122,7 +122,42 @@
>                        addLine(way, foundType);
>                }
>                else
> +               {
> +                       GType pointType = nodeRules.resolveType(way);
> +
> +                       if(pointType != null)
> +                       {
> +                               //System.out.println("Shape could also have
> point " + way.getName());
> +
> +                               List<Coord> polyPoints = way.getPoints();
> +
> +                               int minLat = Integer.MAX_VALUE;
> +                               int minLon = Integer.MAX_VALUE;
> +                               int maxLat = Integer.MIN_VALUE;
> +                               int      maxLon = Integer.MIN_VALUE;
> +
> +                               for(int i=0; i < polyPoints.size(); i++)
> +                               {
> +                                       if(polyPoints.get(i).getLatitude() <
> minLat)
> +                                               minLat =
> polyPoints.get(i).getLatitude();
> +                                       if(polyPoints.get(i).getLatitude() >
> maxLat)
> +                                               maxLat =
> polyPoints.get(i).getLatitude();
> +                                       if(polyPoints.get(i).getLongitude()
> < minLon)
> +                                               minLon =
> polyPoints.get(i).getLongitude();
> +                                       if(polyPoints.get(i).getLongitude()
>> maxLon)
> +                                               maxLon =
> polyPoints.get(i).getLongitude();
> +                               }
> +
> +                               Node node = new Node(1, new
> Coord(minLat+(maxLat-minLat)/2, minLon+(maxLon-minLon)/2 ) );
> +
> +                               node.copyTags(way);
> +                               node.setName(way.getName());
> +
> +                               addPoint(node, pointType);
> +                       }
> +
>                        addShape(way, foundType);
> +               }
>        }
>
>        /**
>
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev at lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
>



More information about the mkgmap-dev mailing list