
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); + } } }