[Git][debian-gis-team/mkgmap-splitter][upstream] New upstream version 0.0.0+svn650

Bas Couwenberg (@sebastic) gitlab at salsa.debian.org
Fri Apr 1 08:53:23 BST 2022



Bas Couwenberg pushed to branch upstream at Debian GIS Project / mkgmap-splitter


Commits:
aa07db12 by Bas Couwenberg at 2022-04-01T09:42:37+02:00
New upstream version 0.0.0+svn650
- - - - -


3 changed files:

- resources/splitter-version.properties
- src/uk/me/parabola/splitter/DataStorer.java
- src/uk/me/parabola/splitter/solver/SplittableDensityArea.java


Changes:

=====================================
resources/splitter-version.properties
=====================================
@@ -1,2 +1,2 @@
-svn.version: 647
-build.timestamp: 2022-02-16T20:10:00+0000
+svn.version: 650
+build.timestamp: 2022-03-28T13:44:07+0100


=====================================
src/uk/me/parabola/splitter/DataStorer.java
=====================================
@@ -185,7 +185,7 @@ public class DataStorer {
 		List<Area> distinctAreas = distinctDataStorer.getAreaDictionary().getAreas();
 		Map<Area, Integer> map = new HashMap<>();
 		for (Area distinctArea : distinctAreas) {
-			if (distinctArea.getMapId() < 0 && !distinctArea.isPseudoArea()) {
+			if (!distinctArea.isPseudoArea()) {
 				AreaSet w = new AreaSet();
 				for (int i = 0; i < getNumOfAreas(); i++) {
 					if (this.areaDictionary.getArea(i).contains(distinctArea)) {
@@ -193,7 +193,7 @@ public class DataStorer {
 					}
 				}
 				map.put(distinctArea, this.areaDictionary.translate(w));
-			}
+			} 
 		}
 
 		for (Entry<Long, Integer> e : distinctDataStorer.oneDistinctAreaOnlyRels.entrySet()) {
@@ -202,7 +202,9 @@ public class DataStorer {
 			int pos = singleArea.iterator().next();
 			if (!distinctAreas.get(pos).isPseudoArea()) {
 				Integer areaIdx = map.get(distinctAreas.get(pos));
-				oneTileOnlyRels.put(e.getKey(), areaIdx != null ? areaIdx : e.getValue());
+				if (areaIdx == null)
+					throw new SplitFailedException("failed to find index for area " + distinctAreas.get(pos)); 
+				oneTileOnlyRels.put(e.getKey(), areaIdx);
 			} else {
 				oneTileOnlyRels.put(e.getKey(), AbstractMapProcessor.UNASSIGNED);
 			}


=====================================
src/uk/me/parabola/splitter/solver/SplittableDensityArea.java
=====================================
@@ -169,20 +169,26 @@ public class SplittableDensityArea {
 			return getAreas(split(), null);
 		if (polygonArea.isSingular()) {
 			java.awt.geom.Area rasteredArea = allDensities.rasterPolygon(polygonArea);
-			if (rasteredArea.isEmpty()) {
-				System.err.println("Bounding polygon doesn't intersect with the bounding box of the input file(s)");
-				return Collections.emptyList();
-			}
-			if (rasteredArea.isSingular()) {
-				prepare(polygonArea);
-				Tile tile = new Tile(extraDensityInfo, rasteredArea.getBounds());
-				Solution solution = findSolutionWithSinglePolygon(0, tile, rasteredArea);
-				if (solution == null && rasteredArea.isRectangular()) 
-					solution = split();
-				if (solution != null) { 
-					return getAreas(solution, polygonArea);
+			List<List<Point>> shapes = Utils.areaToShapes(rasteredArea);
+			List<Area> areas = new ArrayList<>();
+			for (List<Point> shape : shapes) {
+				java.awt.geom.Area rasteredPart = Utils.shapeToArea(shape);
+				if (rasteredPart.isEmpty()) {
+					System.err.println("Bounding polygon doesn't intersect with the bounding box of the input file(s)");
+					return Collections.emptyList();
+				}
+				if (rasteredPart.isSingular()) {
+					prepare(polygonArea);
+					Tile tile = new Tile(extraDensityInfo, rasteredPart.getBounds());
+					Solution solution = findSolutionWithSinglePolygon(0, tile, rasteredPart);
+					if (solution == null && rasteredPart.isRectangular()) 
+						solution = split();
+					if (solution != null) { 
+						areas.addAll(getAreas(solution, polygonArea));
+					}
 				}
 			}
+			return areas;
 		}
 		if (polygonArea.intersects(Utils.area2Rectangle(allDensities.getBounds(), 0)))
 			return splitPolygon(polygonArea);



View it on GitLab: https://salsa.debian.org/debian-gis-team/mkgmap-splitter/-/commit/aa07db1227936b88b90715a4adeb05f03f4fb89c

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/mkgmap-splitter/-/commit/aa07db1227936b88b90715a4adeb05f03f4fb89c
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20220401/4d1e14d3/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list