logo separator

[mkgmap-dev] random housenumbers

From Steve Ratcliffe steve at parabola.me.uk on Thu Jan 8 23:26:04 GMT 2015

Hi Gerd

> I guess we have to
> 1) add a flag to RouteNode which says whether or not the node is used
> for routing. A RouteNode for housenumbers will have arcs
> like a normal one, but they are only used to allow placing the
> housenumber infos.

I don't think the change will involve RouteNode.

Currently we have road lines made up of Coord
and CoordNode.  There should be something between those two.
Lets call it NumberCoord here for want of a better name.

Add a method to Coord that returns false.

class Coord {
   	public boolean isNumberNode() { return false; }
}

// Then NumberCoord extends that and overrides it to return true.
class NumberCoord extends Coord {
	... isNumberNode() { return true; }
}
Then CoordNode extends NumberCoord.

Then in LinePreparer around line 380 where it says:

	* Current thought is that the node indicator is set when
	* the point is a node. There's a separate first extra bit
	* that always appears to be false. The last points' extra bit
	* is set if the point is a node and this is not the last
	* polyline making up the road.
	* Todo: special case the last bit

The comment needs the 'current thought' changing ;)

Then use co.isNumberNode() instead of co.getId()

> 2) change RoadDef.writeNod2()
> to create the bitstream using this flag.
> 3) What happens with the complex
> routing routines in RouteNode, e.g.
> addArcsToMajorRoads() ?

I don't think you would have to change any of that so
long as there are no invalid assumptions in there.

> Do we have to add arcs to the "housenumber nodes" ?

No. Well you could but then they would be routing nodes ;)

> 4) In StyledConverter I see a call
> road.setStartsWithNode(nodeIndices.get(0) == 0);
> which seems to always set the bit to true.
> The code in RoadHelper may be work different.
> Do you have an example that explains this?

I believe that code is intended to deal with the case
where the first node is a dead end.

> Attached patch shows how I intend to implement the random
> housenumbers, it doesn't do anything useful yet.
> Maybe you can tell me if I am on the right way?

I think that is probably not the place to start as explained above.
Sorry I may have been misleading as there are so many things called
Node.  We need some new terms!

The NetCheck program was written after this was understood so
it will correctly display housenumbers in this case. The output
is a bit verbose, just look for the Number lines.

..Steve


More information about the mkgmap-dev mailing list