Questions tagged [shapely]

PostGIS-ish operations outside a database context for Pythoneers and Pythonistas.

Shapely is a BSD-licensed Python package (see Shapely · PyPI) for manipulation and analysis of planar geometric objects. It is based on the widely deployed GEOS (the engine of PostGIS) and JTS (from which GEOS is ported) libraries. This C dependency is traded for the ability to execute with blazing speed. Shapely is not concerned with data formats or coordinate systems, but can be readily integrated with packages that are. For more details, see the Shapely manual.

1113 questions
0
votes
2 answers

Creating Shapely Polygon/MultiPolygon from OpenStreetMap data

I am trying to make a tool to analyse GPX files using OpenStreetMap data for identification of locations. I have successfully extracted all the waypoints from the GPX files and created as a MultiPoint object, and extracted OpenStreetMap border…
Aun Johnsen
  • 13
  • 1
  • 7
0
votes
1 answer

How to Preserve a Complex Line During Shapely Intersection

I'm trying to intersect a complex line with a polygon using the Shapely library in Python. Unfortunately Shapely breaks my original line so that it returns a simple line instead. For example: # complex line folded back on itself (A-B-A) ls =…
Aidan Kane
  • 3,856
  • 2
  • 25
  • 28
0
votes
1 answer

How to install shapely on Bluemix?

I have got some existing iPython code using shapely for matching points within polygons: Now, I'm attempting to port the code to pyspark (version 1.4) on Bluemix Running the line below fails: !pip install --user shapely The error message…
0
votes
1 answer

How to install shapely (python package)

The instructions for Windows ask to download the installer from http://www.lfd.uci.edu/~gohlke/pythonlibs/ The link for my version displays as "Shapely‑1.5.13‑cp27‑none‑win_amd64.whl". However it is actually a zip file, which contains 2 folders,…
Alexis Eggermont
  • 7,665
  • 24
  • 60
  • 93
0
votes
0 answers

Geospatial Analytics (lat long in shapefile)

This is a follow up question to Geospatial Analytics in Python The question is similar to https://gis.stackexchange.com/questions/84114/shapely-unable-to-tell-if-polygon-contains-point but reversing lat long seemed to have solved the issue, but it…
GreenThumb
  • 483
  • 1
  • 7
  • 25
0
votes
3 answers

Python subclass loses subclass attributes

This is question based on the shapely package but I think it's a more general question. Basically I have two classes coming from shapely. One is called Point and the other is called MultiPoint. You instantiate Point with a tuple of coordinates and…
Ben
  • 4,774
  • 5
  • 22
  • 26
0
votes
2 answers

How do you install shapely for Python 2.7 on Windows?

The installation instructions from https://pypi.python.org/pypi/Shapely say to download an executable installer from http://www.lfd.uci.edu/~gohlke/pythonlibs/#shapely but that gohlke web page only offers binaries for shapely for Python 3.5, none…
eos
  • 1,475
  • 1
  • 14
  • 25
0
votes
1 answer

Using shapely library with py2exe

Can't seem to figure out how to get this library to import correctly when porting with py2exe. I've tried including the shapely library in the setup file, copying all the required dll's into the dist folder, and many other things for days now. I can…
Kenny Powers
  • 1,254
  • 2
  • 15
  • 25
0
votes
1 answer

Python gdal stopped working when using ogr Within, Contains or other

Update: By further ivestigation I found out it must be caused by somehow corrupted geometry. But even if I run: if drillhole[1].IsValid(): It is causing the crash. So not sure how to check it. I am trying to test if lines are within polygons. Using…
Miro
  • 599
  • 10
  • 29
0
votes
1 answer

how install shapely on windows so it can be imported from matlab?

i'm on windows 7/64. shapely doesn't offer windows installers on their pypi page, even though they seem to have recently. their pypi page, and their README say to use chris gohlke's unofficial binaries. i'm not clear on the reason -- something…
user1441998
  • 459
  • 4
  • 14
0
votes
0 answers

AttributeError: function 'GEOSCovers' not found

I have install shapely on my pc win 64 bit python 2.7. When i write import shapely it works fine. But the above error comes in the following code: import numpy as np from scipy.spatial import Voronoi, voronoi_plot_2d import shapely.geometry import…
0
votes
2 answers

Python - Getting attributes from Line contained in a MultiLineString shapefile that intersects a Polygon

I have 2 shapefiles, 1 containing a lot of lines that make up a road network, and another with many GPS points. So far I've managed to open both shapefiles and do an intersection() using Shapely and Fiona, using the code found here -…
friveraa
  • 6,265
  • 2
  • 12
  • 7
0
votes
1 answer

Finding points of a cascaded union of polygons in python

I am trying to find the closely lying points and remove duplicate points for some shape data (co-ordinates) in Python. I name the co-ordinates nodes as 1,2,3.. and so on and I'm using the shapely package and creating polygons around the node points…
user3637176
  • 31
  • 1
  • 1
  • 4
0
votes
2 answers

Installation of Shapely module in windows 7 64 bit.

I would like to do spatial join pro-grammatically using python. I have tried to install shapely in my (windows 7 64 bit) pc from https://pypi.python.org/pypi/Shapely. When I execute import shapely in my python shell, it works. But it raises no…
RPDN
  • 1
  • 1
  • 2
0
votes
2 answers

Shapely LineString SVG Error

I am trying to learn Shapely and I ultimately would like to take a series of x,y coordinates and create an offset or parallel line. I previously posted a question on this process last night and realized it may have been confusing, so let me restate…