Opened 10 years ago

Closed 9 years ago

#3144 closed defect (fixed)

Off by one error in ogr2osm

Reported by: ToeBee Owned by: ivan@…
Priority: major Milestone:
Component: ogr2osm Version:
Keywords: Cc: ToeBee, JoshD


There is an off by one error in ogr2osm that causes it to drop the last attribute in a shapefile instead of converting it to a tag. If you try to reference the attribute in your translation file, python errors out with a keyError.

The problem is on line 417. The -1 needs to be dropped from the "for k in range" statement. This matches the statement up on line 399 which is doing something similar.

This is potentially causing information to be discarded during imports.

I was starting to bang my head against the wall trying to figure out why I couldn't import the "Notes" attribute from a shapefile I'm working on. It is the last attribute in this shapefile and eventually I realized that it had to be a problem in ogr2osm. Removing the -1 gave me a notes tag!

Change History (2)

comment:1 Changed 10 years ago by ToeBee

Cc: ToeBee added

comment:2 Changed 9 years ago by JoshD

Cc: JoshD added
Resolution: fixed
Status: newclosed

Should now be fixed in r26557.

Note: See TracTickets for help on using tickets.