shapely Questions

3

Solved

My data set consists of a LineString and I want to filter out the individual line segments of this LineString. More precisely, every single street segment. Until now I have extracted the individua...
Kiger asked 27/5, 2020 at 21:33

4

Solved

I have a function that outputs a grid of points as x and y numpy arrays for interpolation, but before I interpolate, I want to use Geopandas to perform an intersection with my research boundary (ot...
Mcatee asked 21/6, 2018 at 15:10

10

Solved

How do you get/extract the points that define a shapely polygon? Thanks! Example of a shapely polygon from shapely.geometry import Polygon # Create polygon from lists of points x = [list of x va...
Neri asked 9/12, 2013 at 15:40

3

Solved

I am using Python 3.5 64 bit in Windows 7 64 bit, shapely version 1.5.13. I have the following code that returned me a self-intersecting polygon: import numpy as np from shapely.geometry import P...
Slocum asked 31/1, 2016 at 5:23

3

Solved

I am trying to interpolate a point onto a LineString in Shapely and then split the linestring accordingly. However, due to a precision error, Shapely thinks that the interpolated point is not on th...
Confirmation asked 5/5, 2018 at 21:13

3

Solved

I'm trying to (roughly) equally space the points of a line to a predefined distance. It's ok to have some tolerance between the distances but as close as possible would be desirable. I know I could...
Sleuthhound asked 20/7, 2020 at 6:54

4

Solved

I found the envelope class in Java's JTS library very handy. An envelope holds the minimal and maximal coordinates of a geometry and is also called bounding box sometimes. I wanted to get the comm...
Brazee asked 20/11, 2013 at 11:12

13

I use Python in Fedora 19. I wanted to run the following line: import shapely.geometry but the following error appears: OSError: Could not find library geos_c or load any of its variants ['libgeos...
Omeromero asked 2/11, 2013 at 13:31

3

Solved

I used to use shapely to make a cirle and plot it on a previously populated plot. This used to work perfectly fine. Recently, I am getting an index error. I broke my code to even the simplest of op...
Mitchum asked 30/1, 2023 at 16:46

4

I'm trying to extract the polygons from multipolygons in Shapely. I can transform a list of polygons into multipolygons using MultiPolygon from Shapely. >>> Multi = MultiPolygon([shape(po...
Jon asked 13/8, 2016 at 7:7

3

Solved

There are a lot of questions here about matching points in polygons efficiently (examples: Here and Here). The primary variables of interest in these are high number of points N, and number of poly...
Valletta asked 19/4, 2021 at 22:33

4

I tried to create a polygon shapefile in QGIS and read it in python by shapely. An example code looks like this: import fiona from shapely.geometry import shape multipolys = fiona.open(somepath) ...
Thievery asked 28/5, 2020 at 22:53

2

Solved

I am working with the Shapely library in Python. I find the intersection of two lines, the return value is given as a MultiPoint object. How do I deconstruct the object to get the individual poin...
Rabblerouser asked 27/6, 2018 at 10:46

2

Solved

I have a case which is based on projecting a point on a line and then separate this line on it. My use case is slightly more complicated, but my problem can be reproduced with the following code: ...
Quarters asked 19/1, 2015 at 16:10

3

Solved

I have a large number of polygons (~100000) and try to find a smart way of calculating their intersecting area with a regular grid cells. Currently, I am creating the polygons and the grid cells u...
Rinse asked 4/2, 2013 at 23:7

9

Solved

I want to use Shapely for my computational geometry project. I need to be able to visualize and display polygons, lines, and other geometric objects for this. I've tried to use Matplotlib for this ...
Floribunda asked 4/4, 2019 at 18:4

2

Solved

I have a GeoDataFrame (let's call it Destinations) that was made from a point shapefile using GeoPandas. For every feature (correct me if the terminology is wrong) in Destinations, I need to find t...
Relay asked 16/8, 2021 at 13:6

2

Solved

The Docstring says: Polygon.contains Returns True if the geometry contains the other, else False Polygon.within Returns True if geometry is within the other, else False How are they different?
Aachen asked 23/5, 2015 at 20:18

2

Solved

I am using CV2 to find contours from an image and then converting them into polygons using Shapely. I am currently stuck because when I try putting one of the contour arrays into Polygon() from Sha...
Tamatamable asked 16/9, 2019 at 23:25

2

I have seen this question asked but have not really been able to find a full response. I have a simple shapely polygon, called polygon. I would like to extract this polygon as a binary mask (ideall...
Curling asked 26/5, 2021 at 15:37

2

Solved

I created a list of Shapely Point objects based on the point data set. How can I plot this list of points below? points = [Point(-4.85624511894443, 37.1837967179202), Point(-4.855703975302475, 3...
Eparch asked 19/12, 2019 at 23:7

3

This is code that used to work previously, but doesn't anymore: import geopandas as gp from shapely.geometry import Polygon a = Polygon([(0, 0), (0, 1), (1, 1), (1, 0)]) b = Polygon([(0, 1), (0, 2...
Unexampled asked 12/1, 2021 at 0:36

4

Solved

Linestring1 = LINESTRING (51.2176008 4.4177154, 51.21758 4.4178548, **51.2175729 4.4179023**, *51.21745162000732 4.41871738126533*) Linestring2 = LINESTRING (*51.21745162000732 4.41871738126533*, *...
Iconic asked 15/5, 2020 at 12:22

4

Solved

I have two points A (10,20) and B (15,30). The points generate a line AB. I need to draw a perpendicular line, CD, on point B with a length of 6 (each direction 3 units) in Python. I already have...
Lobar asked 16/7, 2019 at 20:37

2

Solved

I am running the following script which I believe should be returning TRUE for the point being in the polygon but it is returning FALSE. from shapely import geometry polygon = [(-1571236.83497071...
Strained asked 11/9, 2018 at 17:15

© 2022 - 2024 — McMap. All rights reserved.