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

error while building multipolygon with shapely 1.5.7 #45

Open
ustroetz opened this issue Apr 23, 2015 · 1 comment
Open

error while building multipolygon with shapely 1.5.7 #45

ustroetz opened this issue Apr 23, 2015 · 1 comment

Comments

@ustroetz
Copy link

Problem

I updated shapely 1.5.7 and I get the error below. If I use imposm with shapely 1.5.1 the problem doesn't happen.

It seems like it is related to issue #35.

Command

imposm -d santiago_chile -m imposm-mapping.py --read --write --optimize --overwrite-cache santiago_chile.osm.pbf

Error

Enabling Shapely speedups.
loading imposm-mapping.py as mapping
[18:11:36] ## reading santiago_chile.osm.pbf
[18:11:36] coords: 699k nodes: 13k ways: 99k relations: 0k (estimated)
[18:11:41] coords: 797k nodes: 0k ways: 183k relations: 0k
[18:11:41] reading took 5 s
[18:11:41] ## dropping/creating tables
[18:11:41] ## writing data
[2015-04-23 18:11:41,815] imposm.multipolygon - WARNING - error while building multipolygon:
[2015-04-23 18:11:41,815] imposm.multipolygon - ERROR - Null geometry supports no operations
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/imposm/multipolygon.py", line 146, in build
    self.build_relation_geometry(rings)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/imposm/multipolygon.py", line 221, in build_relation_geometry
    rings.sort(key=lambda x: x.geom.area, reverse=True)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/imposm/multipolygon.py", line 221, in <lambda>
    rings.sort(key=lambda x: x.geom.area, reverse=True)
  File "/Library/Frameworks/GEOS.framework/Versions/3/Python/2.7/site-packages/shapely/geometry/base.py", line 409, in area
    return self.impl['area'](self)
  File "/Library/Frameworks/GEOS.framework/Versions/3/Python/2.7/site-packages/shapely/topology.py", line 55, in __call__
    self._validate(this)
  File "/Library/Frameworks/GEOS.framework/Versions/3/Python/2.7/site-packages/shapely/topology.py", line 18, in _validate
    raise ValueError("Null geometry supports no operations")
ValueError: Null geometry supports no operations

Setup

Python 2.7.9 (default, Jan  7 2015, 11:49:12) 
imposm 2.6.0 (installed with pip install imposm)
shapely 1.5.7
OS X 10.10.3.
@ustroetz ustroetz changed the title imposm.multipolygon - WARNING - error while building multipolygon: error while building multipolygon with shapely 1.5.7 Apr 24, 2015
@ustroetz ustroetz reopened this Apr 24, 2015
@jlnr
Copy link

jlnr commented Aug 27, 2015

For anyone finding this on Google—I was running into the same error on OS X 10.10.5, and I've fixed it by deleting everything starting with Shapely from /Library/Python/2.7/site-packages/, then installing Shapely 1.5.2:

sudo easy_install shapely==1.5.2

I'm not a Pythonist, but I guess you'll have to replace easy_install with pip or a venv incantation depending on your setup :)

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