From 4d147ca9cbe001aa73e2a8252c210277cf3716d1 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Mon, 13 Sep 2010 18:39:20 +0000 Subject: [PATCH] improve rendering git-svn-id: https://osmand.googlecode.com/svn/trunk@498 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8 --- .../src/net/osmand/ToDoConstants.java | 1 + .../osmand/data/preparation/IndexCreator.java | 282 +- .../src/net/osmand/osm/MapRenderingTypes.java | 150 +- .../src/net/osmand/osm/OSMSettings.java | 3 +- OsmAnd/res/drawable/h_beach.png | Bin 0 -> 162 bytes OsmAnd/res/drawable/h_danger.png | Bin 0 -> 146 bytes OsmAnd/res/drawable/h_glacier.png | Bin 0 -> 122 bytes OsmAnd/res/drawable/h_marsh.png | Bin 0 -> 621 bytes OsmAnd/res/drawable/h_mud.png | Bin 0 -> 104 bytes OsmAnd/res/drawable/h_orchard.png | Bin 0 -> 110 bytes OsmAnd/res/drawable/h_quarry2.png | Bin 0 -> 139 bytes OsmAnd/res/drawable/h_scrub.png | Bin 0 -> 166 bytes .../net/osmand/activities/MapActivity.java | 9 +- .../src/net/osmand/render/OsmandRenderer.java | 428 +-- .../src/net/osmand/render/PointRenderer.java | 4 +- .../net/osmand/render/PolygonRenderer.java | 296 ++ .../net/osmand/render/PolylineRenderer.java | 394 +++ .../src/net/osmand/render/features_done.xml | 513 +++ .../render/features_not_done_mapnik.xml | 2701 ++++++++++++++++ .../src/net/osmand/render/features_text.xml | 774 +++++ OsmAnd/src/net/osmand/render/roads.xml | 2866 +++++++++++++++++ 21 files changed, 7887 insertions(+), 534 deletions(-) create mode 100644 OsmAnd/res/drawable/h_beach.png create mode 100644 OsmAnd/res/drawable/h_danger.png create mode 100644 OsmAnd/res/drawable/h_glacier.png create mode 100644 OsmAnd/res/drawable/h_marsh.png create mode 100644 OsmAnd/res/drawable/h_mud.png create mode 100644 OsmAnd/res/drawable/h_orchard.png create mode 100644 OsmAnd/res/drawable/h_quarry2.png create mode 100644 OsmAnd/res/drawable/h_scrub.png create mode 100644 OsmAnd/src/net/osmand/render/PolygonRenderer.java create mode 100644 OsmAnd/src/net/osmand/render/PolylineRenderer.java create mode 100644 OsmAnd/src/net/osmand/render/features_done.xml create mode 100644 OsmAnd/src/net/osmand/render/features_not_done_mapnik.xml create mode 100644 OsmAnd/src/net/osmand/render/features_text.xml create mode 100644 OsmAnd/src/net/osmand/render/roads.xml diff --git a/DataExtractionOSM/src/net/osmand/ToDoConstants.java b/DataExtractionOSM/src/net/osmand/ToDoConstants.java index d166fa2dc5..128f9b8fa4 100644 --- a/DataExtractionOSM/src/net/osmand/ToDoConstants.java +++ b/DataExtractionOSM/src/net/osmand/ToDoConstants.java @@ -35,6 +35,7 @@ public class ToDoConstants { //+ 15. Draw layers -> icons -> text. See intersects of double streets. // 16. Internet access bits // 17. Implement multipolygons to polygons + // TODO colors for road trunk and motorway // 12. Fix : find proper location for streets ! centralize them (when create index)? diff --git a/DataExtractionOSM/src/net/osmand/data/preparation/IndexCreator.java b/DataExtractionOSM/src/net/osmand/data/preparation/IndexCreator.java index 4948447ca3..77337c6923 100644 --- a/DataExtractionOSM/src/net/osmand/data/preparation/IndexCreator.java +++ b/DataExtractionOSM/src/net/osmand/data/preparation/IndexCreator.java @@ -128,10 +128,12 @@ public class IndexCreator { private File mapFile; private Connection mapConnection; - private PreparedStatement mapWaysStat; - private PreparedStatement mapWayLocsStat; - private PreparedStatement mapWayLocsStatLevel2; - private PreparedStatement mapWayLocsStatLevel3; + private PreparedStatement mapObjStat; + private PreparedStatement mapLocsStatLevel0; + private PreparedStatement mapLocsStatLevel1; + private PreparedStatement mapLocsStatLevel2; + private Map> lowLevelWaysSt = new LinkedHashMap>(); + private Map> lowLevelWaysEnd = new LinkedHashMap>(); // choose what to use ? private boolean loadInMemory = true; @@ -936,73 +938,11 @@ public class IndexCreator { if(indexMap && (e instanceof Way) || (e instanceof Node)){ // manipulate what kind of way to load loadEntityData(e, true); - int type = MapRenderingTypes.encodeEntityWithType(e, 0); - int type1 = MapRenderingTypes.encodeEntityWithType(e, 1); - int type2 = MapRenderingTypes.encodeEntityWithType(e, 2); boolean inverse = "-1".equals(e.getTag(OSMTagKey.ONEWAY)); - boolean point = (type & MapRenderingTypes.TYPE_MASK) == MapRenderingTypes.POINT_TYPE; - long id = e.getId() << 3; - if(type != 0){ - if(e instanceof Way){ - id |= 1; - } - DataIndexWriter.insertMapRenderObjectIndex(pStatements, mapWaysStat, mapWayLocsStat, e, - MapRenderingTypes.getEntityName(e), id,type, inverse, point, BATCH_SIZE); - } - if(type1 != 0){ - id |= 2; - boolean skip = false; - if(e instanceof Way){ - id |= 1; - List nodes = ((Way) e).getNodes(); - Way way = new Way(id); - int prevX = 0; - int prevY = 0; - for (int i = 0; i < nodes.size() - 1; i++) { - int r = i < nodes.size() - 1 ? 4 : 1; - int x = (int) (MapUtils.getTileNumberX(14, nodes.get(i).getLongitude()) * 256d); - int y = (int) (MapUtils.getTileNumberY(14, nodes.get(i).getLatitude()) * 256d); - if (Math.abs(x - prevX) > r || Math.abs(y - prevY) > r) { - way.addNode(nodes.get(i)); - prevX = x; - prevY = y; - } - } - e = way; - skip = way.getNodes().size() < 2; - } - if(!skip){ - DataIndexWriter.insertMapRenderObjectIndex(pStatements, mapWaysStat, mapWayLocsStatLevel2, e, - MapRenderingTypes.getEntityName(e), id, type, inverse, point, BATCH_SIZE); - } - } - if(type2 != 0){ - id |= 4; - boolean skip = false; - if(e instanceof Way){ - id |= 1; - List nodes = ((Way) e).getNodes(); - Way way = new Way(id); - int prevX = 0; - int prevY = 0; - for (int i = 0; i < nodes.size() - 1; i++) { - int r = i < nodes.size() - 1 ? 4 : 1; - int x = (int) (MapUtils.getTileNumberX(9, nodes.get(i).getLongitude()) * 256d); - int y = (int) (MapUtils.getTileNumberY(9, nodes.get(i).getLatitude()) * 256d); - if (Math.abs(x - prevX) > r || Math.abs(y - prevY) > r) { - way.addNode(nodes.get(i)); - prevX = x; - prevY = y; - } - } - e = way; - skip = way.getNodes().size() < 2; - } - if(!skip){ - DataIndexWriter.insertMapRenderObjectIndex(pStatements, mapWaysStat, mapWayLocsStatLevel3, e, - MapRenderingTypes.getEntityName(e), id, type, inverse, point, BATCH_SIZE); - } - } + + writeEntityToMapDatabase(e, e.getId(), inverse, 0); + indexLowLevelMap(e, 1); + indexLowLevelMap(e, 2); } if (indexAddress) { @@ -1091,6 +1031,174 @@ public class IndexCreator { } + private void putIntoMap(Map> map, T key, R value){ + if(!map.containsKey(key)){ + map.put(key, new ArrayList()); + } + map.get(key).add(value); + } + + private void removeValueMap(Map> map, T key, R value){ + boolean remove = map.get(key).remove(value); + if(!remove){ + throw new IllegalStateException(); + } + if(map.get(key).isEmpty()){ + map.remove(key); + } + } + + private void indexLowLevelMap(Entity e, int level) throws SQLException{ + int type = MapRenderingTypes.encodeEntityWithType(e, level); + if(type == 0){ + return; + } + boolean writeIntoDB = true; + boolean ring = true; + if((type & MapRenderingTypes.TYPE_MASK) == MapRenderingTypes.POLYLINE_TYPE && e instanceof Way && level > 0){ + List nodes = ((Way) e).getNodes(); + Node n = nodes.get(0); + Node l = nodes.get(nodes.size() - 1); + // ring + ring = l.getId() == n.getId(); + if (!ring) { + writeIntoDB = false; + Way start = null; + if (lowLevelWaysEnd.containsKey(n.getId())) { + for (Way w : lowLevelWaysEnd.get(n.getId())) { + int t = MapRenderingTypes.encodeEntityWithType(w, level); + if (t == type && Algoritms.objectEquals(MapRenderingTypes.getEntityName(w), + MapRenderingTypes.getEntityName(e))) { + start = w; + break; + } + } + } + + if (start != null) { + ring = start.getNodeIds().get(0) == l.getId(); + if(ring){ + removeValueMap(lowLevelWaysEnd, n.getId(), start); + removeValueMap(lowLevelWaysSt, l.getId(), start); + } else { + // add nodes to start + for (int i = 1; i < nodes.size(); i++) { + start.addNode(nodes.get(i)); + } + removeValueMap(lowLevelWaysEnd, n.getId(), start); + putIntoMap(lowLevelWaysEnd, l.getId(), start); + } + } else { + long tempId = (e.getId() << 2) | level; + start = new Way(tempId); + for(String t : e.getTagKeySet()){ + start.putTag(t, e.getTag(t)); + } + // add nodes to start + for (int i = 0; i < nodes.size(); i++) { + start.addNode(nodes.get(i)); + } + + putIntoMap(lowLevelWaysSt, n.getId(), start); + putIntoMap(lowLevelWaysEnd, l.getId(), start); + } + + if (!ring) { + Way end = null; + if (lowLevelWaysSt.containsKey(l.getId())) { + for (Way w : lowLevelWaysSt.get(l.getId())) { + int t = MapRenderingTypes.encodeEntityWithType(w, level); + if (t == type && Algoritms.objectEquals(MapRenderingTypes.getEntityName(w), + MapRenderingTypes.getEntityName(e))) { + end = w; + break; + } + } + } + if (end != null) { + Long ll = end.getNodeIds().get(end.getNodeIds().size() - 1); + // remove end line + removeValueMap(lowLevelWaysSt, l.getId(), end); + removeValueMap(lowLevelWaysEnd, ll, end); + ring = ll == n.getId(); + + if (!ring) { + + // add nodes to start + for (int i = 1; i < end.getNodes().size(); i++) { + start.addNode(end.getNodes().get(i)); + } + + // remove end start + removeValueMap(lowLevelWaysEnd, l.getId(), start); + putIntoMap(lowLevelWaysEnd, ll, start); + } + } + } + } + } + + if(writeIntoDB || ring){ + writeEntityToMapDatabase(e, e.getId(), false, level); + } + } + + + private void writeEntityToMapDatabase(Entity e, long baseId, boolean inverse, int level) throws SQLException { + int type = MapRenderingTypes.encodeEntityWithType(e, level); + if(type == 0){ + return; + } + boolean point = (type & MapRenderingTypes.TYPE_MASK) == MapRenderingTypes.POINT_TYPE; + PreparedStatement mapLocations; + int zoom; + long id = baseId << 3; + if (level == 1) { + id |= 2; + mapLocations = mapLocsStatLevel1; + zoom = 14; + } else if (level == 2) { + id |= 4; + zoom = 9; + mapLocations = mapLocsStatLevel2; + } else { + zoom = 18; + mapLocations = mapLocsStatLevel0; + } + boolean skip = false; + if (e instanceof Way) { + id |= 1; + // simplify route + if (level > 0) { + List nodes = ((Way) e).getNodes(); + Way way = new Way(id); + int prevX = 0; + int prevY = 0; + for (int i = 0; i < nodes.size(); i++) { + int r = i < nodes.size() - 1 ? 4 : 0; + int x = (int) (MapUtils.getTileNumberX(zoom, nodes.get(i).getLongitude()) * 256d); + int y = (int) (MapUtils.getTileNumberY(zoom, nodes.get(i).getLatitude()) * 256d); + if (Math.abs(x - prevX) > r || Math.abs(y - prevY) > r) { + way.addNode(nodes.get(i)); + prevX = x; + prevY = y; + } + } + e = way; + skip = way.getNodes().size() < 2; + } + + } + + + if (!skip) { + DataIndexWriter.insertMapRenderObjectIndex(pStatements, mapObjStat, mapLocations, e, + MapRenderingTypes.getEntityName(e), id, type, false, point, BATCH_SIZE); + } + } + + + private void convertEnglishName(MapObject o){ String name = o.getName(); @@ -1201,14 +1309,14 @@ public class IndexCreator { mapConnection = DriverManager.getConnection("jdbc:sqlite:" + mapFile.getAbsolutePath()); DataIndexWriter.createMapIndexStructure(mapConnection); - mapWaysStat = DataIndexWriter.createStatementMapWaysInsert(mapConnection); - mapWayLocsStat = DataIndexWriter.createStatementMapWaysLocationsInsert(mapConnection); - mapWayLocsStatLevel2 = DataIndexWriter.createStatementMapWaysLocationsInsertLevel2(mapConnection); - mapWayLocsStatLevel3 = DataIndexWriter.createStatementMapWaysLocationsInsertLevel3(mapConnection); - pStatements.put(mapWaysStat, 0); - pStatements.put(mapWayLocsStat, 0); - pStatements.put(mapWayLocsStatLevel2, 0); - pStatements.put(mapWayLocsStatLevel3, 0); + mapObjStat = DataIndexWriter.createStatementMapWaysInsert(mapConnection); + mapLocsStatLevel0 = DataIndexWriter.createStatementMapWaysLocationsInsert(mapConnection); + mapLocsStatLevel1 = DataIndexWriter.createStatementMapWaysLocationsInsertLevel2(mapConnection); + mapLocsStatLevel2 = DataIndexWriter.createStatementMapWaysLocationsInsertLevel3(mapConnection); + pStatements.put(mapObjStat, 0); + pStatements.put(mapLocsStatLevel0, 0); + pStatements.put(mapLocsStatLevel1, 0); + pStatements.put(mapLocsStatLevel2, 0); mapConnection.setAutoCommit(false); } @@ -1334,14 +1442,13 @@ public class IndexCreator { // 4. update all postal codes from relations if(indexAddress && !postalCodeRelations.isEmpty()){ + progress.startTask("Registering postcodes...", -1); if(pStatements.get(addressBuildingStat) > 0){ addressBuildingStat.executeBatch(); pStatements.put(addressBuildingStat, 0); addressConnection.commit(); } - - progress.startTask("Registering postcodes...", -1); PreparedStatement pstat = addressConnection.prepareStatement("UPDATE " + IndexBuildingTable.getTable() + " SET " + IndexBuildingTable.POSTCODE.name() + " = ? WHERE " + IndexBuildingTable.ID.name() + " = ?"); pStatements.put(pstat, 0); @@ -1354,6 +1461,17 @@ public class IndexCreator { } } + } + // 5. writing low level maps + if(indexMap){ + // TODO level !!! + for(Long l : lowLevelWaysSt.keySet()){ + for(Way w : lowLevelWaysSt.get(l)){ + int level = (int) (w.getId() & 3); + writeEntityToMapDatabase(w, w.getId() >> 2, false, level); + } + } + } try { @@ -1431,8 +1549,8 @@ public class IndexCreator { IndexCreator creator = new IndexCreator(new File("e:/Information/OSM maps/osmand/")); creator.setIndexMap(true); - creator.setNodesDBFile(new File("e:/Information/OSM maps/osmand/minsk.tmp.odb")); - creator.generateIndexes(new File("e:/Information/OSM maps/belarus osm/minsk.osm"), new ConsoleProgressImplementation(3), null); +// creator.setNodesDBFile(new File("e:/Information/OSM maps/osmand/minsk.tmp.odb")); +// creator.generateIndexes(new File("e:/Information/OSM maps/belarus osm/minsk.osm"), new ConsoleProgressImplementation(3), null); // creator.setNodesDBFile(new File("e:/Information/OSM maps/osmand/belarus_nodes.tmp.odb")); // creator.generateIndexes(new File("e:/Information/OSM maps/belarus osm/belarus_2010_09_03.osm.bz2"), new ConsoleProgressImplementation(3), null); diff --git a/DataExtractionOSM/src/net/osmand/osm/MapRenderingTypes.java b/DataExtractionOSM/src/net/osmand/osm/MapRenderingTypes.java index 36d742153b..7e71f1629f 100644 --- a/DataExtractionOSM/src/net/osmand/osm/MapRenderingTypes.java +++ b/DataExtractionOSM/src/net/osmand/osm/MapRenderingTypes.java @@ -17,7 +17,6 @@ import net.osmand.osm.OSMSettings.OSMTagKey; */ public class MapRenderingTypes { - // TODO !!! think about layers of objects, include layer bits into standard schema (2 bits)? // TODO !!! add others facilities to all types // TODO Internet access bits for point // TODO Find TextSymbolizer rules and write text for points and others @@ -52,10 +51,10 @@ public class MapRenderingTypes { public final static int MASK_10 = (1 << 10) - 1; - public final static int HIGHWAY = 1; //TODO R + public final static int HIGHWAY = 1; //TODO REVIEW public final static int BARRIER = 2; - public final static int WATERWAY = 3; //TODO R layer-water_features.xml.inc, layer-water.xml.inc - public final static int RAILWAY = 4;//TODO R + public final static int WATERWAY = 3; + public final static int RAILWAY = 4;//TODO REVIEW public final static int AEROWAY = 5; //TODO R public final static int AERIALWAY = 6; public final static int POWER = 7; @@ -67,7 +66,7 @@ public class MapRenderingTypes { public final static int TOURISM = 13; public final static int HISTORIC = 14; public final static int LANDUSE = 15; - public final static int MILITARY = 16; //TODO R + public final static int MILITARY = 16; public final static int NATURAL = 17;//TODO R public final static int AMENITY_SUSTENANCE = 18; public final static int AMENITY_EDUCATION = 19; @@ -76,7 +75,7 @@ public class MapRenderingTypes { public final static int AMENITY_HEALTHCARE = 22; public final static int AMENITY_ENTERTAINMENT = 23; public final static int AMENITY_OTHER = 24; - public final static int ADMINISTRATIVE = 25;//TODO R + public final static int ADMINISTRATIVE = 25; public final static int ROUTE = 26; //NOT DONE YET public final static int SPORT = 27; //+no icons @@ -331,6 +330,10 @@ public class MapRenderingTypes { int attr = getHighwayAttributes(e); attr <<= 13; type |= attr; + } else if(!polygon && !point){ + int attr = getLayerAttributes(e, 0); + attr <<= 13; + type |= attr; } return type; } @@ -388,7 +391,12 @@ public class MapRenderingTypes { if(one != null){ attr |= 1; } - + attr = getLayerAttributes(e, attr); + + return attr; + } + + private static int getLayerAttributes(Entity e, int attr){ // layer attr <<= 2; String l = e.getTag(OSMTagKey.LAYER); @@ -401,11 +409,16 @@ public class MapRenderingTypes { } } else if(e.getTag(OSMTagKey.BRIDGE) != null){ attr |= 2; + } else if(e.getTag(OSMTagKey.TUNNEL) != null){ + attr |= 1; } - return attr; } + public static boolean isLayerUnder(int attr){ + return (attr & 3) == 1; + } + public static String getEntityName(Entity e){ String name = e.getTag(OSMTagKey.NAME); if(name == null){ @@ -565,8 +578,9 @@ public class MapRenderingTypes { // 3. waterway register(1, "waterway", "stream", WATERWAY, 1, POLYLINE_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register(2, "waterway", "river", WATERWAY, 2, POLYLINE_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register(2, "waterway", "riverbank", WATERWAY, 3, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + // Questionable index river & canals for level=2 (depends on target) + register(2, "waterway", "river", WATERWAY, 2, POLYLINE_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register(1, "waterway", "canal", WATERWAY, 4, POLYLINE_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("waterway", "ditch", WATERWAY, 5, POLYLINE_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("waterway", "drain", WATERWAY, 6, POLYLINE_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ @@ -575,10 +589,11 @@ public class MapRenderingTypes { register("waterway", "turning_point", WATERWAY, 9, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("waterway", "boatyard", WATERWAY, 10, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("waterway", "weir", WATERWAY, 11, POLYLINE_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("waterway", "dam", WATERWAY, 12, POLYLINE_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "waterway", "dam", WATERWAY, 12, POLYLINE_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "waterway", "mill_pond", WATERWAY, 13, POLYGON_WITH_CENTER_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ // 4. railway - register(1, "railway", "rail", RAILWAY, 1, POLYLINE_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(2, "railway", "rail", RAILWAY, 1, POLYLINE_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register(1, "railway", "tram", RAILWAY, 2, POLYLINE_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("railway", "light_rail", RAILWAY, 3, POLYLINE_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("railway", "abandoned", RAILWAY, 4, POLYLINE_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ @@ -608,7 +623,7 @@ public class MapRenderingTypes { register(1, "aeroway", "helipad", AEROWAY, 3, POLYGON_WITH_CENTER_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("aeroway", "runway", AEROWAY, 7, POLYLINE_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("aeroway", "taxiway", AEROWAY, 8, POLYLINE_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("aeroway", "apron", AEROWAY, 9, POLYLINE_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "aeroway", "apron", AEROWAY, 9, POLYLINE_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register(1, "aeroway", "airport", AEROWAY, 10, POLYGON_WITH_CENTER_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("aeroway", "gate", AEROWAY, 12, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("aeroway", "windsock", AEROWAY, 13, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ @@ -630,8 +645,8 @@ public class MapRenderingTypes { register("power", "pole", POWER, 2, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register(1, "power", "line", POWER, 3, POLYLINE_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("power", "minor_line", POWER, 4, POLYLINE_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("power", "station", POWER, 5, POINT_TYPE, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("power", "sub_station", POWER, 6, POINT_TYPE, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "power", "station", POWER, 5, POINT_TYPE, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "power", "sub_station", POWER, 6, POINT_TYPE, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("power", "generator", POWER, 7, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("power", "cable_distribution_cabinet", POWER, 8, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ @@ -641,13 +656,14 @@ public class MapRenderingTypes { register("building", null, MAN_MADE, SUBTYPE_BUILDING, POLYGON_TYPE); //$NON-NLS-1$ register("man_made", "wastewater_plant", MAN_MADE, 2, POINT_TYPE, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ registerAsBuilding("man_made", "water_works", MAN_MADE, 3); //$NON-NLS-1$ //$NON-NLS-2$ - registerAsBuilding("man_made", "works", MAN_MADE, 4); //$NON-NLS-1$ //$NON-NLS-2$ + register("man_made", "works", MAN_MADE, 4, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("building", "garages", MAN_MADE, SUBTYPE_GARAGES, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("man_made", "cutline", MAN_MADE, 7, POLYLINE_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("man_made", "groyne", MAN_MADE, 8, POLYLINE_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("man_made", "pier", MAN_MADE, 9, POLYLINE_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "man_made", "groyne", MAN_MADE, 8, POLYLINE_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "man_made", "breakwater", MAN_MADE, 8, POLYLINE_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "man_made", "pier", MAN_MADE, 9, POLYLINE_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("man_made", "pipeline", MAN_MADE, 10, POLYLINE_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("man_made", "reservoir_covered", MAN_MADE, 11, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ @@ -670,17 +686,18 @@ public class MapRenderingTypes { register("leisure", "sports_centre", LEISURE, 2, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("leisure", "golf_course", LEISURE, 3, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("leisure", "stadium", LEISURE, 4, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - registerRules(0, "leisure", "track", LEISURE, 5, POINT_TYPE, POLYLINE_TYPE, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + registerRules(1, "leisure", "track", LEISURE, 5, POINT_TYPE, POLYLINE_TYPE, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("leisure", "pitch", LEISURE, 6, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("leisure", "water_park", LEISURE, 7, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("leisure", "marina", LEISURE, 8, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "leisure", "marina", LEISURE, 8, POLYLINE_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("leisure", "slipway", LEISURE, 9, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("leisure", "fishing", LEISURE, 10, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register(2, "leisure", "nature_reserve", LEISURE, 11, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("leisure", "park", LEISURE, 12, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "leisure", "park", LEISURE, 12, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "leisure", "recreation_ground", LEISURE, 12, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("leisure", "playground", LEISURE, 13, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("leisure", "garden", LEISURE, 14, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("leisure", "common", LEISURE, 15, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "leisure", "garden", LEISURE, 14, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "leisure", "common", LEISURE, 15, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("leisure", "ice_rink", LEISURE, 16, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("leisure", "miniature_golf", LEISURE, 17, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("leisure", "dance", LEISURE, 18, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ @@ -791,7 +808,7 @@ public class MapRenderingTypes { register("tourism", "camp_site", TOURISM, 4, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("tourism", "caravan_site", TOURISM, 5, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("tourism", "picnic_site", TOURISM, 6, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("tourism", "theme_park", TOURISM, 7, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "tourism", "theme_park", TOURISM, 7, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("tourism", "zoo", TOURISM, 8, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ registerAsBuilding("tourism", "alpine_hut", TOURISM, 9); //$NON-NLS-1$ //$NON-NLS-2$ @@ -822,68 +839,75 @@ public class MapRenderingTypes { register("historic", null, HISTORIC, 12, POINT_TYPE); //$NON-NLS-1$ // 15. landuse - register("landuse", "allotments", LANDUSE, 1, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("landuse", "basin", LANDUSE, 2, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("landuse", "brownfield", LANDUSE, 3, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("landuse", "cemetery", LANDUSE, 4, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "landuse", "allotments", LANDUSE, 1, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "landuse", "basin", LANDUSE, 2, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "landuse", "brownfield", LANDUSE, 3, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "landuse", "cemetery", LANDUSE, 4, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register("landuse", "grave_yard", LANDUSE, 4, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register(1, "landuse", "commercial", LANDUSE, 5, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register(1, "landuse", "construction", LANDUSE, 6, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("landuse", "farm", LANDUSE, 7, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("landuse", "farmland", LANDUSE, 8, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("landuse", "farmyard", LANDUSE, 9, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "landuse", "farm", LANDUSE, 7, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "landuse", "farmland", LANDUSE, 7, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + + register(1, "landuse", "farmyard", LANDUSE, 9, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register(2, "landuse", "forest", LANDUSE, 10, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("landuse", "garages", LANDUSE, 11, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("landuse", "grass", LANDUSE, 12, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("landuse", "greenfield", LANDUSE, 13, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("landuse", "greenhouse_horticulture", LANDUSE, 14, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "landuse", "grass", LANDUSE, 12, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "landuse", "greenfield", LANDUSE, 13, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "landuse", "greenhouse_horticulture", LANDUSE, 14, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register(1, "landuse", "industrial", LANDUSE, 15, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("landuse", "landfill", LANDUSE, 16, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("landuse", "meadow", LANDUSE, 17, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("landuse", "military", LANDUSE, 18, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("landuse", "orchard", LANDUSE, 19, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "landuse", "landfill", LANDUSE, 16, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "landuse", "meadow", LANDUSE, 17, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "landuse", "military", LANDUSE, 18, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "landuse", "orchard", LANDUSE, 19, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register(1, "landuse", "railway", LANDUSE, 20, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$] - register("landuse", "recreation_ground", LANDUSE, 21, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("landuse", "reservoir", LANDUSE, 22, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("landuse", "residential", LANDUSE, 23, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("landuse", "retail", LANDUSE, 24, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("landuse", "salt_pond", LANDUSE, 25, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("landuse", "village_green", LANDUSE, 26, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("landuse", "vineyard", LANDUSE, 27, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "landuse", "recreation_ground", LANDUSE, 21, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "landuse", "conservation", LANDUSE, 21, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "landuse", "village_green", LANDUSE, 21, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(2, "landuse", "reservoir", LANDUSE, 22, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(2, "landuse", "water", LANDUSE, 22, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "landuse", "residential", LANDUSE, 23, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "landuse", "retail", LANDUSE, 24, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "landuse", "salt_pond", LANDUSE, 25, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "landuse", "quarry", LANDUSE, 26, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "landuse", "vineyard", LANDUSE, 27, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ // 16. military register("military", "airfield", MILITARY, 1, POLYGON_WITH_CENTER_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("military", "bunker", MILITARY, 1, POLYGON_WITH_CENTER_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("military", "barracks", MILITARY, 1, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("military", "danger_area", MILITARY, 1, POLYGON_WITH_CENTER_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("military", "range", MILITARY, 1, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("military", "naval_base", MILITARY, 1, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register("military", "bunker", MILITARY, 2, POLYGON_WITH_CENTER_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register("military", "barracks", MILITARY, 3, POLYGON_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register("military", "danger_area", MILITARY, 4, POLYGON_WITH_CENTER_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register("military", "range", MILITARY, 5, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register("military", "naval_base", MILITARY, 6, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ // 17. natural register(3, "natural", "coastline", NATURAL, 5, POLYLINE_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register(1, "natural", "bay", NATURAL, 1, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register(1,"natural", "beach", NATURAL, 2, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register(1,"natural", "cave_entrance", NATURAL, 3, POLYGON_WITH_CENTER_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register("natural", "bay", NATURAL, 1, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "natural", "beach", NATURAL, 2, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "natural", "cave_entrance", NATURAL, 3, POLYGON_WITH_CENTER_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ registerRules(1, "natural", "cliff", NATURAL, 4, POLYGON_TYPE, POINT_TYPE, POLYLINE_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("natural", "fell", NATURAL, 6, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("natural", "glacier", NATURAL, 7, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("natural", "heath", NATURAL, 8, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("natural", "land", NATURAL, 9, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(2, "natural", "glacier", NATURAL, 7, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "natural", "heath", NATURAL, 8, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1,"natural", "land", NATURAL, 9, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("natural", "heath", NATURAL, 10, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("natural", "marsh", NATURAL, 11, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("natural", "mud", NATURAL, 12, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "natural", "marsh", NATURAL, 11, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "natural", "mud", NATURAL, 12, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register(1, "natural", "peak", NATURAL, 13, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("natural", "sand", NATURAL, 14, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("natural", "scree", NATURAL, 15, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("natural", "scrub", NATURAL, 16, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "natural", "scrub", NATURAL, 16, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("natural", "spring", NATURAL, 17, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("natural", "stone", NATURAL, 18, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("natural", "tree", NATURAL, 19, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register(1, "natural", "volcano", NATURAL, 20, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register(2, "natural", "water", NATURAL, 21, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("natural", "wetland", NATURAL, 22, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(2, "natural", "lake", NATURAL, 21, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(1, "natural", "wetland", NATURAL, 22, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register(2, "natural", "wood", NATURAL, 23, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register(2, "landuse", "wood", NATURAL, 23, POLYGON_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ // 18. amenity sustenance registerAsBuilding("amenity", "restaurant", AMENITY_SUSTENANCE, 1); //$NON-NLS-1$ //$NON-NLS-2$ @@ -897,10 +921,10 @@ public class MapRenderingTypes { register("amenity", "bbq", AMENITY_SUSTENANCE, 9, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ // 19. amenity education - registerAsBuilding("amenity", "kindergarten", AMENITY_EDUCATION, 1); //$NON-NLS-1$ //$NON-NLS-2$ + register("amenity", "kindergarten", AMENITY_EDUCATION, 1, POINT_TYPE, POLYGON_WITH_CENTER_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("amenity", "school", AMENITY_EDUCATION, 2, POINT_TYPE, POLYGON_WITH_CENTER_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("amenity", "college", AMENITY_EDUCATION, 3, POINT_TYPE, POLYGON_WITH_CENTER_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ - register("amenity", "library", AMENITY_EDUCATION, 4, POINT_TYPE, POLYGON_WITH_CENTER_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register("amenity", "library", AMENITY_EDUCATION, 4, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("amenity", "university", AMENITY_EDUCATION, 5, POINT_TYPE, POLYGON_WITH_CENTER_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ @@ -961,8 +985,8 @@ public class MapRenderingTypes { register("amenity", "police", AMENITY_OTHER, 10, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("amenity", "post_box", AMENITY_OTHER, 11, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ registerAsBuilding("amenity", "post_office", AMENITY_OTHER, 12); //$NON-NLS-1$ //$NON-NLS-2$ - registerAsBuilding("amenity", "prison", AMENITY_OTHER, 13); //$NON-NLS-1$ //$NON-NLS-2$ - registerAsBuilding("amenity", "public_building", AMENITY_OTHER, 14); //$NON-NLS-1$ //$NON-NLS-2$ + register("amenity", "prison", AMENITY_OTHER, 13, POLYGON_WITH_CENTER_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ + register("amenity", "public_building", AMENITY_OTHER, 14, POLYGON_WITH_CENTER_TYPE, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("amenity", "recycling", AMENITY_OTHER, 15, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("amenity", "shelter", AMENITY_OTHER, 16, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ register("amenity", "telephone", AMENITY_OTHER, 17, POINT_TYPE); //$NON-NLS-1$ //$NON-NLS-2$ diff --git a/DataExtractionOSM/src/net/osmand/osm/OSMSettings.java b/DataExtractionOSM/src/net/osmand/osm/OSMSettings.java index c6580c978e..604a6435c0 100644 --- a/DataExtractionOSM/src/net/osmand/osm/OSMSettings.java +++ b/DataExtractionOSM/src/net/osmand/osm/OSMSettings.java @@ -14,6 +14,7 @@ public class OSMSettings { ONEWAY("oneway"), //$NON-NLS-1$ LAYER("layer"), //$NON-NLS-1$ BRIDGE("bridge"), //$NON-NLS-1$ + TUNNEL("tunnel"), //$NON-NLS-1$ TOLL("toll"), //$NON-NLS-1$ JUNCTION("junction"), //$NON-NLS-1$ @@ -44,7 +45,7 @@ public class OSMSettings { NATURAL("natural"), //$NON-NLS-1$ INTERNET_ACCESS("internet_access"), //$NON-NLS-1$ - OPENING_HOURS("opening_hours"), //$NON-NLS-1$ + OPENING_HOURS("opening_hours"), //$NON-NLS-1$ ; private final String value; diff --git a/OsmAnd/res/drawable/h_beach.png b/OsmAnd/res/drawable/h_beach.png new file mode 100644 index 0000000000000000000000000000000000000000..ff9e3072fe2dacf54066400b63babfbf21ccb493 GIT binary patch literal 162 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V6Od#Ihk44ofy`glX(f`uqAoByDx`7I;J!Gca%qfiUBxyLEqng6t)pzOL-od02(Cg;uXhum%b#dAc};NL)_- z^S@A>Iq$%c262a_>1%iN>u^0c3OfAZ;0qH5*R=vu_UQc*2C8Q8boFyt=akR{0FE>- AH~;_u literal 0 HcmV?d00001 diff --git a/OsmAnd/res/drawable/h_danger.png b/OsmAnd/res/drawable/h_danger.png new file mode 100644 index 0000000000000000000000000000000000000000..2f7b943f9154cd27d5c6b82f40c06509c0db329c GIT binary patch literal 146 zcmeAS@N?(olHy`uVBq!ia0vp^av;pX1SGcvS$+jloCO|{#S9GGLLkg|>2BR0prDJV zi(^Q|oa7(HkIi}o4zIYl*sWj6HtS38ZTtB)%t|paUa`F9eHF!?90DB+kIc5_=vfxp kaKTLKq%%|@hk+Esj)=k literal 0 HcmV?d00001 diff --git a/OsmAnd/res/drawable/h_glacier.png b/OsmAnd/res/drawable/h_glacier.png new file mode 100644 index 0000000000000000000000000000000000000000..05727512e1192db270096d77ba8d3dda18101e9d GIT binary patch literal 122 zcmeAS@N?(olHy`uVBq!ia0vp^8bGYT!2~4VpI;jeq&N#aB8wRqxP?HN@zUM8KR`hp zPZ!6KiaBr38uBtQa4>K9`MsmL(}7LK_m}zQc^wftV%?0v z(btiIVPjv-@4(4GzCyA`kS_y6l_~>6Lo)-z&;LOBB?CjL0RzLU1O^7H84L{K`IF+0 zx-l>?KK68R45_%4^ymM7`@;?l4Gc*OmnHh}^6YWwVsHO4y`Gn6exeLe^k8Cx{)AnO zAr-TEes>pid}lPglhnX)=xMUgY^tU~phCRAko|Snae^-=UC6 zRKNY0Y$&4xgW~TWJOaxX9^I-EBoHLZz##=e zW(K;GFGQ75z=1ieh>_(&LnIH7nP%v~@Nkuwnt&bv3d>K> z@Z;FgD8qZCz#V8McVCt0lTFXJ@POR3F!Iqsp*l}6BZR2J1|^4leFS}Ny81kj`fOLpE~gEWD;=DG2wfqpdjY*s98!mdKI;Vst E02@~w-~a#s literal 0 HcmV?d00001 diff --git a/OsmAnd/res/drawable/h_quarry2.png b/OsmAnd/res/drawable/h_quarry2.png new file mode 100644 index 0000000000000000000000000000000000000000..38dcfac9a4287c5eaa252bee7ffc0b1432b91c9a GIT binary patch literal 139 zcmeAS@N?(olHy`uVBq!ia0vp^av;pX1SGcvS$+jloCO|{#S9GGLLkg|>2BR0prEa% zi(^Q|oMelt9|pYwhgV!&?A9-3n`I(#cV8j1WZ=z=HE#kJX9`_QIih0O+3#_g-6|F& g|7FF+5(6oQ##N$A+4`g$fCe#my85}Sb4q9e0OK4gga7~l literal 0 HcmV?d00001 diff --git a/OsmAnd/res/drawable/h_scrub.png b/OsmAnd/res/drawable/h_scrub.png new file mode 100644 index 0000000000000000000000000000000000000000..7668027f1e7e19b6ee1dd51a76cab80e79bfae8a GIT binary patch literal 166 zcmeAS@N?(olHy`uVBq!ia0vp^av;pX1SGcvS$+jloCO|{#S9GGLLkg|>2BR0pkRcj zi(^Q|oa7t7DztkA4zIX)MB;AAzDy5EUPF#=9?Tm)bNKvG2+C8WRrSj@ { /// Colors private int clFillScreen = Color.rgb(241, 238, 232); - - private PathEffect dashEffect2_2 = new DashPathEffect(new float[]{2,2}, 1); - private PathEffect dashEffect3_2 = new DashPathEffect(new float[]{3,2}, 1); - private PathEffect dashEffect4_2 = new DashPathEffect(new float[]{4,2}, 1); - private PathEffect dashEffect4_3 = new DashPathEffect(new float[]{4,3}, 1); - private PathEffect dashEffect6_2 = new DashPathEffect(new float[]{6,2}, 1); - private PathEffect dashEffect5_2 = new DashPathEffect(new float[]{5,2}, 1); - private PathEffect dashEffect6_3 = new DashPathEffect(new float[]{6,3}, 1); - private PathEffect dashEffect7_7 = new DashPathEffect(new float[]{7,7}, 1); - private PathEffect dashEffect6_3_2_3 = new DashPathEffect(new float[]{6,3,2,3,}, 1); - private PathEffect dashEffect6_3_2_3_2_3 = new DashPathEffect(new float[]{6,3,2,3,2,3}, 1); - - private PathEffect arrowDashEffect1 = new DashPathEffect(new float[]{0,12,10,152},0); - private PathEffect arrowDashEffect2 = new DashPathEffect(new float[]{0,12,9,153}, 1); - private PathEffect arrowDashEffect3 = new DashPathEffect(new float[]{0,18,2,154}, 1); - private PathEffect arrowDashEffect4 = new DashPathEffect(new float[]{0,18,1,155}, 1); + private PathEffect arrowDashEffect1 = new DashPathEffect(new float[] { 0, 12, 10, 152 }, 0); + private PathEffect arrowDashEffect2 = new DashPathEffect(new float[] { 0, 12, 9, 153 }, 1); + private PathEffect arrowDashEffect3 = new DashPathEffect(new float[] { 0, 18, 2, 154 }, 1); + private PathEffect arrowDashEffect4 = new DashPathEffect(new float[] { 0, 18, 1, 155 }, 1); + private Map dashEffect = new LinkedHashMap(); private Map shaders = new LinkedHashMap(); private Map cachedIcons = new LinkedHashMap(); @@ -91,7 +79,7 @@ public class OsmandRenderer implements Comparator { int resId; } - private static class RenderingContext { + /*package*/ static class RenderingContext { List textToDraw = new ArrayList(); List iconsToDraw = new ArrayList(); float leftX; @@ -114,11 +102,19 @@ public class OsmandRenderer implements Comparator { // use to set rendering properties int color = Color.BLACK; + // polyline props boolean showText = true; PathEffect pathEffect = null; int shadowLayer = 0; int shadowColor = 0; float strokeWidth = 0; + + // polygon props + boolean showPolygon = true; + int colorAround = 0; + int widthAround = 1; + Shader shader = null; + } public OsmandRenderer(Context context){ @@ -150,6 +146,18 @@ public class OsmandRenderer implements Comparator { } + public PathEffect getDashEffect(String dashes){ + if(!dashEffect.containsKey(dashes)){ + String[] ds = dashes.split("_"); //$NON-NLS-1$ + float[] f = new float[ds.length]; + for(int i=0; i { Path path = null; int type = MapRenderingTypes.getObjectType(obj.getType()); int subtype = MapRenderingTypes.getPolygonSubType(obj.getType()); - int color = Color.rgb(245, 245, 245); - int colorAround = 0; - Shader shader = null; - boolean showPolygon = true; - if (type == MapRenderingTypes.MAN_MADE) { - showPolygon = zoom > 15; - if (subtype == MapRenderingTypes.SUBTYPE_BUILDING) { - color = Color.rgb(188, 169, 169); - } else if (subtype == MapRenderingTypes.SUBTYPE_GARAGES) { - color = Color.rgb(221, 221, 221); - } - - } else if (type == MapRenderingTypes.WATERWAY) { - if(subtype == 3){ - color = Color.rgb(181, 208, 208); - } - } else if (type == MapRenderingTypes.POWER) { - if(subtype == 5 || subtype == 6){ - color = Color.rgb(186, 186, 186); - } - } else if (type == MapRenderingTypes.HIGHWAY) { - if (subtype == MapRenderingTypes.PL_HW_SERVICE || subtype == MapRenderingTypes.PL_HW_UNCLASSIFIED - || subtype == MapRenderingTypes.PL_HW_RESIDENTIAL) { - colorAround = Color.rgb(194, 194, 194); - color = Color.WHITE; - } else if(subtype == MapRenderingTypes.PL_HW_PEDESTRIAN || subtype == MapRenderingTypes.PL_HW_FOOTWAY){ - color = Color.rgb(236, 236, 236); - colorAround = Color.rgb(176, 176, 176); - } - } else if (type == MapRenderingTypes.TOURISM) { - showPolygon = zoom > 15; - if (subtype == 2) { - color = Color.rgb(204, 153, 153); - } else if(subtype == 8){ - shader = getShader(R.drawable.h_zoo); - } - - } else if (type == MapRenderingTypes.NATURAL) { - if(subtype == 23){ - color = Color.rgb(174, 209, 160); - } else if(subtype == 2){ - color = Color.rgb(238, 204, 85); - } else if(subtype == 21 || subtype == 5){ - color = Color.rgb(181, 208, 208); - } - - } else if (type == MapRenderingTypes.LANDUSE) { - switch (subtype) { - case 1: - color = Color.rgb(189, 227, 203); - break; - case 2: - case 22: - color = Color.rgb(180, 213, 240); - break; - case 3: - color = Color.rgb(235, 215, 254); - break; - case 4: - shader = getShader(R.drawable.h_grave_yard); - break; - case 5: - color = Color.rgb(239, 200, 200); - break; - case 6: - color = Color.rgb(157, 157, 108); - break; - case 10: - shader = getShader(R.drawable.h_forest); - break; - case 11 : - color = Color.rgb(223, 209, 214); - break; - case 12: - color = Color.rgb(207, 236, 168); - break; - case 15: - color = Color.rgb(223, 209, 214); - break; - case 18: - color = Color.rgb(252, 216, 219); - break; - case 23: - color = Color.rgb(221, 221, 221); - break; - case 24: - color = Color.rgb(254, 234, 234); - colorAround = Color.rgb(245, 154, 152); - break; - case 27: - shader = getShader(R.drawable.h_vineyard); - break; - } - } else if (type == MapRenderingTypes.LEISURE) { - colorAround = Color.rgb(147, 207, 170); - switch (subtype) { - case 2: - color = Color.rgb(189, 227, 203); - break; - case 3: - case 14: - case 15: - color = Color.rgb(199, 241, 163); - break; - case 6: - color = Color.rgb(137, 210, 174); - case 4: - color = Color.rgb(51, 204, 153); - break; - case 5: - color = Color.rgb(189, 207, 203); - break; - case 12: - color = Color.rgb(206, 246, 202); - break; - case 13: - color = Color.rgb(204, 255, 241); - break; - case 11: - shader = getShader(R.drawable.h_nr); - break; - } - } else if (type == MapRenderingTypes.AMENITY_HEALTHCARE) { - if (subtype == 2) { - color = Color.rgb(240, 240, 216); - colorAround = Color.rgb(212, 168, 158); - } - } else if (type == MapRenderingTypes.AMENITY_TRANSPORTATION) { - if (subtype == 1 || subtype == 2) { - color = Color.rgb(246, 238, 183); - } - } else if (type == MapRenderingTypes.AMENITY_ENTERTAINMENT) { - if (subtype == 3) { - color = Color.rgb(204, 153, 153); - } - } else if (type == MapRenderingTypes.AMENITY_EDUCATION) { - if(subtype == 2 || subtype == 3 || subtype == 5){ - color = Color.rgb(240, 240, 216); - colorAround = Color.rgb(212, 168, 158); - } else { - // draw as building education - color = Color.rgb(188, 169, 169); - } - } - if(!showPolygon){ + rc.color = Color.rgb(245, 245, 245); + rc.shader = null; + rc.showPolygon = true; + + PolygonRenderer.renderPolygon(rc, zoom, type, subtype, this); + if(!rc.showPolygon){ return null; } - paint.setColor(color); + paint.setColor(rc.color); for (int i = 0; i < obj.getPointsLength(); i++) { PointF p = calcPoint(obj, i, rc); xText += p.x; @@ -466,10 +335,10 @@ public class OsmandRenderer implements Comparator { if (path != null) { xText /= obj.getPointsLength(); yText /= obj.getPointsLength(); - paint.setShader(shader); + paint.setShader(rc.shader); canvas.drawPath(path, paint); - if(colorAround != 0){ - paintStroke.setColor(colorAround); + if(rc.colorAround != 0){ + paintStroke.setColor(rc.colorAround); paintStroke.setStrokeWidth(1); canvas.drawPath(path, paintStroke); } @@ -498,6 +367,8 @@ public class OsmandRenderer implements Comparator { } return null; } + + public void clearCachedResources(){ Collection values = new ArrayList(cachedIcons.values()); @@ -610,18 +481,17 @@ public class OsmandRenderer implements Comparator { private void drawPolyline(MapRenderObject obj, Canvas canvas, RenderingContext rc) { - int length = obj.getPointsLength(); - if(length < 2){ - return; - } int type = MapRenderingTypes.getObjectType(obj.getType()); int subtype = MapRenderingTypes.getPolylineSubType(obj.getType()); - - renderPolyline(type, subtype, rc); + PolylineRenderer.renderPolyline(type, subtype, obj.getType(), rc, this); if(rc.strokeWidth == 0){ return; } + int length = obj.getPointsLength(); + if(length < 2){ + return; + } Path path = null; float pathRotate = 0; float xLength = 0; @@ -729,215 +599,7 @@ public class OsmandRenderer implements Comparator { canvas.drawPath(path, paintStroke); } - public void renderPolyline(int type, int subtype, RenderingContext rc){ - int zoom = rc.zoom; - - int color = Color.BLACK; - boolean showText = true; - PathEffect pathEffect = null; - int shadowLayer = 0; - int shadowColor = 0; - float strokeWidth = zoom >= 15 ? 1 : 0; - if (type == MapRenderingTypes.HIGHWAY) { - int hwType = subtype; - boolean carRoad = true; - if (hwType == MapRenderingTypes.PL_HW_TRUNK) { - color = Color.rgb(168, 218, 168); - } else if (hwType == MapRenderingTypes.PL_HW_MOTORWAY) { - color = Color.rgb(128,155,192); - } else if (hwType == MapRenderingTypes.PL_HW_PRIMARY) { - color = Color.rgb(235, 152, 154); - } else if (hwType == MapRenderingTypes.PL_HW_SECONDARY) { - color = Color.rgb(253, 214, 164); - } else if (hwType == MapRenderingTypes.PL_HW_TERTIARY) { - color = Color.rgb(254, 254, 179); - shadowLayer = 2; - shadowColor = Color.rgb(186, 186, 186); - } else if (hwType == MapRenderingTypes.PL_HW_SERVICE || hwType == MapRenderingTypes.PL_HW_UNCLASSIFIED - || hwType == MapRenderingTypes.PL_HW_RESIDENTIAL) { - shadowLayer = 1; - shadowColor = Color.rgb(194, 194, 194); - color = Color.WHITE; - } else if (hwType == MapRenderingTypes.PL_HW_PEDESTRIAN) { - shadowLayer = 1; - shadowColor = Color.rgb(176, 176, 176); - color = Color.rgb(236, 236, 236); - } else { - carRoad = false; - strokeWidth = 2; - pathEffect = dashEffect2_2; - if (hwType == MapRenderingTypes.PL_HW_TRACK || hwType == MapRenderingTypes.PL_HW_PATH) { - color = Color.GRAY; - pathEffect = dashEffect6_2; - } else if (hwType == MapRenderingTypes.PL_HW_CYCLEWAY || hwType == MapRenderingTypes.PL_HW_BRIDLEWAY) { - color = Color.rgb(20, 20, 250); - } else { - color = Color.rgb(250, 128, 115); - } - } - if (carRoad) { - if(zoom <= 12){ - if (hwType <= MapRenderingTypes.PL_HW_SECONDARY) { - if (zoom < 10) { - strokeWidth = 1; - } else if (zoom < 12) { - strokeWidth = 2; - } else if (zoom == 12) { - strokeWidth = 3; - } - } else { - strokeWidth = 0; - } - } else if(zoom < 15){ - strokeWidth = 4.5f; - } else if (zoom < 16) { - strokeWidth = 6; - } else if (zoom == 16) { - strokeWidth = 8; - } else if (zoom == 17) { - strokeWidth = 13; - } else if (zoom >= 18) { - strokeWidth = 16; - } else if (zoom >= 19) { - strokeWidth = 20; - } - if (hwType == MapRenderingTypes.PL_HW_SERVICE) { - strokeWidth -= 2; - } - } - showText = (carRoad && zoom > 12) || zoom > 16; - } else if(type == MapRenderingTypes.BARRIER){ - if(subtype == 5){ - color = Color.GRAY; - if(zoom == 14){ - strokeWidth = 4; - } else if(zoom == 15){ - strokeWidth = 6; - } else if(zoom > 15){ - strokeWidth = 9; - } else { - strokeWidth = 0; - } - } else { - strokeWidth = zoom >= 16 ? 1 : 0; - color = Color.BLACK; - } - } else if(type == MapRenderingTypes.POWER){ - if (zoom >= 14) { - if (subtype == 3) { - color = Color.rgb(186, 186, 186); - strokeWidth = zoom == 14 ? 1 : 2; - } else if (subtype == 4) { - color = Color.rgb(186, 186, 186); - strokeWidth = 1; - } - } else { - strokeWidth = 0; - } - } else if(type == MapRenderingTypes.AERIALWAY){ - // TODO shader on path doesn't work - if(zoom >= 12){ - if(subtype == 1 || subtype == 2){ - color = Color.rgb(186, 186, 186); - strokeWidth = 2; - //paint.setShader(getShader(R.drawable.h_cable_car)); - } else if(subtype == 3 || subtype == 4 || subtype == 5){ - color = Color.rgb(186, 186, 186); - strokeWidth = 2; - //paint.setShader(getShader(R.drawable.h_chair_lift)); - } - } - } else if(type == MapRenderingTypes.ADMINISTRATIVE){ - color = 0xFF800080; - if(subtype == 29 || subtype == 30){ - // admin level 9, 10 - if (zoom > 12) { - pathEffect = dashEffect3_2; - strokeWidth = 1; - if (zoom > 16) { - strokeWidth = 2; - } - } else { - strokeWidth = 0; - } - } else if(subtype == 28 || subtype == 27){ - // admin level 7, 8 - if(zoom > 11){ - pathEffect = dashEffect5_2; - strokeWidth = 2; - } else { - strokeWidth = 0; - } - } else if(subtype == 25 || subtype == 26){ - // admin level 5, 6 - if(zoom > 10){ - pathEffect = subtype == 25 ? dashEffect6_3_2_3_2_3 : dashEffect6_3_2_3; - strokeWidth = 2; - } else { - strokeWidth = 0; - } - } else if(subtype == 24){ - // admin level 4 - pathEffect = dashEffect4_3; - if(zoom >= 4 && zoom <= 6){ - strokeWidth = 0.6f; - } else if(zoom >= 7 && zoom <= 10){ - strokeWidth = 2; - } else if(zoom > 10){ - strokeWidth = 3; - } else { - strokeWidth = 0; - } - } else if(subtype == 23 || subtype == 22){ - // admin level 2, 3 - if(zoom >= 4 && zoom <= 6){ - strokeWidth = 2; - } else if(zoom >= 7 && zoom <= 9){ - strokeWidth = 3; - } else if(zoom > 9){ - if(subtype == 22){ - strokeWidth = 6; - } else { - strokeWidth = 5; - pathEffect = dashEffect4_2; - } - } else { - strokeWidth = 0; - } - - } - } else if(type == MapRenderingTypes.RAILWAY){ - strokeWidth = 2; - if(subtype == 6){ - color = Color.rgb(153, 153, 153); - if(zoom > 16){ - strokeWidth = 3; - } - pathEffect = dashEffect6_3; - } else if(subtype == 2){ - color = Color.rgb(62, 62, 62); - } else if(subtype == 1){ - color = Color.rgb(153, 153, 153); - if(zoom >= 16){ - strokeWidth = 3; - } - pathEffect = dashEffect7_7; - } else { - color = Color.rgb(153, 153, 153); - } - } else if(type == MapRenderingTypes.WATERWAY){ - if(subtype >= 1 && subtype <= 6){ - strokeWidth = 2; - color = Color.rgb(181, 208, 208); - } - } - - rc.color = color; - rc.pathEffect = pathEffect; - rc.shadowColor = shadowColor; - rc.shadowLayer = shadowLayer; - rc.showText = showText; - rc.strokeWidth = strokeWidth; - } + + } diff --git a/OsmAnd/src/net/osmand/render/PointRenderer.java b/OsmAnd/src/net/osmand/render/PointRenderer.java index 4a31a75c2f..3f4cf4222a 100644 --- a/OsmAnd/src/net/osmand/render/PointRenderer.java +++ b/OsmAnd/src/net/osmand/render/PointRenderer.java @@ -288,7 +288,9 @@ public class PointRenderer { resId = R.drawable.h_pharmacy; } } else if (subType == 2) { - resId = R.drawable.h_hospital; + if(zoom >= 15){ + resId = R.drawable.h_hospital; + } } } else if (type == MapRenderingTypes.AMENITY_ENTERTAINMENT) { if (zoom >= 15) { diff --git a/OsmAnd/src/net/osmand/render/PolygonRenderer.java b/OsmAnd/src/net/osmand/render/PolygonRenderer.java new file mode 100644 index 0000000000..a5381387d3 --- /dev/null +++ b/OsmAnd/src/net/osmand/render/PolygonRenderer.java @@ -0,0 +1,296 @@ +package net.osmand.render; + +import net.osmand.R; +import net.osmand.osm.MapRenderingTypes; +import net.osmand.render.OsmandRenderer.RenderingContext; +import android.graphics.Color; + +public class PolygonRenderer { + + public static void renderPolygon(RenderingContext rc, int zoom, int type, int subtype, OsmandRenderer o) { + if (type == MapRenderingTypes.HIGHWAY) { + if (subtype == MapRenderingTypes.PL_HW_SERVICE || subtype == MapRenderingTypes.PL_HW_UNCLASSIFIED + || subtype == MapRenderingTypes.PL_HW_RESIDENTIAL) { + rc.colorAround = Color.rgb(194, 194, 194); + rc.color = Color.WHITE; + } else if(subtype == MapRenderingTypes.PL_HW_PEDESTRIAN || subtype == MapRenderingTypes.PL_HW_FOOTWAY){ + rc.color = Color.rgb(236, 236, 236); + rc.colorAround = Color.rgb(176, 176, 176); + } + } else if (type == MapRenderingTypes.WATERWAY) { + if(subtype == 3){ + rc.showPolygon = zoom >= 7; + rc.color = 0xffb5d0d0; + } else if(subtype == 4 || subtype == 7 || subtype == 13){ + rc.showPolygon = zoom >= 10; + rc.color = 0xffb5d0d0; + } + } else if (type == MapRenderingTypes.AEROWAY) { + if(subtype == 1){ + rc.showPolygon = zoom >= 12; + rc.color = 0x80cccccc; + } else if(subtype == 9){ + // apron + rc.showPolygon = zoom >= 13; + rc.color = 0xffe9d1ff; + } + } else if (type == MapRenderingTypes.POWER) { + if(subtype == 5 || subtype == 6){ + rc.showPolygon = zoom >= 13; + rc.color = 0xffbbbbbb; + } + } else if (type == MapRenderingTypes.MAN_MADE) { + rc.showPolygon = zoom > 15; + if (subtype == MapRenderingTypes.SUBTYPE_BUILDING) { + rc.color = Color.rgb(188, 169, 169); + } else if (subtype == MapRenderingTypes.SUBTYPE_GARAGES) { + rc.color = Color.rgb(221, 221, 221); + } + } else if (type == MapRenderingTypes.TOURISM) { + if (subtype == 2 || subtype == 7) { + rc.showPolygon = zoom >= 13; + rc.color = 0xfff2caea; + if(subtype == 7){ + rc.colorAround = 0xff734a08; + rc.pathEffect = o.getDashEffect("9_3"); //$NON-NLS-1$ + if(zoom <= 15){ + rc.strokeWidth = 1; + } else { + rc.strokeWidth = 2; + } + } + } else if(subtype >= 4 && subtype <= 6){ + rc.showPolygon = zoom >= 15; + rc.color = 0xa0ccff99; + } else if(subtype == 8){ + rc.showPolygon = zoom >= 13; + rc.shader = o.getShader(R.drawable.h_zoo); + } + + } else if (type == MapRenderingTypes.NATURAL) { + switch(subtype){ + case 2 : + rc.showPolygon = zoom >= 13; + rc.shader = o.getShader(R.drawable.h_beach); + case 5: + // TODO coastline + break; + case 7: + rc.showPolygon = zoom >= 8; + rc.shader = o.getShader(R.drawable.h_glacier); + if(zoom >= 10){ + rc.colorAround = 0xff99ccff; + rc.widthAround = 2; + } + break; + case 8: + rc.showPolygon = zoom >= 10; + rc.color = 0xffffffc0; + break; + case 9: + rc.showPolygon = zoom >= 11; + rc.color = 0xfff2efe9; + break; + case 11: + case 22: + rc.showPolygon = zoom >= 13; + rc.shader = o.getShader(R.drawable.h_marsh); + break; + case 12 : + rc.showPolygon = zoom >= 13; + rc.shader = o.getShader(R.drawable.h_mud); + break; + case 16 : + rc.showPolygon = zoom >= 13; + rc.shader = o.getShader(R.drawable.h_scrub); + break; + case 21: + rc.showPolygon = zoom >= 7; + rc.color = 0xffb5d0d0; + break; + case 23 : + rc.showPolygon = zoom >= 8; + rc.color = 0xffaed1a0; + break; + } + } else if (type == MapRenderingTypes.LANDUSE) { + switch (subtype) { + case 1: + rc.showPolygon = zoom >= 13; + rc.color = 0xffc8b084; + break; + case 2: + rc.showPolygon = zoom >= 10; + rc.color = 0xffb5d0d0; + break; + case 4: + rc.showPolygon = zoom >= 12; + if(zoom >= 12 && zoom <= 14){ + rc.color = 0xffaacbaf; + } else if (zoom > 14) { + rc.shader = o.getShader(R.drawable.h_grave_yard); + } + break; + case 5: + rc.showPolygon = zoom >= 12; + rc.color = 0xffefc8c8; + break; + case 3: + case 6: + case 13: + case 16: + rc.showPolygon = zoom >= 12; + rc.color = 0xff9d9d6c; + break; + case 7: + rc.showPolygon = zoom >= 11; + rc.color = 0xffead8bd; + break; + case 9: + rc.showPolygon = zoom >= 11; + rc.color = 0xffddbf92; + break; + case 10: + if(zoom < 8){ + rc.showPolygon = false; + } else if(zoom <= 13){ + rc.color = 0xff8dc56c; + } else { + rc.shader = o.getShader(R.drawable.h_forest); + } + break; + case 11 : + rc.color = Color.rgb(223, 209, 214); + break; + case 12: + case 17: + rc.showPolygon = zoom >= 12; + rc.color = 0xffcfeca8; + break; + case 15: + case 20: + rc.color = 0xffdfd1d6; + rc.showPolygon = zoom >= 12; + break; + case 18: + rc.showPolygon = zoom >= 12; + rc.color = 0xa0ffa8a8; + break; + case 19: + rc.showPolygon = zoom >= 10; + rc.shader = o.getShader(R.drawable.h_orchard); + break; + case 21: + rc.color = 0xffcfeca8; + rc.showPolygon = zoom >= 12; + break; + case 22 : + rc.showPolygon = zoom >= 7; + rc.color = 0xffb5d0d0; + break; + case 23: + rc.showPolygon = zoom >= 12; + rc.color = 0xffdddddd; + break; + case 24: + rc.showPolygon = zoom >= 12; + rc.color = 0xffcfeca8; + if(zoom >= 15){ + rc.colorAround = Color.RED; + } + break; + case 26: + rc.showPolygon = zoom >= 13; + rc.shader = o.getShader(R.drawable.h_quarry2); + break; + case 27: + rc.showPolygon = zoom >= 10; + if(zoom < 14){ + rc.color = 0xffabdf96; + } else { + rc.shader = o.getShader(R.drawable.h_vineyard); + } + break; + } + } else if (type == MapRenderingTypes.MILITARY) { + if(subtype == 3){ + rc.showPolygon = zoom >= 13; + rc.color = 0xffff8f8f; + } else if(subtype == 4){ + rc.showPolygon = zoom >= 10; + rc.shader = o.getShader(R.drawable.h_danger); + } + } else if (type == MapRenderingTypes.LEISURE) { + switch (subtype) { + case 2: + case 4: + rc.showPolygon = zoom >= 13; + rc.color = 0xff33cc99; + break; + case 3: + rc.showPolygon = zoom >= 12; + rc.color = 0xffb5e3b5; + break; + case 5: + rc.showPolygon = zoom >= 12; + rc.colorAround = 0xff888888; + rc.widthAround = 1; + rc.color = 0xff74dcba; + break; + case 6: + rc.color = 0xff8ad3af; + rc.showPolygon = zoom >= 13; + rc.colorAround = 0xff888888; + rc.widthAround = 1; + break; + case 11: + if(zoom < 8){ + rc.showPolygon = false; + } else if(zoom >= 8 && zoom <= 12){ + rc.showPolygon = true; + rc.color = 0xffabdf96; + } else { + rc.showPolygon = true; + rc.shader = o.getShader(R.drawable.h_nr); + } + break; + case 12: + rc.showPolygon = zoom >= 12; + rc.color = 0xb0b6fdb6; + break; + case 13: + rc.color = 0xffccfff1; + rc.showPolygon = zoom >= 15; + break; + case 14: + case 15: + rc.showPolygon = zoom >= 12; + rc.color = 0xffcfeca8; + break; + } + } else if (type == MapRenderingTypes.AMENITY_HEALTHCARE) { + if (subtype == 2) { + rc.showPolygon = zoom >= 15; + rc.color = 0xfff0f0d8; + rc.colorAround = Color.rgb(212, 168, 158); + } + } else if (type == MapRenderingTypes.AMENITY_TRANSPORTATION) { + if (subtype == 1 || subtype == 2) { + rc.color = Color.rgb(246, 238, 183); + } + } else if (type == MapRenderingTypes.AMENITY_ENTERTAINMENT) { + if (subtype == 3) { + rc.color = Color.rgb(204, 153, 153); + } + } else if (type == MapRenderingTypes.AMENITY_EDUCATION) { + if(subtype == 1 || subtype == 2 || subtype == 3 || subtype == 5){ + rc.showPolygon = zoom >= 15; + rc.color = 0xfff0f0d8; + rc.colorAround = Color.rgb(212, 168, 158); + } else { + // draw as building education + rc.color = Color.rgb(188, 169, 169); + } + } + } +} diff --git a/OsmAnd/src/net/osmand/render/PolylineRenderer.java b/OsmAnd/src/net/osmand/render/PolylineRenderer.java new file mode 100644 index 0000000000..f8b715bf6f --- /dev/null +++ b/OsmAnd/src/net/osmand/render/PolylineRenderer.java @@ -0,0 +1,394 @@ +package net.osmand.render; + +import net.osmand.osm.MapRenderingTypes; +import net.osmand.render.OsmandRenderer.RenderingContext; +import android.graphics.Color; +import android.graphics.PathEffect; + +public class PolylineRenderer { + + public static void renderPolyline(int type, int subtype, int objType, RenderingContext rc, OsmandRenderer o){ + int zoom = rc.zoom; + + int color = Color.BLACK; + boolean showText = true; + PathEffect pathEffect = null; + int shadowLayer = 0; + int shadowColor = 0; + float strokeWidth = zoom >= 15 ? 1 : 0; + if (type == MapRenderingTypes.HIGHWAY) { + int hwType = subtype; + boolean carRoad = true; + if (hwType == MapRenderingTypes.PL_HW_TRUNK) { + color = Color.rgb(168, 218, 168); + } else if (hwType == MapRenderingTypes.PL_HW_MOTORWAY) { + color = Color.rgb(128,155,192); + } else if (hwType == MapRenderingTypes.PL_HW_PRIMARY) { + color = Color.rgb(235, 152, 154); + } else if (hwType == MapRenderingTypes.PL_HW_SECONDARY) { + color = Color.rgb(253, 214, 164); + } else if (hwType == MapRenderingTypes.PL_HW_TERTIARY) { + color = Color.rgb(254, 254, 179); + shadowLayer = 2; + shadowColor = Color.rgb(186, 186, 186); + } else if (hwType == MapRenderingTypes.PL_HW_SERVICE || hwType == MapRenderingTypes.PL_HW_UNCLASSIFIED + || hwType == MapRenderingTypes.PL_HW_RESIDENTIAL) { + shadowLayer = 1; + shadowColor = Color.rgb(194, 194, 194); + color = Color.WHITE; + } else if (hwType == MapRenderingTypes.PL_HW_PEDESTRIAN) { + shadowLayer = 1; + shadowColor = Color.rgb(176, 176, 176); + color = Color.rgb(236, 236, 236); + } else { + carRoad = false; + strokeWidth = 2; + pathEffect = o.getDashEffect("2_2"); //$NON-NLS-1$ + if (hwType == MapRenderingTypes.PL_HW_TRACK || hwType == MapRenderingTypes.PL_HW_PATH) { + color = Color.GRAY; + pathEffect = o.getDashEffect("6_2"); //$NON-NLS-1$ + } else if (hwType == MapRenderingTypes.PL_HW_CYCLEWAY || hwType == MapRenderingTypes.PL_HW_BRIDLEWAY) { + color = Color.rgb(20, 20, 250); + } else { + color = Color.rgb(250, 128, 115); + } + } + if (carRoad) { + if (zoom < 10) { + // done + strokeWidth = 0; + if (hwType <= MapRenderingTypes.PL_HW_SECONDARY) { + if (hwType == MapRenderingTypes.PL_HW_SECONDARY) { + strokeWidth = zoom >= 8 ? 1 : 0; + } else if (hwType == MapRenderingTypes.PL_HW_PRIMARY) { + if (zoom < 7) { + strokeWidth = 0; + } else if (zoom == 7) { + strokeWidth = 1.5f; + } else if (zoom == 8 || zoom == 9) { + strokeWidth = 2f; + } + } else if (hwType == MapRenderingTypes.PL_HW_TRUNK || hwType == MapRenderingTypes.PL_HW_MOTORWAY) { + if(zoom >= 7){ + strokeWidth = 3.5f; + } else if(zoom == 6){ + strokeWidth = 2; + } else if(zoom == 5){ + strokeWidth = 1; + } else { + strokeWidth = 0; + } + } + } + } else if (zoom <= 12) { + if (hwType <= MapRenderingTypes.PL_HW_SECONDARY) { + if (zoom < 12) { + strokeWidth = 2; + } else if (zoom == 12) { + strokeWidth = 3; + } + } else { + strokeWidth = 0; + } + } else { + int layer = MapRenderingTypes.getWayLayer(objType); + if(layer == 1){ + pathEffect = o.getDashEffect("4_2"); //$NON-NLS-1$ + } + if (zoom < 15) { + strokeWidth = 4.5f; + } else if (zoom < 16) { + strokeWidth = 6; + } else if (zoom == 16) { + strokeWidth = 8; + } else if (zoom == 17) { + strokeWidth = 13; + } else if (zoom >= 18) { + strokeWidth = 16; + } else if (zoom >= 19) { + strokeWidth = 20; + } + if (hwType == MapRenderingTypes.PL_HW_SERVICE) { + strokeWidth -= 2; + } + } + + } + showText = (carRoad && zoom > 12) || zoom > 16; + } else if(type == MapRenderingTypes.RAILWAY){ + if(zoom < 10){ + if (subtype == 2) { + color = 0xffaaaaaa; + if (zoom < 7) { + strokeWidth = 0; + } else if (zoom == 7) { + strokeWidth = 1; + } else if (zoom == 8) { + strokeWidth = 1.5f; + } else if (zoom == 9) { + strokeWidth = 2; + } + } else { + strokeWidth = 0; + } + } else { + // TODO tunnel + strokeWidth = 2; + if (subtype == 6) { + color = Color.rgb(153, 153, 153); + if (zoom > 16) { + strokeWidth = 3; + } + pathEffect = o.getDashEffect("6_3"); //$NON-NLS-1$ + } else if (subtype == 2) { + color = Color.rgb(62, 62, 62); + } else if (subtype == 1) { + color = Color.rgb(153, 153, 153); + if (zoom >= 16) { + strokeWidth = 3; + } + pathEffect = o.getDashEffect("7_7"); //$NON-NLS-1$ + } else { + color = Color.rgb(153, 153, 153); + } + } + } else if(type == MapRenderingTypes.WATERWAY){ + + if(zoom <= 10){ + strokeWidth = 0; + // draw rivers & canals + if (subtype == 2 || subtype == 4) { + color = 0xffb5d0d0; + if (zoom == 10) { + strokeWidth = 2; + } else if (zoom == 9) { + strokeWidth = 1; + } + } + } else { + switch (subtype) { + case 1: + if (zoom >= 15) { + color = 0xffb5d0d0; + strokeWidth = 2; + } else { + strokeWidth = 0; + } + break; + case 2: + case 4: + color = 0xffb5d0d0; + + if(zoom < 13){ + strokeWidth = 2; + } else { + int layer = MapRenderingTypes.getWayLayer(objType); + if (layer == 1) { + pathEffect = o.getDashEffect("4_2"); //$NON-NLS-1$ + } + if (zoom == 13) { + strokeWidth = 3; + } else if (zoom == 14) { + strokeWidth = 5; + } else if (zoom == 15 || zoom == 16) { + strokeWidth = 6; + } else if (zoom == 17) { + strokeWidth = 10; + } else if (zoom == 18) { + strokeWidth = 12; + } + } + break; + case 5: + case 6: + color = 0xffb5d0d0; + if(zoom < 13){ + strokeWidth = 0; + } else if(zoom < 15){ + strokeWidth = 1; + } else { + int layer = MapRenderingTypes.getWayLayer(objType); + if (layer == 1) { + pathEffect = o.getDashEffect("4_2"); //$NON-NLS-1$ + } + strokeWidth = 2; + } + break; + + case 11: + if(zoom < 15){ + strokeWidth = 0; + } else { + strokeWidth = 2; + color = 0xffaaaaaa; + } + break; + case 12: + if(zoom >= 13){ + strokeWidth = 2; + } else { + strokeWidth = 0; + } + color = 0xffb5d0d0; + default: + break; + } + } + } else if(type == MapRenderingTypes.BARRIER){ + if(subtype == 5){ + color = Color.GRAY; + if(zoom == 14){ + strokeWidth = 4; + } else if(zoom == 15){ + strokeWidth = 6; + } else if(zoom > 15){ + strokeWidth = 9; + } else { + strokeWidth = 0; + } + } else { + strokeWidth = zoom >= 16 ? 1 : 0; + color = Color.BLACK; + } + } else if(type == MapRenderingTypes.POWER){ + if (zoom >= 14) { + if (subtype == 3) { + color = Color.rgb(186, 186, 186); + strokeWidth = zoom == 14 ? 1 : 2; + } else if (subtype == 4) { + color = Color.rgb(186, 186, 186); + strokeWidth = 1; + } + } else { + strokeWidth = 0; + } + } else if(type == MapRenderingTypes.AERIALWAY){ + // TODO shader on path doesn't work + if(zoom >= 12){ + if(subtype == 1 || subtype == 2){ + color = Color.rgb(186, 186, 186); + strokeWidth = 2; + //paint.setShader(getShader(R.drawable.h_cable_car)); + } else if(subtype == 3 || subtype == 4 || subtype == 5){ + color = Color.rgb(186, 186, 186); + strokeWidth = 2; + //paint.setShader(getShader(R.drawable.h_chair_lift)); + } + } + } else if(type == MapRenderingTypes.MAN_MADE){ + if(subtype == 8){ + // breakwater, groyone + color = 0xffaaaaaa; + if(zoom < 12){ + strokeWidth = 0; + } else if(zoom < 14){ + strokeWidth = 1; + } else if(zoom < 16){ + strokeWidth = 2; + } else { + strokeWidth = 4; + } + } else if(subtype == 9){ + // pier + color = 0xfff2efe9; + if(zoom < 12){ + strokeWidth = 0; + } else if(zoom < 14){ + strokeWidth = 1; + } else if(zoom < 16){ + strokeWidth = 3; + } else { + strokeWidth = 6; + } + } + } else if(type == MapRenderingTypes.LEISURE){ + if(subtype == 8){ + if(zoom < 13){ + strokeWidth = 0; + } else if(zoom < 16){ + color = Color.BLUE; + strokeWidth = 1; + pathEffect = o.getDashEffect("6_2"); //$NON-NLS-1$ + } else { + color = Color.BLUE; + strokeWidth = 2; + pathEffect = o.getDashEffect("6_2"); //$NON-NLS-1$ + } + } else if(subtype == 5){ + if (zoom >= 13) { + color = 0xff888888; + strokeWidth = 1; + } else { + strokeWidth = 0; + } + } + } else if(type == MapRenderingTypes.ADMINISTRATIVE){ + color = 0xFF800080; + if(subtype == 29 || subtype == 30){ + // admin level 9, 10 + if (zoom > 12) { + pathEffect = o.getDashEffect("3_2"); //$NON-NLS-1$ + strokeWidth = 1; + if (zoom > 16) { + strokeWidth = 2; + } + } else { + strokeWidth = 0; + } + } else if(subtype == 28 || subtype == 27){ + // admin level 7, 8 + if(zoom > 11){ + pathEffect = o.getDashEffect("5_2"); //$NON-NLS-1$ + strokeWidth = 2; + } else { + strokeWidth = 0; + } + } else if(subtype == 25 || subtype == 26){ + // admin level 5, 6 + if(zoom > 10){ + pathEffect = subtype == 25 ? o.getDashEffect("6_3_2_3_2_3") : o.getDashEffect("6_3_2_3"); //$NON-NLS-1$ //$NON-NLS-2$ + strokeWidth = 2; + } else { + strokeWidth = 0; + } + } else if(subtype == 24){ + // admin level 4 + pathEffect = o.getDashEffect("4_3"); //$NON-NLS-1$ + if(zoom >= 4 && zoom <= 6){ + strokeWidth = 0.6f; + } else if(zoom >= 7 && zoom <= 10){ + strokeWidth = 2; + } else if(zoom > 10){ + strokeWidth = 3; + } else { + strokeWidth = 0; + } + } else if(subtype == 23 || subtype == 22){ + // admin level 2, 3 + if(zoom >= 4 && zoom <= 6){ + strokeWidth = 2; + } else if(zoom >= 7 && zoom <= 9){ + strokeWidth = 3; + } else if(zoom > 9){ + if(subtype == 22){ + strokeWidth = 6; + } else { + strokeWidth = 5; + pathEffect = o.getDashEffect("4_2"); //$NON-NLS-1$ + } + } else { + strokeWidth = 0; + } + + } + + } + + rc.color = color; + rc.pathEffect = pathEffect; + rc.shadowColor = shadowColor; + rc.shadowLayer = shadowLayer; + rc.showText = showText; + rc.strokeWidth = strokeWidth; + } +} diff --git a/OsmAnd/src/net/osmand/render/features_done.xml b/OsmAnd/src/net/osmand/render/features_done.xml new file mode 100644 index 0000000000..ec76120a96 --- /dev/null +++ b/OsmAnd/src/net/osmand/render/features_done.xml @@ -0,0 +1,513 @@ + + + + + + + diff --git a/OsmAnd/src/net/osmand/render/features_not_done_mapnik.xml b/OsmAnd/src/net/osmand/render/features_not_done_mapnik.xml new file mode 100644 index 0000000000..740a0fa312 --- /dev/null +++ b/OsmAnd/src/net/osmand/render/features_not_done_mapnik.xml @@ -0,0 +1,2701 @@ + + +%entities; +]> + + + &fontset-settings; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +&layer-shapefiles; + + leisure + + + (select way,aeroway,amenity,landuse,leisure,man_made,military,"natural",power,shop,tourism,name, + case when religion in ('christian','jewish') then religion else 'INT-generic'::text end as religion + from &prefix;_polygon + where landuse is not null + or leisure is not null + or shop is not null + or aeroway in ('apron','aerodrome') + or amenity in ('parking','university','college','school','hospital','kindergarten','grave_yard') + or military in ('barracks','danger_area') + or "natural" in ('field','beach','heath','mud','wood') + or power in ('station','sub_station') + or tourism in ('attraction','camp_site','caravan_site','picnic_site','zoo') + order by z_order,way_area desc + ) as leisure + + &datasource-settings; + + + + sports_grounds + + + (select way,leisure, + case when leisure='pitch' then 2 + when leisure='track' then 1 + else 0 end as prio + from &prefix;_polygon + where leisure in ('sports_centre','stadium','pitch','track') + order by z_order,prio,way_area desc + ) as sports_grounds + + &datasource-settings; + + +&layer-water; +&layer-water_features; + + tunnels-casing + tunnels-fill + + + (select way,highway from &prefix;_line where highway in ('motorway','motorway_link','trunk','trunk_link','primary','primary_link','secondary','secondary_link','tertiary','tertiary_link','residential','unclassified','minor') and tunnel in ('yes','true','1') order by z_order) as roads + + &datasource-settings; + + +&layer-citywall; + + turning_circle-casing + + + (select p.way as way,l.highway as int_tc_type + from &prefix;_point p + join &prefix;_line l + on ST_DWithin(p.way,l.way,&dwithin_node_way;) + where p.highway='turning_circle' and l.highway in ('tertiary','unclassified','residential','service','living_street') + ) as turning_circle + + &datasource-settings; + + + + + footbikecycle-tunnels + + + (select way,highway,horse,foot,bicycle from &prefix;_line where highway in ('bridleway','footway','cycleway','path') and tunnel in ('yes','true','1') order by z_order) as roads + + &datasource-settings; + + + + tracks-tunnels + + + (select way,tracktype from &prefix;_line where highway='track' and tunnel in ('yes','true','1')) as tracks + + &datasource-settings; + + +&layer-buildings; + + cliffs + barriers + + + (select way,barrier,"natural",man_made from &prefix;_line where barrier is not null or "natural" in ('hedge','cliff') or man_made='embankment') as roads + + &datasource-settings; + + + + barriers + + + (select way,barrier,"natural" from &prefix;_polygon where barrier is not null or "natural"='hedge') as barriers + + &datasource-settings; + + + + highway-area-casing + + + (select way,highway,railway from &prefix;_polygon + where highway in ('residential','unclassified','pedestrian','service','footway','track','path','platform') + or railway='platform' + order by z_order,way_area desc) as roads + + &datasource-settings; + + + + minor-roads-casing-links + minor-roads-casing + + + (select way,highway,service, + case when tunnel in ('yes','true','1') then 'yes'::text else tunnel end as tunnel + from &prefix;_line + where highway in ('motorway','motorway_link','trunk','trunk_link','primary','primary_link','secondary','secondary_link','tertiary','tertiary_link','residential','unclassified','minor','road','service','pedestrian','raceway','living_street') + order by z_order) as roads + + &datasource-settings; + + + + turning_circle-fill + + + (select p.way as way,l.highway as int_tc_type + from &prefix;_point p + join &prefix;_line l + on ST_DWithin(p.way,l.way,&dwithin_node_way;) + where p.highway='turning_circle' and l.highway in ('tertiary','unclassified','residential','service','living_street') + ) as turning_circle + + &datasource-settings; + + + + highway-area-fill + + + (select way,highway,railway from &prefix;_polygon + where highway in ('residential','unclassified','pedestrian','service','footway','living_street','track','path','platform') + or railway='platform' + order by z_order,way_area desc) as roads + + &datasource-settings; + + + + tracks-notunnel-nobridge + + + (select way,tracktype from &prefix;_line where highway='track' and (bridge is null or bridge in ('no','false','0')) and (tunnel is null or tunnel in ('no','false','0'))) as tracks + + &datasource-settings; + + + + minor-roads-fill-links + minor-roads-fill + + + (select way,highway,horse,bicycle,foot,construction,aeroway,service, + case when tunnel in ('yes','true','1') then 'yes'::text else tunnel end as tunnel, + case when bridge in ('yes','true','1') then 'yes'::text else bridge end as bridge, + case when railway in ('spur','siding') + or (railway='rail' and service in ('spur','siding','yard')) + then 'spur-siding-yard'::text else railway end as railway + from &prefix;_line + where highway is not null + or aeroway in ('runway','taxiway') + or railway in ('light_rail','narrow_gauge','funicular','rail','subway','tram','spur','siding','platform','disused','abandoned','construction') + order by z_order) as roads + + &datasource-settings; + + +&layer-ferry-routes; +&layer-aerialways; + + + roads + + + (select way,highway,railway, + case when tunnel in ('yes','true','1') then 'yes'::text else tunnel end as tunnel + from &prefix;_roads + where highway is not null + or (railway is not null and (service is null or service not in ('spur','siding','yard'))) + order by z_order + ) as roads + + &datasource-settings; + + + + waterway-bridges + + (select way,name from &prefix;_line where waterway='canal' and bridge in ('yes','true','1','aqueduct') order by z_order) as water + &datasource-settings; + + + + road-bridges-casing + road-bridges-fill + noncased-ways-bridges + primarybridge_layer0_casing + mwaybridge_layer0_casing + primarybridge_layer0_fill + mwaybridge_layer0_fill + primarybridge_layer1_casing + mwaybridge_layer1_casing + primarybridge_layer1_fill + mwaybridge_layer1_fill + primarybridge_layer2_casing + mwaybridge_layer2_casing + primarybridge_layer2_fill + mwaybridge_layer2_fill + mwaybridge_layer3_casing + mwaybridge_layer3_fill + mwaybridge_layer4_casing + mwaybridge_layer4_fill + mwaybridge_layer5_casing + mwaybridge_layer5_fill + + + (select way,highway,aeroway,railway,layer,horse,bicycle,foot,bridge + from &prefix;_line + where (highway is not null + or aeroway in ('runway','taxiway') + or railway in ('light_rail','subway')) + and bridge not in ('no','false','0') + order by z_order + ) as roads + + &datasource-settings; + + + + tracks-bridges + + + (select way,tracktype from &prefix;_line where highway='track' and bridge in ('yes','true','1')) as tracks + + &datasource-settings; + + + + access + + + (select way,access,highway from &prefix;_line where access is not null) as access + + &datasource-settings; + + + + trams + + + (select way from &prefix;_line where railway='tram' and (tunnel is null or tunnel not in ('yes','true','1'))) as trams + + &datasource-settings; + + + + guideways + + + (select way from &prefix;_line where highway='bus_guideway' and (tunnel is null or tunnel not in ('yes','true','1'))) as guideways + + &datasource-settings; + + +&layer-admin; +&layer-placenames; +&layer-amenity-stations; +&layer-amenity-symbols; +&layer-amenity-points; +&layer-power; + + directions + + + (select way, + case when oneway in ('yes','true','1') then 'yes'::text else oneway end as oneway + from &prefix;_line + where oneway is not null + and (highway is not null or railway is not null or waterway is not null) + ) as directions + + &datasource-settings; + + + + roads-text-low-zoom + + + (select way,highway,ref,char_length(ref) as length + from &prefix;_roads + where highway in ('motorway','trunk','primary') + and ref is not null + ) as roads + + &datasource-settings; + + + + highway-junctions + + + (select way,ref,name + from &prefix;_point + where highway='motorway_junction' + ) as junctions + + &datasource-settings; + + + + roads-text + + + (select way,highway,aeroway,name,ref,char_length(ref) as length, + case when bridge in ('yes','true','1') then 'yes'::text else bridge end as bridge + from &prefix;_line + where waterway IS NULL + and leisure IS NULL + and landuse IS NULL + and (name is not null or ref is not null) + ) as roads + + &datasource-settings; + + + + text + + + (select way,amenity,shop,access,leisure,landuse,man_made,"natural",place,tourism,ele,name,ref,military,aeroway,waterway,historic,'yes'::text as point + from &prefix;_point + where amenity is not null + or shop in ('supermarket','bakery','clothes','fashion','convenience','doityourself','hairdresser','department_store', 'butcher') + or leisure is not null + or landuse is not null + or tourism is not null + or "natural" is not null + or man_made in ('lighthouse','windmill') + or place='island' + or military='danger_area' + or aeroway='gate' + or waterway='lock' + or historic='memorial' + ) as text + + &datasource-settings; + + + + text + + + (select way,aeroway,shop,access,amenity,leisure,landuse,man_made,"natural",place,tourism,NULL as ele,name,ref,military,waterway,historic,'no'::text as point + from &prefix;_polygon + where amenity is not null + or shop in ('supermarket','bakery','clothes','fashion','convenience','doityourself','hairdresser','department_store', 'butcher') + or leisure is not null + or landuse is not null + or tourism is not null + or "natural" is not null + or man_made in ('lighthouse','windmill') + or place='island' + or military='danger_area' + or historic='memorial' + ) as text + + &datasource-settings; + + + + area-text + + + (select way,way_area,name + from &prefix;_polygon + where name is not null + and (waterway is null or waterway <> 'riverbank') + order by z_order,way_area desc + ) as text + + &datasource-settings; + + +&layer-addressing; + + boundary + + + (select way,name,boundary from &prefix;_polygon where boundary='national_park') as boundary + + &datasource-settings; + + + + theme_park + + + (select way,name,tourism from &prefix;_polygon where tourism='theme_park') as theme_park + + &datasource-settings; + + + diff --git a/OsmAnd/src/net/osmand/render/features_text.xml b/OsmAnd/src/net/osmand/render/features_text.xml new file mode 100644 index 0000000000..b842177bed --- /dev/null +++ b/OsmAnd/src/net/osmand/render/features_text.xml @@ -0,0 +1,774 @@ + + + + + + + + + + + + diff --git a/OsmAnd/src/net/osmand/render/roads.xml b/OsmAnd/src/net/osmand/render/roads.xml new file mode 100644 index 0000000000..74212e972b --- /dev/null +++ b/OsmAnd/src/net/osmand/render/roads.xml @@ -0,0 +1,2866 @@ + + + + + + + + + + +