[OSM-dev] extract_polygon_0.5.pl bugs

James Marca jmarca at translab.its.uci.edu
Fri Sep 28 05:24:44 BST 2007


On Fri, Sep 28, 2007 at 11:22:54AM +1000, Brett Henderson wrote:
> James Marca wrote:
> > My solution is if the ids are negative, add the (negative) nodeid,
> > wayid, and relid to the maxnodes, maxways and maxrelations variables
> > (so that they aren't greater than the max size, and so that there can
> > also be positive ids).  I'll try to extract a patch, but the approach
> > presumes that ids are numbered sequentially, etc. so it isn't foolproof.
> >   
> I might be missing something but wouldn't it be simpler to put the 
> negative identifiers in a separate Bit::Vector.  Osmosis has the same 
> negative id problem (which I didn't realise was a problem until your 
> email) and that's how I think I'll fix it.

Could work fine, as long as you make sure the indexes (indices) are
positive.  They aren't ids so much as real, unsigned integer indexes
into the vector.  If you do a perldoc Bit::Vector and look for
"negative" you'll see the full explanation.

I did my counting backwards hack mostly to avoid allocating another
250MB of RAM with another set of Bit::Vector objects, *and* to allow
positive and negative integers.  

Still haven't gotten to cleaning up the patch to a bare minimum.
Hopefully I'll get to it tonight.

James




More information about the dev mailing list