logo separator

[mkgmap-dev] [Patch] Improve MapMaker.roadsAreJoined()

From GerdP gpetermann_muenchen at hotmail.com on Sat Mar 3 05:56:41 GMT 2012

Hi,

roadsAreJoined() tests all points of one MapLine against all points of
another MapLine instance.
It should first check the previously calculated bounding boxes to eliminate
many unsuccesfull loops.


Gerd

Index: src/uk/me/parabola/mkgmap/main/MapMaker.java
===================================================================
--- src/uk/me/parabola/mkgmap/main/MapMaker.java	(revision 2232)
+++ src/uk/me/parabola/mkgmap/main/MapMaker.java	(working copy)
@@ -196,6 +196,8 @@
 	private boolean roadsAreJoined(MapLine r1, MapLine r2) {
 
 		if(r1 != r2) {
+			if (r1.getBounds().intersects(r2.getBounds()) == false)
+				return false;
 			for(Coord c1 : r1.getPoints()) {
 				for(Coord c2 : r2.getPoints()) {
 					if(c1 == c2 || c1.equals(c2)) 

--
View this message in context: http://gis.19327.n5.nabble.com/Patch-Improve-MapMaker-roadsAreJoined-tp5533142p5533142.html
Sent from the Mkgmap Development mailing list archive at Nabble.com.



More information about the mkgmap-dev mailing list