Skip to main content

Questions tagged [shapely]

Shapely is an open source Python package for construction and analysis of 2D planar geometric objects common to geographic information systems.

0 votes
2 answers
2k views

I want to import cartopy on Python3, but it keeps showing me File "shapely\speedups\_speedups.pyx", line 408, in shapely.speedups._speedups.geos_linearring_from_py ...
0 votes
1 answer
459 views

I have a geodataframe containing 200 000 entries with Points, and I want to check which coordinates are inside a geodataframe containing 20 000 polygons that I am creating. The polygons are created ...
0 votes
1 answer
1k views

I want to find all the Point intersections between two shapely LineStrings. It is possible that there are multiple intersections and hence the output can be a MultiPoint. How do I know that the output ...
7 votes
1 answer
2k views

I have a GeoDataFrame where I have a mix of geometry types in its geometry column, some are multi-geometry types, some are single geometry types, some are empty geometry types, and others are None (...
3 votes
1 answer
558 views

I want to compute the distance from a point to a polygon given the point and direction. Currently I am using shapely and defining a "somewhat" infinite line string. This is not ideal as I ...
1 vote
1 answer
1k views

I would like to polygonize every single cell of a raster dataset using rasterio. I have been experimenting with the following function based on this question: def polygonize_raster(dataset): # ...
1 vote
1 answer
1k views

In using 'intersection' to crop / clip a single 'braided' line using a rectangle (actually a grown version of that rectangle using 'buffer'), the internal portion of the line gets split on self-...
5 votes
2 answers
5k views

Given the following example: def merge_with_largest(input_gdf,poly): # select the polygons bordering polygon close_by_gdf = input_gdf[input_gdf.geometry.intersects(poly)] # selects ...
2 votes
1 answer
2k views

I am trying to get a function to return True when a LineString intersects with any polygon in a list of polygons. Currently, I am using a for loop to iterate through all the polygons and check one by ...
1 vote
1 answer
229 views

I have a geopandas dataframe that looks likes this: level_0 id \ 0 0 028f342a-b26f-4e36-b5d1-25d3428cac2f 1 1 028f342a-b26f-4e36-b5d1-...
2 votes
1 answer
2k views

I am creating a linestring from points using shapely, but I could not generate the linestring using the points on my local system. This code is running fine on Google Colab. Is there any package ...
0 votes
1 answer
3k views

I have the following table in my MariaDB database: This table contains a column called 'coordinates' (type: LONGTEXT) with a wkt representation of either a MultiPolygon or a Polygon. I am attempting ...
1 vote
1 answer
254 views

I am having trouble calculating the area of an intersection of two shapely GeometryCollections which have been created from two GeoJSON multipolygons that represent drivetimes. I want to check for two ...
2 votes
4 answers
3k views

I had the following code in shapely 1.8.5.post1 which was working but was throwing a warning: import os os.environ['USE_PYGEOS'] = '0' import numpy as np import geopandas as gpd from shapely.geometry ...
3 votes
2 answers
597 views

Assume that I have two shapely LineStrings. I want to find their intersection and then add the intersection point as vertices into the respective LineStrings. from shapely.geometry import LineString #...

15 30 50 per page
1
2 3 4 5
64