-
Notifications
You must be signed in to change notification settings - Fork 574
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
Assertion failed: (0), function query #260
Comments
@phargogh did you I've got a potential workaround for you: do a Can you report back to me if that gets you out of this jam? |
Anything to report about a fresh from-source install @phargogh? |
Yep! The fresh, from-source install of shapely works as expected. Guess this should teach me to be more aware of the dependencies I've installed and am building against :) |
I was having the same issue and resolved it by importing shapely before importing osgeo. I didn't need to do the "pip install --no-use-wheel shapely". Just for future reference, could someone explain what's going on when shapely is imported before osgeo and why it causes the error? |
@dfelikson please see #262. I don't understand exactly what's going on yet. Specific details (operating system, sources of software -- Homebrew? PyPI? -- versions) will be needed to track this down. |
I was having this issue too, thank you! |
@sgillies I was using shapely in a virtualenv - did the
Now it works like magic... unlike @phargogh, I'm not importing |
@sgillies I did some digging and tracked this down in my case. I also found it is a known issue with fiona and other osgeo-based tools (Toblerity/Fiona#383). Here's my notebook: DescriptionWhen running the line:
the kernel will crash and Jupyter throws the error:
A possible solution was to reinstall shapely from source:
but @guziy's suggestion on geoplex/elasticsearch-spatial#1 got me to wonder, so I tried replacing the fiona import line. %load_ext watermark
%watermark
import shapely
shapely.__file__ # returns '/Library/Frameworks/GEOS.framework/Versions/3/Python/2.7/site-packages/shapely/__init__.pyc'
import fiona # <--- doesn't crash when commented out
from shapely.geometry import shape
scene_metadata = {u'geometry': {u'coordinates': [[[5.4438, 30.7100517],
[6.2335518, 30.6927744],
[6.2013482, 29.7034878],
[5.1922031, 29.7240552],
[5.2265358, 29.8585064],
[5.2640662, 30.0064961],
[5.3019095, 30.1543621],
[5.4438, 30.7100517]]],
u'type': u'Polygon'}}
g1 = shape(scene_metadata['geometry'])
from shapely import affinity
g2 = affinity.rotate(g1, 30)
combined = g2.intersection(g1) # <----- ***CRASH*** |
I was having this issue too, thank you! |
Hello,
When I use
shapely.ops.cascaded_union
, I encounter this error:It looks like it might be a compatibility issue with GDAL (which I believe uses a version of GEOS). Here's a script that fails:
I noticed that if I change the order of the import statements, cascaded_union works as expected.
Is this something that can or should be addressed by Shapely?
The text was updated successfully, but these errors were encountered: