logo separator

[mkgmap-dev] Curvy routing support: new function?

From WanMil wmgcnfg at web.de on Thu Jul 31 19:29:06 BST 2014

Hi Manfred,

I do not have time to have a look on it within the next weeks. So please 
help yourself or wait... Sorry :-)

WanMil

> Hi WanMil,
>
> unfortunately the curviness() function does not work as expected yet. I can try to help to analyse it, may I have a look at the source code anywhere? The function alone would be enough
>
> Thanks and cheers
> Manfred
>
>
> PS: please find detailed analysis in my mail from July 3
>
>
>> Gesendet: Donnerstag, 03. Juli 2014 um 20:49 Uhr
>> Von: WanMil <wmgcnfg at web.de>
>> An: "Development list for mkgmap" <mkgmap-dev at lists.mkgmap.org.uk>
>> Betreff: Re: [mkgmap-dev] Curvy routing support: new function?
>>
>> I forgot to clean before build...
>> Here is the new version: http://files.mkgmap.org.uk/detail/216
>>
>>> Hi WanMil,
>>>
>>> you are very fast, thank you very much for this!
>>> However I'm facing some expectations, log:
>>> java.lang.NoSuchMethodError: uk.me.parabola.mkgmap.reader.osm.Way.deleteTag(Ljav
>>> a/lang/String;)V
>>>           at uk.me.parabola.mkgmap.reader.osm.MultiPolygonFinishHook.end(MultiPoly
>>> gonFinishHook.java:50)
>>>           at uk.me.parabola.mkgmap.reader.osm.OsmReadingHooksChain.end(OsmReadingH
>>> ooksChain.java:79)
>>>           at uk.me.parabola.mkgmap.reader.osm.o5m.O5mBinMapDataSource.load(O5mBinM
>>> apDataSource.java:49)
>>>           at uk.me.parabola.mkgmap.reader.osm.OsmMapDataSource.load(OsmMapDataSour
>>> ce.java:127)
>>>           at uk.me.parabola.mkgmap.main.MapMaker.loadFromFile(MapMaker.java:167)
>>>           at uk.me.parabola.mkgmap.main.MapMaker.makeMap(MapMaker.java:63)
>>>           at uk.me.parabola.mkgmap.main.Main$1.call(Main.java:253)
>>>           at uk.me.parabola.mkgmap.main.Main$1.call(Main.java:249)
>>>           at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
>>>           at java.util.concurrent.FutureTask.run(Unknown Source)
>>>           at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
>>>           at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>>>           at java.lang.Thread.run(Unknown Source)
>>>
>>> (I have installed r3310 which works ok, and then replaced mkgmap.jar by your build)
>>>
>>> I'm open to any suggestions for other logic. A curviness function can only be a virtual value, not physical. However it may probably sufficient to say, curviness=length()/distance(first_point, last_point)? May be I'm thinking too complex :-)
>>>
>>> Cheers
>>> Manfred
>>>
>>>
>>>
>>>> Gesendet: Dienstag, 01. Juli 2014 um 22:32 Uhr
>>>> Von: WanMil <wmgcnfg at web.de>
>>>> An: "Development list for mkgmap" <mkgmap-dev at lists.mkgmap.org.uk>
>>>> Betreff: Re: [mkgmap-dev] Curvy routing support: new function?
>>>>
>>>> Hi,
>>>>
>>>> I remember that it is on my Todo-List :-)
>>>>
>>>> So I performed a quick implementation following your suggestion. You can
>>>> find in the attached patch so that you can play a little bit with it.
>>>> (Attention: it is completely untested!!)
>>>> You can find a patched mkgmap.jar at http://files.mkgmap.org.uk/detail/215.
>>>>
>>>> I think curviness should to be defined in a different way.
>>>> 1. Calculate the distance of each point Dmiddle to the virtual line from
>>>> first to the last point.
>>>> 2. curviness()=standard mean(Dmiddle/(length to next point + length to
>>>> previous point)
>>>>
>>>> I think this gives a better indication how curviness a road is. But it
>>>> need to be implemented and tested later on :-)
>>>>
>>>> WanMil
>>>>
>>>>> Hi all,
>>>>>
>>>>> Garmin offers "curvy roads" preferences for their zümo 390 and 590 devices.
>>>>> https://buy.garmin.com/en-US/US/on-the-road/motorcycles/zumo-390lm/prod138275.html
>>>>> I'm thinking about creating motorcycle maps for old 200 series.
>>>>> Might it be useful to integrate a curviness() function so that mkgmap can optimize for curvy roads too? It might also help do determine a better default speed for curvy roads for use with car routing.
>>>>>
>>>>> The curviness() value might be the overall absolute turning angle (in degrees) of a road segment divided by the segment's length.
>>>>>
>>>>> What's your opinion?
>>>>>
>>>>> Cheers
>>>>> Manfred
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Pseudo code might look like this:
>>>>>
>>>>> function curviness()
>>>>> {
>>>>> oldpoint=points(0)
>>>>> foreach (point of a way segment as newpoint)
>>>>>      {
>>>>>      d_x=(newpoint.x-oldpoint.x)/360*40000000*COS(newpoint.x*PI()/180) //in meters
>>>>>      d_y=(newpoint.y-oldpoint.y)/360*40000000 //in meters
>>>>>      length+=sqrt(d_x**2+d_y**2)
>>>>>      angle=arctan(d_y/d_x)
>>>>>      d_angle=abs(angle-old_angle)
>>>>>      sgn_x=sgn(d_x)
>>>>>      sgn_y=sgn(d_y)
>>>>>      if ((sgn_x*sgn_y*old_sgn_x*old_sgn_y)=-1 && (sgn_x!=old_sgn_x))  d_angle=pi-d_angle  // 180 degrees correction, otherwise north-south roads show strange results
>>>>>      if (point>1) sum_angle+=d_angle
>>>>>      old_angle=angle
>>>>>      oldpoint=newpoint
>>>>>      old_sgn_x=sgn_x
>>>>>      old_sgn_y=sgn_y
>>>>>      }
>>>>> return sum_angle/length
>>>>> }
>>>>>
>>>>> // perhaps simple multiplication is faster than 4 times sgn() functions?
>>>>> _______________________________________________
>>>>> mkgmap-dev mailing list
>>>>> mkgmap-dev at lists.mkgmap.org.uk
>>>>> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
>>>>>
>>>>
>>>> _______________________________________________
>>>> mkgmap-dev mailing list
>>>> mkgmap-dev at lists.mkgmap.org.uk
>>>> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
>>> _______________________________________________
>>> mkgmap-dev mailing list
>>> mkgmap-dev at lists.mkgmap.org.uk
>>> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
>>>
>>
>> _______________________________________________
>> mkgmap-dev mailing list
>> mkgmap-dev at lists.mkgmap.org.uk
>> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev at lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
>



More information about the mkgmap-dev mailing list