Bas Couwenberg pushed to branch master 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
- - - - -
c391a1ec by Bas Couwenberg at 2022-04-01T09:42:39+02:00
Update upstream source from tag 'upstream/0.0.0+svn650'

Update to upstream version '0.0.0+svn650'
with Debian dir 410378989e32e1bc9f9d58c87b4840bca74d766c
- - - - -
ccc2621f by Bas Couwenberg at 2022-04-01T09:42:56+02:00
New upstream SVN snapshot.

- - - - -
922f1d7a by Bas Couwenberg at 2022-04-01T09:43:35+02:00
Set distribution to unstable.

- - - - -


4 changed files:

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


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+mkgmap-splitter (0.0.0+svn650-1) unstable; urgency=medium
+
+  * New upstream SVN snapshot.
+
+ -- Bas Couwenberg <[email protected]>  Fri, 01 Apr 2022 09:43:26 +0200
+
 mkgmap-splitter (0.0.0+svn647-1) unstable; urgency=medium
 
   * New upstream SVN snapshot.


=====================================
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/-/compare/f7b0abec2a40003e2ba66cfd2f9fc6cf5450514b...922f1d7aba64baf0e012811e2387076de43b3d29

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


_______________________________________________
Pkg-grass-devel mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-grass-devel

Reply via email to