[OSM-dev] ogr2osm.py error message

Samat K Jain lists at samat.org
Sat Mar 12 02:48:33 GMT 2011


> here is what's around line 594 in the script:
> 
> print
> 
> print "Simplifying line segments"
> 
> for line in lineSegments.values():
> 
>     #print line
> 
>     for segmentID in line:    # No need to check the last segment, it could
> not be simplyfied
> 
>         #print segmentID
> 
>         #print segmentNodes[segmentID]
> 
>         for nodeID in segmentNodes[segmentID]:
> 
>             simplifyNode(nodeID)
> 
>             #simplifyNode(segmentNodes[segmentID][0])    # last node in
> segment
> 
> 
> Thanks for any help!

I've seen this a couple times before too. I haven't cared enough to investigate what's exactly going on…

But to make the error go away, change that 'for' statement on line 594 to:

  for nodeID in segmentNodes.get(segmentID, []):

The side effects depend on your data. Make sure to check for problems.

-- 
Samat K Jain <http://samat.org/> | GPG: 0x4A456FBA

Adults are just obsolete children, and too hell with them.
-- Theodor Seuss Geisel (Dr. Seuss) (362)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20110311/0bd9dbee/attachment-0001.pgp>


More information about the dev mailing list