From 5a43b6e3f60bfa05f326eae89f9833b4503c2d4e Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Thu, 30 Jun 2011 14:11:40 +0200 Subject: [PATCH] Fix multipolygon issue --- .../src/net/osmand/data/Boundary.java | 4 +-- .../src/net/osmand/data/MapAlgorithms.java | 34 +------------------ .../osmand/data/index/IndexBatchCreator.java | 2 +- .../osmand/data/preparation/IndexCreator.java | 11 +++--- 4 files changed, 8 insertions(+), 43 deletions(-) diff --git a/DataExtractionOSM/src/net/osmand/data/Boundary.java b/DataExtractionOSM/src/net/osmand/data/Boundary.java index 1b077b31cf..203c7513d1 100644 --- a/DataExtractionOSM/src/net/osmand/data/Boundary.java +++ b/DataExtractionOSM/src/net/osmand/data/Boundary.java @@ -28,14 +28,14 @@ public class Boundary { int intersections = 0; for(Way w : outerWays){ for(int i=0; i b.getLatitude()){ - return false; - } else { - if(longitude > Math.max(a.getLongitude(), b.getLongitude())) { - return true; - } else if(longitude < Math.min(a.getLongitude(), b.getLongitude())){ - return false; - } else { - if(a.getLongitude() == b.getLongitude()) { - // the node on the boundary !!! - return true; - } - // that tested on all cases (left/right) - double mR = (b.getLatitude() - a.getLatitude()) / (b.getLongitude() - a.getLongitude()); - double mB = (latitude - a.getLatitude()) / (longitude - a.getLongitude()); - if(mB <= mR){ - return true; - } else { - return false; - } - } - } - } - } diff --git a/DataExtractionOSM/src/net/osmand/data/index/IndexBatchCreator.java b/DataExtractionOSM/src/net/osmand/data/index/IndexBatchCreator.java index fd7e7fde52..706f4b5ce2 100644 --- a/DataExtractionOSM/src/net/osmand/data/index/IndexBatchCreator.java +++ b/DataExtractionOSM/src/net/osmand/data/index/IndexBatchCreator.java @@ -168,7 +168,7 @@ public class IndexBatchCreator { } String szoomWaySmoothness = process.getAttribute("zoomWaySmoothness"); - if(szoomWaySmoothness != null){ + if(szoomWaySmoothness != null && !szoomWaySmoothness.equals("")){ zoomWaySmoothness = Integer.parseInt(szoomWaySmoothness); } diff --git a/DataExtractionOSM/src/net/osmand/data/preparation/IndexCreator.java b/DataExtractionOSM/src/net/osmand/data/preparation/IndexCreator.java index 96af28030e..1a77404da0 100644 --- a/DataExtractionOSM/src/net/osmand/data/preparation/IndexCreator.java +++ b/DataExtractionOSM/src/net/osmand/data/preparation/IndexCreator.java @@ -605,15 +605,12 @@ public class IndexCreator { // creator.deleteOsmDB = true; // creator.setZoomWaySmothness(2); - creator.setNodesDBFile(new File("/home/victor/projects/OsmAnd/data/osm-gen/nodes.tmp.odb")); -// creator.generateIndexes(new File("/home/victor/projects/OsmAnd/data/osm-maps/germany_bayern_part.osm"), - creator.generateIndexes(new File("/home/victor/projects/OsmAnd/data/belarus-osm/belarus.osm.pbf"), - - new ConsoleProgressImplementation(1), null, MapZooms.getDefault(), null); - -// creator.generateIndexes(new File("/home/victor/projects/OsmAnd/data/osm-maps/minsk_around.osm"), +// creator.setNodesDBFile(new File("/home/victor/projects/OsmAnd/data/osm-gen/nodes.tmp.odb")); +// creator.generateIndexes(new File("/home/victor/projects/OsmAnd/data/belarus-osm/belarus.osm.pbf"), // new ConsoleProgressImplementation(1), null, MapZooms.getDefault(), null); + + // world generation // MapZooms mapZooms = new MapZooms(); // MapZoomPair pair1 = new MapZooms.MapZoomPair(1, 3);