Fast Food and --add-pois-to-areas

Hi folks, With the POI stuff now merged, I build latest SVN to try the --add-pois-to-areas option. My test POI was a fast food restaurant: http://www.openstreetmap.org/browse/way/4482136 This doesn't show up as a POI on the generated map - have I just made a poor choice and used a POI type not yet supported for areas or is something else wrong? Thanks, Dermot -- -------------------------------------- Iren sind menschlich

Hi Dermot, thanks for testing. The problem here is we only check for building=yes right now. Your place is tagged with building = restaurant. I just looked in the osm wiki it seams to be allowed and renderers should just treat them as building=yes if no special handling is supported. You just have to change the polygons style file to fix the problem. Patch is attached. Berni.
Hi folks,
With the POI stuff now merged, I build latest SVN to try the --add-pois-to-areas option. My test POI was a fast food restaurant: http://www.openstreetmap.org/browse/way/4482136
This doesn't show up as a POI on the generated map - have I just made a poor choice and used a POI type not yet supported for areas or is something else wrong?
Thanks, Dermot
Index: resources/styles/default/polygons =================================================================== --- resources/styles/default/polygons (revision 971) +++ resources/styles/default/polygons (working copy) @@ -6,7 +6,7 @@ amenity=supermarket [0x08 resolution 21] amenity=university [0x0a resolution 18] -building=yes [0x13 resolution 18] +building=* [0x13 resolution 18] landuse=allotments [0x4e resolution 20] landuse=cemetary [0x1a resolution 18]

2009/3/6 Bernhard Heibler <bernhard@heibler.de>:
thanks for testing. The problem here is we only check for building=yes right now. Your place is tagged with building = restaurant. I just looked in the osm wiki it seams to be allowed and renderers should just treat them as building=yes if no special handling is supported. You just have to change the polygons style file to fix the problem. Patch is attached.
Works great - thanks. Dermot -- -------------------------------------- Iren sind menschlich

Actually, I've noticed that Zoos that are tagged as areas are not mapped to POIs: http://www.openstreetmap.org/browse/way/26638082 Dermot -- -------------------------------------- Iren sind menschlich

Hi Dermot, right now the --add-pois-to-areas function only supports areas which are listed in the polygon style file. So you could work around this limitation if you add the tourism=zoo to the polygon file. Maybe you just want to map it like a park. I did some coding to look for all polygons but I don't like it much. Problem is that I don't know which garmin type I should assign to such areas. So I just set the are type to 0 and removed the shape later on in the area pois handler. Not nice. I have attached the code maybe you could give it a try and tell me if it solves your zoo problem ... Thanks Berni. Dermot McNally schrieb:
Actually, I've noticed that Zoos that are tagged as areas are not mapped to POIs:
http://www.openstreetmap.org/browse/way/26638082
Dermot
Index: src/uk/me/parabola/mkgmap/osmstyle/StyledConverter.java =================================================================== --- src/uk/me/parabola/mkgmap/osmstyle/StyledConverter.java (revision 303) +++ src/uk/me/parabola/mkgmap/osmstyle/StyledConverter.java (working copy) @@ -151,19 +151,34 @@ preConvertRules(way); GType foundType = wayRules.resolveType(way); - if (foundType == null) - return; + if (foundType != null) + { + postConvertRules(way, foundType); - postConvertRules(way, foundType); - - if (foundType.getFeatureKind() == GType.POLYLINE) { - if(foundType.isRoad()) - addRoad(way, foundType); - else - addLine(way, foundType); + if (foundType.getFeatureKind() == GType.POLYLINE) { + if(foundType.isRoad()) + addRoad(way, foundType); + else + addLine(way, foundType); + } + else + addShape(way, foundType); } else - addShape(way, foundType); + { + GType pointType = nodeRules.resolveType(way); + + if(pointType != null) + { + //System.out.println(way.getName() + " " + way.getPoints().get(0).toDegreeString() + " " + pointType.getType()); + MapShape shape = new MapShape(); + //elementSetup(shape, gt, way); + shape.setPoints(way.getPoints()); + clipper.clipShape(shape, collector); + shape.setPoiType(pointType.getType()); + //shape.setPoiType(pointType.getType()); + } + } } /** Index: src/uk/me/parabola/mkgmap/main/MapMaker.java =================================================================== --- src/uk/me/parabola/mkgmap/main/MapMaker.java (revision 303) +++ src/uk/me/parabola/mkgmap/main/MapMaker.java (working copy) @@ -22,6 +22,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import java.util.Vector; import uk.me.parabola.imgfmt.ExitException; import uk.me.parabola.imgfmt.FileExistsException; @@ -150,6 +151,8 @@ poiMap.put(null, point); } + List<MapShape> shapeToRemove = new Vector<MapShape>(); + for (MapShape shape : src.getShapes()) { String shapeName = shape.getName(); @@ -158,8 +161,10 @@ // only make a point if the shape has a name and we know what type of point to make if (pointType == 0) continue; - + if(shape.getType() == 0) + shapeToRemove.add(shape); + // We don't want to add unnamed cities !! if(MapPoint.isCityType(pointType) && shapeName == null) continue; @@ -176,6 +181,11 @@ log.info("created POI ", shapeName, "from shape"); } } + + for (MapShape shape : shapeToRemove) + { + src.getShapes().remove(shape); + } } }

Hi Bernhard, The patch does make Dublin Zoo appear as a POI - though it is listed as "Unnamed", so it looks like some of the plumbing is missing. Until now, there has been no address entered, so I'll enter one now for test purposes. 2009/3/8 Bernhard Heibler <bernhard@heibler.de>:
Hi Dermot,
right now the --add-pois-to-areas function only supports areas which are listed in the polygon style file. So you could work around this limitation if you add the tourism=zoo to the polygon file. Maybe you just want to map it like a park. I did some coding to look for all polygons but I don't like it much. Problem is that I don't know which garmin type I should assign to such areas. So I just set the are type to 0 and removed the shape later on in the area pois handler. Not nice. I have attached the code maybe you could give it a try and tell me if it solves your zoo problem ...
-- -------------------------------------- Iren sind menschlich
participants (2)
-
Bernhard Heibler
-
Dermot McNally