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
0 answers

How to generate a shapely form from zip codes?

For Example I created a MultiPoint with shapely and the Zip Codes and added a Buffer of 0.01 to get an Area, but how do I find out how to set the Buffer appropriate for the Points or perhaps for each single Point? from shapely.geometry import…
Paul
  • 500
  • 3
  • 8
0
votes
2 answers

How to tell if point is in a predefined borders

I have a list of coordinates like so: [ -79.763635, 42.257327 ], [ -73.343723, 45.046138 ], [ -74.006183, 40.704002 ], [ -79.763635, 42.257327 ] I want to see if a point SomeLat, SomeLong is…
dsuma
  • 1,000
  • 2
  • 9
  • 30
0
votes
1 answer

Python - Shapely large shapefiles

I am reading in a GeoJSON file that contains two simple polygon descriptions that I made and six complicated vectors from http://ryanmullins.org/blog/2015/8/18/land-area-vectors-for-geographic-combatant-commands I can read my own 4-8 point…
mofs
  • 113
  • 1
  • 8
0
votes
1 answer

Difference between area value calculated by Python and actual value

I have a question regarding the inaccuracy in calculated area by Python and actual value. I searched a lot about it but I didn't find anything. I'm afraid that this difference made my next calculations inaccurate. Here is the code that I calculated…
Raffael Edu
  • 93
  • 1
  • 1
  • 5
0
votes
1 answer

Build documentation on ReadTheDocs fails on requirement shapely (due to libgeos)

While getting the documentation of a python repository right, I stumpled upon the issue that the package requirement shapely cannot be install on ReadTheDocs (RTD). The log says: Searching for shapely Reading…
gplssm
  • 129
  • 1
  • 7
0
votes
1 answer

Confused about python shapely exception ctypes.ArgumentError

I just installed shapely and basic things seem fine. I started following an example in this tutorial to get a feel for the library. Specifically: >>> from shapely.wkt import loads >>> g = loads('POINT (0.0 0.0)') >>> g.buffer(1.0).area #…
spanishgum
  • 1,030
  • 1
  • 14
  • 29
0
votes
1 answer

python shapely intersection function: clock-wise or counter-clock-wise

I have used the Shapely polygon intersection function: object.intersection(other) and get inconsistency in the direction and order of the vertices of the output polygon. Is there a way to have a systematic set of outputs, or should I run through…
Yair
  • 859
  • 2
  • 12
  • 27
0
votes
1 answer

join polygons without overlay (and plot)

I'm trying to join a set of polygons to create a single polygon. These polygons (they are not closed as in the last point being equal to the first), their edges are exactly equal at some point: poly1 = [(0,0), (1,0), (1,0.25), (1, 0.5), (1,0.75),…
Yorian
  • 2,002
  • 5
  • 34
  • 60
0
votes
1 answer

python shapely: retrieve the x,y,z value of a LinearRing

I`m trying to plot a LinearRing that shows the difference of the crossover of two Polygons: import mpl_toolkits.mplot3d as a3 import matplotlib.pyplot as plt from shapely.geometry import Polygon fig = plt.figure() ax = Axes3D(fig) poly1 =…
Yair
  • 859
  • 2
  • 12
  • 27
0
votes
1 answer

Shapely not able to precisely find points inside polygon

I have several points and I would like to check if they are contained on a polygon. The polygon and the points are represented by latitudes and longitudes. Following is the code of to reproduce my scenario and the Google Maps print screen of what it…
Eduardo
  • 4,282
  • 2
  • 49
  • 63
0
votes
0 answers

Failing to import Shapely / GEOS in Python on OSX

I am running a brewed Python 2.7.11 on OS X El Capitan 10.11.3. I fail to import Shapely / GEOS: Failed `CDLL(/usr/local/lib/libgeos_c.dylib)` Failed `CDLL(/Library/Frameworks/GEOS.framework/Versions/Current/GEOS)` Failed…
0
votes
1 answer

how to take a line from a text to use as input for a function python

Hi guys I have a text fill with some geodata that looks like…
Vedad
  • 223
  • 4
  • 15
0
votes
0 answers

shapely fast union difference

I am using shapely for union and difference operations on some geometry. To improve performance I want to use a Rtree. Do you guys have any suggestions for an efficient data structure? It should also handle nested geometries, e.g. a donut shape that…
Philipp H.
  • 1,513
  • 3
  • 17
  • 31
0
votes
3 answers

Odoo 9 Windows all in one not detecting Shapely

I installed Odoo 9 All in One on a Windows 2012 Server. Installed python 2.7, postgis, geojson, and shapely. When I try to install the geoengine camp2camp module I get an error Unable to install base_geoengine because external dependency is not met.…
0
votes
1 answer

How can I add points to Polygons which share an edge in shapely?

I have two shapes which are adjacent as in image A below. How can I add the left-hand red point to the blue polygon (poly1) and the right-hand red point to the grey polygon (poly2)? The idea is that both shapes will then share a line segment defined…
Jamie Bull
  • 12,889
  • 15
  • 77
  • 116