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

change espg from hex shape (which was converted using shapely.wkb.loads)

I'm working with a geodataframe called college3 college3 = gpd.GeoDataFrame(pd.read_table('data.txt'),crs = {'init': 'epsg:4269'}) The shape column was originally written in the format: country type color relver shape _imported _dataset …
M3105
  • 519
  • 2
  • 7
  • 20
0
votes
1 answer

passing a multipolygon rather than the boundary box via a Crate DB table

I have a geopandas dataframe called geodf. The geometry for each row in that dataframe is a multipolygon. For instance, if we consider the first row in the geometry column via the geodataframe: bound = geodf['geometry'].iloc[0] print(bound) it…
M3105
  • 519
  • 2
  • 7
  • 20
0
votes
2 answers

problems with shapefile output - fiona

I'm using Fiona to write a shapefile containing geometries of US Census congressional districts and census tracts with some computed attributes. Unfortunately, my file is being outputted blank. I am able to see the records in QGIS but not the…
0
votes
0 answers

Find shortest linestring between two points while avoiding n-sided polygon

I am trying to find the shortest linestring between two points. There is a constraint that there is an n-sided polygon possibly directly between the 2 points. I am not allowed to cross through the polygon but only pass through its edges. eg. start…
Zito Relova
  • 1,041
  • 2
  • 13
  • 32
0
votes
1 answer

Can't click on mobile menu when using anchor link directly on URL

I have an anchor link in my main menu to a contact form on my home page, when you go there from another page the "hamburger" icon becomes unclickable. I'm using the "Shapely" theme for wordpress and I believe that there is a bug on it. I had already…
NullEins
  • 101
  • 1
  • 13
0
votes
1 answer

Optimize python code used for LineStrings intersection

I am trying to find the intersections of multiple LineStrings that are in a list. Do you know how I could optimize this? I'm not sure on how to make it go faster(provided a small example): from shapely.geometry import LineString l1 =…
Barkz
  • 193
  • 1
  • 10
0
votes
1 answer

Use additional library in PySpark3 on HdInsight

I am trying to install Shapely library but when I import it, I receive error message: > from shapely.geometry import Point No module named 'shapely' Traceback (most recent call last): ImportError: No module named 'shapely' My kernel is : cat…
Steven
  • 14,048
  • 6
  • 38
  • 73
0
votes
0 answers

python shapely library, does different systems(win10 and win7) need different versions of shapely

My system is Win 10, 64 bit. python 2.7 I install shapely with below commands, and it works well with Win 10. conda config --add channels conda-forge conda install shapely Then I used pyinstaller to generate an executable for others to use my…
Jack
  • 27
  • 5
0
votes
1 answer

Shapely : tuples without commas with LineString

it's quite complicated, but long story short : I've used several libraries like OSMNx to draw a route between several spots of a city. Now I would convert it as a shp file. The route is a list full of nodes' id. Then these id were used to extract…
Raphadasilva
  • 565
  • 1
  • 6
  • 21
0
votes
0 answers

How to add field to polygon from spatial join with points using geopandas

I have a geodataframe with points, each with a scalar value. I also have a geodataframe with shapes. I want to add the value field of all points that intersect shapes to their respective shape. So if point 1 has value 10 and point 2 has value 3 and…
J. Doe
  • 985
  • 2
  • 10
  • 15
0
votes
1 answer

Find longest "straight" path between Point and Polygon

Is it possible to find the longeststraight distance between a Point (latitude and longitude) and a Polygon in Shapely? I read it's possible to find the closest path, but i'm not sure about the longest.
Alberto Bonsanto
  • 17,556
  • 10
  • 64
  • 93
0
votes
1 answer

cyassimp for trimesh in python anaconda?

Attempting to follow the instructions here, I type conda install -n my-conda-env -c menpo/label/master cyassimp I get Fetching package metadata ............. Solving package specifications: PackageNotFoundError: Dependency missing in current…
Reb.Cabin
  • 5,426
  • 3
  • 35
  • 64
0
votes
1 answer

Intersect two shapely polygons on the Earth projection

as i know, shapely use only cartesian coordinate system. I have two point on the earth with lat and lon coordinates. I need create buffer with 1km radius around this two points and find polygon, where this buffers intersect. But construstion…
0
votes
1 answer

An empty polygon generated with OpenTripPlanner generates error with .is_empty Shapely instruction

I have an isochron polygon generated with OpenTripPlanner: {"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"MultiPolygon","coordinates":[]},"properties":{"time":-47},"id":"fid--576b228b_15b66d32d71_-7cbd"}]} This…
0
votes
1 answer

cascaded_union(polygons) recover circumference point indices

My question is simple, but the solution might be very tricky. I have a collection of triangles, and I want to find their union. The triangles are given in the standard way: by a list of coordinate points (2 coordinates for each point) and a list of…
John
  • 465
  • 1
  • 6
  • 13