<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi WanMil,<br><br><br><div>> > @WanMil:<br>> > Special case: Code in StyledConverter near roadLog.isInfoEnabled()<br>> > formats the content of the TabAAcesss field in RoadDef which<br>> > contains the img format. I think this is okay because the intention<br>> > of the log is to show exactly the content of this field.<br>> <br>> From my point of view it doesn't matter to have the exact bit coding <br>> here. The intention of the output was to get an information about the <br>> access restrictions. For ease of use I decided to use the bit <br>> representation of the map but if another output is easier to code or to <br>> read please feel free to change.<br>Okay. Maybe I'll change that part again as the TabAAcesss field is<br>also not directly written to the img file.<br><br>> <br>> ><br>> > 2) Create class ConvertedWay which combines an<br>> > OSM Way instance with a reference to a GType instance.<br>> > Instead of copying and modifying fields (roadClass, roadSpeed)<br>> > in GType instances this is now done in ConvertedWay.<br>> > Many tags which are relevant for routing are evaluated once<br>> > when the ConvertedWay instance is created.<br>> > The results are kept in bit masks, this allows a quick<br>> > compare.<br>> > Also, RoadMerger uses this class instead of creating new<br>> > Road instances.<br>> <br>> Ok.<br>> One question regarding line 550:<br>> if (road1.getRouteFlags() != road2.getRouteFlags())<br>> If the route flags are different are the ways always not mergable?<br>> In such a case the code lines after are important for debugging only. <br>> Some CPU cycles can be saved by adding if (logger.isDebugEnabled()).<br>> I also suggest to move the low cost checks to the beginning of <br>> isWayMergable(). Before refactoring all checks were working on tags and <br>> therefore had the same cost.<br><br>yes, roads with different routeFlags should not be merged.<br>You are right, the code should only be executed if logging is needed. <br><br>> <br>> ><br>> > @WanMil: The new code produces a different log on debug<br>> > level because some comparisons are done in different order.<br>> > I've changed the code to compare the bit mask fields instead of the<br>> > tags, but the code still lists (most of) the compared tags<br>> > to be able to produce debug info.<br>> > Let me know if that is okay for you. Another solution could be to<br>> > implement the debugging in ConvertedWay e.g. something<br>> > like<br>> > public String compareAccess(ConvertedWay other)<br>> > could return a String like<br>> > "mkgmap:truck is different 'no' <> 'null' "<br>> <br>> I don't mind about the output as long as it contains the required <br>> information in a readable format :-)<br>Okay. I'll see how complicated this method is. It could<br>also replace the loops for the comparison of the routeFlags.<br>> <br>> ><br>> > 3)<br>> > With r3214 I've renamed a few methods. Please check if<br>> > you find better names:<br>> > http://www.mkgmap.org.uk/websvn/revision.php?repname=mkgmap&rev=3214<br>> <br>> some ideas:<br>> Element.getEntrySetIterator() => Element.getTagIterator()<br><br>I used this first, but then I decided that tag usally means<br>the pair key=value as a single String. <br>The Tags class implements that as iterator().<br>Element.getEntrySetIterator() calls Tags.entryIterator()<br>so maybe it should better be changed to <br>Element.getEntryIterator() <br><br>> <br>> <br>> <br>> Some other comments:<br>> <br>> RestrictionRelation.setExceptMask should be updated to the new access <br>> rules. But maybe this change should be applied not in the refactoring <br>> branch without any change in the output.<br>> Example:<br>> delivery is not an access tag and should be removed<br>> psv should set bus and taxi (if they are not set too)<br>> motorcycle should be ignored<br>> vehicle should be considered.<br><br>Yes, I also don't like that part of the code.<br>I'd prefer to have a rules file for it, but<br>I found no simple way to code this.<br>I'll change that after merging to trunk,<br>the refactoring should not change functionality.<br><br><br><br>> ...<br>> <br>> HighwayHooks.usedTags should not be static.<br>> It should be possible to compile one tile with make-opposite-cycleways <br>> and another without. So the usedTags field should be different.<br><br>Good catch. I've corrected that with r3218.<br><br>Gerd<br></div>                                            </div></body>
</html>