[mkgmap-dev] Strange roundabout flare road warning

2010-02-23 Thread Marko Mäkelä
Hi Mark,

I tried to fix this by adding oneway=yes to the flare roads, but it did  
not fix the issue. Other warnings that I fixed yesterday are gone, so  
my dump should be fine.

2010/02/23 09:51:40 WARNING (RouteNode): 63240004.osm.gz: Outgoing  
roundabout flare road  
(http://www.openstreetmap.org/browse/way/50982726) points in wrong  
direction?  
http://www.openstreetmap.org/?mlat=67.78665&mlon=24.81923&zoom=17

Any ideas what might be wrong?

Marko
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] Strange roundabout flare road warning

2010-02-23 Thread Mark Burton

Hello Marko,

> I tried to fix this by adding oneway=yes to the flare roads, but it did  
> not fix the issue. Other warnings that I fixed yesterday are gone, so  
> my dump should be fine.
> 
> 2010/02/23 09:51:40 WARNING (RouteNode): 63240004.osm.gz: Outgoing  
> roundabout flare road  
> (http://www.openstreetmap.org/browse/way/50982726) points in wrong  
> direction?  
> http://www.openstreetmap.org/?mlat=67.78665&mlon=24.81923&zoom=17
> 
> Any ideas what might be wrong?

Yes, it's a bug in the flare check code. I have seen the same problem
in a few places in the UK map. I shall look into it.

Mark
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] Strange roundabout flare road warning

2010-02-23 Thread Marko Mäkelä
Hello Mark,

>> 2010/02/23 09:51:40 WARNING (RouteNode): 63240004.osm.gz: Outgoing   
>> roundabout flare road   
>> (http://www.openstreetmap.org/browse/way/50982726) points in wrong   
>> direction?   
>> http://www.openstreetmap.org/?mlat=67.78665&mlon=24.81923&zoom=17
>> Any ideas what might be wrong?

> Yes, it's a bug in the flare check code. I have seen the same problem  
> in a few places in the UK map. I shall look into it.

Thank you, I am looking forward to that.

Marko
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


[mkgmap-dev] [PATCH v1] flare road checking bug fixes

2010-02-23 Thread Mark Burton

The good news is that this should now no longer falsely complain about
a flare road being the wrong direction when that flare road pair are
the only roads connected to a given roundabout.

The bad news is that it will now find more bad flare roads than it did
before - and you thought you had fixed them all!


diff --git a/src/uk/me/parabola/imgfmt/app/net/RouteNode.java b/src/uk/me/parabola/imgfmt/app/net/RouteNode.java
index c01f7a9..f33496b 100644
--- a/src/uk/me/parabola/imgfmt/app/net/RouteNode.java
+++ b/src/uk/me/parabola/imgfmt/app/net/RouteNode.java
@@ -602,6 +602,31 @@ public class RouteNode implements Comparable {
 		}
 	}
 
+	// determine "distance" between two nodes on a roundabout
+	private int roundaboutSegmentLength(final RouteNode n1, final RouteNode n2) {
+		List seen = new ArrayList();
+		int len = 0;
+		RouteNode n = n1;
+		for(;;) {
+			seen.add(n);
+			for(RouteArc a : n.arcs) {
+if(a.isForward() &&
+   a.getRoadDef().isRoundabout() &&
+   !a.getRoadDef().isSynthesised()) {
+	len += a.getLength();
+	n = a.getDest();
+	if(n == n2)
+		return len;
+	break;
+}
+			}
+			if(seen.contains(n)) {
+// looped around without finding n2 - weird
+return Integer.MAX_VALUE;
+			}
+		}
+	}
+
 	// sanity check roundabout flare roads - the flare roads connect a
 	// two-way road to a roundabout using short one-way segments so
 	// the resulting sub-junction looks like a triangle with two
@@ -614,12 +639,54 @@ public class RouteNode implements Comparable {
 			// roundabout
 			if(!r.isForward() || !r.getRoadDef().isRoundabout() || r.getRoadDef().isSynthesised())
 continue;
-			// now try and find the two arcs that make up the
-			// triangular "flare" connected to both ends of r
+			// follow the arc to find the first node that connects the
+			// roundabout to a non-roundabout segment
 			RouteNode nb = r.getDest();
+			for(;;) {
+boolean connectsToNonRoundaboutSegment = false;
+RouteArc nextRoundaboutArc = null;
+for(RouteArc nba : nb.arcs) {
+	if(!nba.getRoadDef().isSynthesised()) {
+		if(nba.getRoadDef().isRoundabout()) {
+			if(nba.isForward())
+nextRoundaboutArc = nba;
+		}
+		else
+			connectsToNonRoundaboutSegment = true;
+	}
+}
+
+if(nb == this) {
+	// looped back to start - give up
+	if(!connectsToNonRoundaboutSegment) {
+		// FIXME - stop this warning griping about
+		// roundabouts whose ways are tagged
+		// highway=construction
+
+		// log.warn("Roundabout " + r.getRoadDef() + " is not connected to any ways at " + coord.toOSMURL());
+	}
+	nb = null;
+	break;
+}
+
+if(connectsToNonRoundaboutSegment || nextRoundaboutArc == null)
+	break;
+
+nb = nextRoundaboutArc.getDest();
+			}
+
+			if(nb == null) {
+// something weird about this roundabout, forget it
+continue;
+			}
+
+			// now try and find the two arcs that make up the
+			// triangular "flare" connected to both ends of the
+			// roundabout segment
 			for(RouteArc fa : arcs) {
 if(!fa.getRoadDef().doFlareCheck())
 	continue;
+
 for(RouteArc fb : nb.arcs) {
 	if(!fb.getRoadDef().doFlareCheck())
 		continue;
@@ -627,32 +694,24 @@ public class RouteNode implements Comparable {
 		// found the 3rd point of the triangle that
 		// should be connecting the two flare roads
 
-		// first, special test for roundabouts that
-		// have a single flare and no other
-		// connections - only check the flare for the
-		// shorter of the two roundabout segments
-
-		boolean isShortest = true;
-		for(RouteArc rb : nb.arcs) {
-			if(rb.getDest() == this &&
-			   rb.isForward() &&
-			   rb.getRoadDef().isRoundabout()) {
-isShortest = r.getLength() < rb.getLength();
-break;
-			}
-		}
+		// first, special test required to cope with
+		// roundabouts that have a single flare and no
+		// other connections - only check the flare
+		// for the shorter of the two roundabout
+		// segments
 
-		if(!isShortest)
+		if(roundaboutSegmentLength(this, nb) >=
+		   roundaboutSegmentLength(nb, this))
 			continue;
 
 		if(maxFlareLengthRatio > 0) {
 			// if both of the flare roads are much
-			// longer than the length of r, they are
-			// probably not flare roads at all but
-			// just two roads that meet up - so ignore
-			// them
-			final int maxFlareLength = r.getLength() * maxFlareLengthRatio;
-			if(r.getLength() > 0 &&
+			// longer than the length of the
+			// roundabout segment, they are probably
+			// not flare roads at all but just two
+			// roads that meet up - so ignore them
+			final int maxFlareLength = roundaboutSegmentLength(this, nb) * maxFlareLengthRatio;
+			if(maxFlareLength > 0 &&
 			   fa.getLength() > maxFlareLength &&
 			   fb.getLength() > maxFlareLength) {
 continue;

[mkgmap-dev] Bug report --remove-short-arcs=5 ???

2010-02-23 Thread Garvan & maew
Hi,

mkgmap is dropping international boundaries from a maps (OSM file format but
not a download from OMS) without issuing any error message or warning. I
checked the image files in mapsource as well as with gpsmapedit, and the
national boundaries are not included in the img file.

I created a test file to demonstrate the issue with only three line types,
national boundaries, provincial boundaries and minor contours, and have 
uploaded it here. Size = 98.1 MB.
http://dl.dropbox.com/u/4900023/cambodia.osm

Things I have tried:
a) I compiled the original source file in mp format and it works correctly.
b) I reduced the OSM file to the smallest size that demonstrated the 
error by deleting contour lines.
If I delete one more contour line from the end of the file the error 
goes away and international boundaries
are displayed.
c) I loaded the file in JOSM and checked it. The international 
boundaries displayed correctly. I saved
the file to a new file name, and although the elements were rearranged 
and the file size increased,
the international boundaries were still dropped when I compiled the file.
d) I compiled with no options set, and checked the img with gpsmapedit, 
and it WORKED correctly. The
boundaries displayed in the img file.
e) After further experimentation I found that removing 
--remove-short-arcs=5 from the command line cause
the international boundaries to display correctly.

Command line
java -ea -Xmx2000m -jar ./mkgmap-1581/mkgmap.jar --remove-short-arcs=5 
cambodia.osm

Does not work.

Thanks for any help

Garvan

___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] Bug report --remove-short-arcs=5 ???

2010-02-23 Thread Mark Burton

Hello Garvan,

> http://dl.dropbox.com/u/4900023/cambodia.osm
> 

If you zip up that file to save my bandwidth, I will take a look at it.

Mark
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] Bug report --remove-short-arcs=5 ???

2010-02-23 Thread Garvan & maew
Mark Burton wrote:
> Hello Garvan,
>
>   
>> http://dl.dropbox.com/u/4900023/cambodia.osm
>>
>> 
>
> If you zip up that file to save my bandwidth, I will take a look at it.
>
> Mark
>   

Sorry, wasn't thinking.

http://dl.dropbox.com/u/4900023/cambodia.osm.zip

Garvan

___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] Bug report --remove-short-arcs=5 ???

2010-02-23 Thread Mark Burton

Well, I looked at it but learnt nothing. I just get an empty map, no
lines, no diagnostics, nothing at all.

Mark
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] Bug report --remove-short-arcs=5 ???

2010-02-23 Thread Garvan & maew
Mark Burton wrote:
> Well, I looked at it but learnt nothing. I just get an empty map, no
> lines, no diagnostics, nothing at all.
>
> Mark

If you zoom in I think the contours and provincial boundaries will show 
up, but at full zoom nothing shows because the national boundaries are 
missing. I am not sure exactly when they should show in mapsource, but 
gpsmapedit tells me they are not in the img file at all.

Garvan

___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] Bug report --remove-short-arcs=5 ???

2010-02-23 Thread Mark Burton

> If you zoom in I think the contours and provincial boundaries will show 
> up, but at full zoom nothing shows because the national boundaries are 
> missing. I am not sure exactly when they should show in mapsource, but 
> gpsmapedit tells me they are not in the img file at all.

OK, I think what's happening here is that the file contains a lot of
points that are so close together that the remove-short-arc process
just throws them away and then throws the ways away because they
contain less than 2 points. If you look at the diagnostics you get lots
of lines like:

2010/02/23 14:49:04 INFO (Osm5XmlHandler): cambodia.osm:   Way 200 
(http://www.openstreetmap.org/browse/way/-2475) has consecutive nodes with the 
same coordinates 
(http://www.openstreetmap.org/?mlat=11.78333&mlon=103.63197&zoom=17) - merging 
node -187534 into -187526
2010/02/23 14:49:04 INFO (Osm5XmlHandler): cambodia.osm:   Way 200 
(http://www.openstreetmap.org/browse/way/-2478) has consecutive nodes with the 
same coordinates 
(http://www.openstreetmap.org/?mlat=11.78236&mlon=103.65167&zoom=17) - merging 
node -187581 into -187573
2010/02/23 14:49:04 INFO (Osm5XmlHandler): cambodia.osm:   Way 700 
(http://www.openstreetmap.org/browse/way/-2477) has consecutive nodes with the 
same coordinates 
(http://www.openstreetmap.org/?mlat=11.78327&mlon=103.34835&zoom=17) - merging 
node -187572 into -187564

and then later you get:

2010/02/23 14:49:09 INFO (Osm5XmlHandler): cambodia.osm:   Way 100 
(http://www.openstreetmap.org/browse/way/-11092) has less than 2 points - 
deleting it
2010/02/23 14:49:09 INFO (Osm5XmlHandler): cambodia.osm:   Way 200 
(http://www.openstreetmap.org/browse/way/-11091) has less than 2 points - 
deleting it
2010/02/23 14:49:09 INFO (Osm5XmlHandler): cambodia.osm:   Way 100 
(http://www.openstreetmap.org/browse/way/-11094) has less than 2 points - 
deleting it

Can you reduce the number of points in the ways?

Mark
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] Bug report --remove-short-arcs=5 ???

2010-02-23 Thread Garvan & maew
Mark Burton wrote:
>> If you zoom in I think the contours and provincial boundaries will show 
>> up, but at full zoom nothing shows because the national boundaries are 
>> missing. I am not sure exactly when they should show in mapsource, but 
>> gpsmapedit tells me they are not in the img file at all.
>> 
>
> OK, I think what's happening here is that the file contains a lot of
> points that are so close together that the remove-short-arc process
> just throws them away and then throws the ways away because they
> contain less than 2 points. If you look at the diagnostics you get lots
> of lines like:
>
> 2010/02/23 14:49:04 INFO (Osm5XmlHandler): cambodia.osm:   Way 200 
> (http://www.openstreetmap.org/browse/way/-2475) has consecutive nodes with 
> the same coordinates 
> (http://www.openstreetmap.org/?mlat=11.78333&mlon=103.63197&zoom=17) - 
> merging node -187534 into -187526
> 2010/02/23 14:49:04 INFO (Osm5XmlHandler): cambodia.osm:   Way 200 
> (http://www.openstreetmap.org/browse/way/-2478) has consecutive nodes with 
> the same coordinates 
> (http://www.openstreetmap.org/?mlat=11.78236&mlon=103.65167&zoom=17) - 
> merging node -187581 into -187573
> 2010/02/23 14:49:04 INFO (Osm5XmlHandler): cambodia.osm:   Way 700 
> (http://www.openstreetmap.org/browse/way/-2477) has consecutive nodes with 
> the same coordinates 
> (http://www.openstreetmap.org/?mlat=11.78327&mlon=103.34835&zoom=17) - 
> merging node -187572 into -187564
>
> and then later you get:
>
> 2010/02/23 14:49:09 INFO (Osm5XmlHandler): cambodia.osm:   Way 100 
> (http://www.openstreetmap.org/browse/way/-11092) has less than 2 points - 
> deleting it
> 2010/02/23 14:49:09 INFO (Osm5XmlHandler): cambodia.osm:   Way 200 
> (http://www.openstreetmap.org/browse/way/-11091) has less than 2 points - 
> deleting it
> 2010/02/23 14:49:09 INFO (Osm5XmlHandler): cambodia.osm:   Way 100 
> (http://www.openstreetmap.org/browse/way/-11094) has less than 2 points - 
> deleting it
>
> Can you reduce the number of points in the ways?
>
> Mark
>
>   

Reducing the number of points sounds like a good idea and I have read of 
tools that do this. The import is from shapefiles originally, so I think 
I can manage this.

But why do the national boundaries display correctly when I delete the 
contour lines? Something is wrong. The line that is being dropped is a 
single line with 22,668 points.

Garvan

___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] Bug report --remove-short-arcs=5 ???

2010-02-23 Thread Garvan & maew
Garvan & maew wrote:
> Mark Burton wrote:
>   
>>> If you zoom in I think the contours and provincial boundaries will show 
>>> up, but at full zoom nothing shows because the national boundaries are 
>>> missing. I am not sure exactly when they should show in mapsource, but 
>>> gpsmapedit tells me they are not in the img file at all.
>>> 
>>>   
>> OK, I think what's happening here is that the file contains a lot of
>> points that are so close together that the remove-short-arc process
>> just throws them away and then throws the ways away because they
>> contain less than 2 points. If you look at the diagnostics you get lots
>> of lines like:
>>
>> 2010/02/23 14:49:04 INFO (Osm5XmlHandler): cambodia.osm:   Way 200 
>> (http://www.openstreetmap.org/browse/way/-2475) has consecutive nodes with 
>> the same coordinates 
>> (http://www.openstreetmap.org/?mlat=11.78333&mlon=103.63197&zoom=17) - 
>> merging node -187534 into -187526
>> 2010/02/23 14:49:04 INFO (Osm5XmlHandler): cambodia.osm:   Way 200 
>> (http://www.openstreetmap.org/browse/way/-2478) has consecutive nodes with 
>> the same coordinates 
>> (http://www.openstreetmap.org/?mlat=11.78236&mlon=103.65167&zoom=17) - 
>> merging node -187581 into -187573
>> 2010/02/23 14:49:04 INFO (Osm5XmlHandler): cambodia.osm:   Way 700 
>> (http://www.openstreetmap.org/browse/way/-2477) has consecutive nodes with 
>> the same coordinates 
>> (http://www.openstreetmap.org/?mlat=11.78327&mlon=103.34835&zoom=17) - 
>> merging node -187572 into -187564
>>
>> and then later you get:
>>
>> 2010/02/23 14:49:09 INFO (Osm5XmlHandler): cambodia.osm:   Way 100 
>> (http://www.openstreetmap.org/browse/way/-11092) has less than 2 points - 
>> deleting it
>> 2010/02/23 14:49:09 INFO (Osm5XmlHandler): cambodia.osm:   Way 200 
>> (http://www.openstreetmap.org/browse/way/-11091) has less than 2 points - 
>> deleting it
>> 2010/02/23 14:49:09 INFO (Osm5XmlHandler): cambodia.osm:   Way 100 
>> (http://www.openstreetmap.org/browse/way/-11094) has less than 2 points - 
>> deleting it
>>
>> Can you reduce the number of points in the ways?
>>
>> Mark
>>
>>   
>> 
>
> Reducing the number of points sounds like a good idea and I have read of 
> tools that do this. The import is from shapefiles originally, so I think 
> I can manage this.
>
> But why do the national boundaries display correctly when I delete the 
> contour lines? Something is wrong. The line that is being dropped is a 
> single line with 22,668 points.
>
> Garvan
>   
PS. Thanks for your help.
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


[mkgmap-dev] Use custom icons instead of default Garmin icons for POIs

2010-02-23 Thread Daniela Duerbeck
Hi!

When I add icons in my TYP-files just these show up on the map that are 
not predefined by Garmin.
What must be added in the style to "overwrite" the default icons.

Thanks a lot in advance,
Dani
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] [PATCH v1] flare road checking bug fixes

2010-02-23 Thread Marko Mäkelä
Hi Mark,

Thanks for the patch. I first did patch -p0 instead of patch -p1 and  
the version of patch in Debian Squeeze (testing) surprised me by saying  
that every hunk failed, and creating an empty b/src/... directory with  
.orig and .rej files.

> The good news is that this should now no longer falsely complain  
> about a flare road being the wrong direction when that flare road  
> pair are the only roads connected to a given roundabout.
Right, with the same map data, I get no warning for that roundabout.

> The bad news is that it will now find more bad flare roads than it  
> did before - and you thought you had fixed them all!

The good news for me is that I only saw 3 new warnings for Finland. :-)  
All were legitimate, and I fixed them already.

In other words, please commit the patch.

Marko
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] [PATCH v1] flare road checking bug fixes

2010-02-23 Thread Mark Burton

Marko,

Thanks for the report.

> In other words, please commit the patch.

Good, I will do that.

Mark
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] Use custom icons instead of default Garmin icons for POIs

2010-02-23 Thread Daniela Duerbeck
Solved. :-)

It was a bug in the style file (double lines with different type numbers).

Dani
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


[mkgmap-dev] Commit: r1584: Fixes to the flare road checking.

2010-02-23 Thread svn commit

Version 1584 was commited by markb on 2010-02-23 22:26:43 + (Tue, 23 Feb 
2010) 

Fixes to the flare road checking.

Previously, it would only check flare roads that were connected by a single
roundabout arc so it would fail to check those flares whose ends straddled
a join in the roundabout.

Also, should no longer give a false "flare road direction is wrong" warning
when the roundabout connects only to a single flare and no other roads.

Still needs more work to cope with the (unusual) situation where a way
joins the roundabout between a pair of flair roads. At the moment, those
flares won't get checked.
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev