Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

Off by one error in ogr2osm #3144

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 1 comment
Closed

Off by one error in ogr2osm #3144

openstreetmap-trac opened this issue Jul 23, 2021 · 1 comment

Comments

@openstreetmap-trac
Copy link

Reporter: ToeBee
[Submitted to the original trac issue database at 7.26pm, Monday, 26th July 2010]

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!

@openstreetmap-trac
Copy link
Author

Author: JoshD
[Added to the original trac issue at 7.59pm, Monday, 22nd August 2011]

Should now be fixed in r26557.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant