logo separator

[mkgmap-dev] class Numbers

From Gerd Petermann gpetermann_muenchen at hotmail.com on Mon Apr 20 20:56:24 BST 2015

Hi Steve,

attached is a patch for trunk that implements the structures. 
(I've omitted display tool for now)

I think they will work with the new data as well.
Maybe you have better names for the classes?

Gerd

From: gpetermann_muenchen at hotmail.com
To: mkgmap-dev at lists.mkgmap.org.uk
Date: Mon, 20 Apr 2015 13:26:33 +0200
Subject: Re: [mkgmap-dev] class Numbers




Hi Steve, 
what about the structures below? 
My intent is not to save space here, but more
to allow loops to iterate like this:
for (int side = 0; side < 2; side++){
  boolean left = (side==0);
  x = blabla.getxyz(left);
...
  blabla.set(left, 4711)
 }

Gerd

RoadDef:
List<AddrRoadInfo> addrList;

class AddrRoadInfo {
  int nodeNumber; // n-th number node in road
  AddrData left,right;

  getAddrData(boolean left){
    return (left)? left:right;
 }
}

class AddrData{
  String zipCode; 
  CityInfo city;
  Numbers numbers; 
}

class Numbers {
  int start,end;
  NumberStyle style;
}
 

> Date: Mon, 20 Apr 2015 11:55:25 +0100
> From: steve at parabola.me.uk
> To: mkgmap-dev at lists.mkgmap.org.uk
> Subject: Re: [mkgmap-dev] class Numbers
> 
> On 20/04/15 10:31, Gerd Petermann wrote:
> > just noticed that img file starts with optional zip code info, followed
> > by optional city info,
> > followed by numbers.
> > So, maybe it is not a good idea to combine them in one class?
> 
> It makes a lot of sense to keep them separate I agree.  A road with
> more than one city does not even need any road numbers, or there may
> be no road numbers at the point where the city changes.
> 
> > Would that make reading difficult?
> It would make reading a little more difficult since you would have to
> merge the two streams, but we don't need to read it for map making
> purposes, only for display.  Writing is already pretty difficult, so
> it wouldn't make much difference there ;)
> 
> So if it saved a lot of space it would be possible, but I'm not sure
> that it would.  Most roads will have one city, so having the two pointers
> for each segment would be wasted space.
> 
> > My current thinking is that we should have the number of RoadNumbers
> > before we start to read them (because we have the number of "Number nodes").
> > So, it should be possible to allocate an array of RoadNumbers instances
> > and fill those whenever we have data for one node.
> 
> I do think that is a upper bound to the number you will need.
> 
> ..Steve
> _______________________________________________
> 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 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20150420/8a7adc63/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: numbers-v0.patch
Type: application/octet-stream
Size: 30420 bytes
Desc: not available
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20150420/8a7adc63/attachment-0001.obj>


More information about the mkgmap-dev mailing list