Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poi geometry of type MultiPoint breaks ogr2osm #207

Open
danielfdsilva opened this issue Oct 26, 2017 · 2 comments
Open

Poi geometry of type MultiPoint breaks ogr2osm #207

danielfdsilva opened this issue Oct 26, 2017 · 2 comments

Comments

@danielfdsilva
Copy link
Collaborator

ogr2osm.py is not able to handle geometries of type MultiPoint, crashing with an error.

[11:55:53.660 +0.983] [p5 s6 proj-setup] error Error: Traceback (most recent call last):
  File "/guts/projects/rra/app/lib/ogr2osm/ogr2osm.py", line 750, in <module>
    parseData(data)
  File "/guts/projects/rra/app/lib/ogr2osm/ogr2osm.py", line 346, in parseData
    parseLayer(translations.filterLayer(layer))
  File "/guts/projects/rra/app/lib/ogr2osm/ogr2osm.py", line 410, in parseLayer
    parseFeature(translations.filterFeature(ogrfeature, fieldNames, reproject), fieldNames, reproject)
  File "/guts/projects/rra/app/lib/ogr2osm/ogr2osm.py", line 420, in parseFeature
    geometries = parseGeometry([ogrgeometry])
  File "/guts/projects/rra/app/lib/ogr2osm/ogr2osm.py", line 458, in parseGeometry
    returngeometries.extend(parseCollection(ogrgeometry))
  File "/guts/projects/rra/app/lib/ogr2osm/ogr2osm.py", line 545, in parseCollection
    member.addparent(geometry)
AttributeError: 'list' object has no attribute 'addparent'

    at ChildProcess.<anonymous> (/guts/projects/rra/app/services/rra-osm-p2p.js:156:23)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:920:16)
    at Socket.<anonymous> (internal/child_process.js:351:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:497:12)

This should be validated when the file us uploaded throwing an error, or doing an automatic conversion.

@olafveerman
Copy link
Contributor

In the short term, I think we can go with validation on file upload and reject the file, or ignore the Multipoints.

Longer run we can make it more elegant. In some of the test data, the Multipoints have a single set of coordinates. These can easily be turned into regular Point features.
As for dealing with real Multipoints, we should figure out what the best way to handle those are. Split them into single features? Take the center point?

@danielfdsilva
Copy link
Collaborator Author

This came up again and the solution was to get the center of the Multipoints. This is being done for pois.

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

No branches or pull requests

2 participants