### Fix invalid polygon in Shapely

Shapely defines a Polygon as invalid if any of its segments intersect, including segments that are colinear. Many software packages will create a region or area with a "cutout" as shown here which...

Shapely defines a Polygon as invalid if any of its segments intersect, including segments that are colinear. Many software packages will create a region or area with a "cutout" as shown here which...

I am testing the point-in-polygon function with matplotlib and shapely. Here is a map contains a Bermuda triangle polygon. Google maps's point-in-polygon functions clearly shows testingPoint and...

I have a list of x and y values for two curves, both having weird shapes, and I don't have a function for any of them. I need to do two things: (1) plot it and shade the area between the curves...

I have tried to install geopandas via I python by running !pip install geopandas, but this fails with "python setup.py egg_info" failed with error code 1 and then Path to long directory. I read...

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...

I'm trying to find an efficient way to compute the distance from a point to the nearest edge of a polygon in python. I thought shapely would be perfect for this, but it only computes the distance...

I'm just trying to use the demo code. I run the following in Jupyter Notebook: from shapely.geometry import shape Which gives me the following: OSError Traceback...

I have a part of perimeter of a polygon and need to close it.Please refer this image As I can see there is only one unique way to close the polygon without dividing the polygon and without the...

I'm making a child theme based off of Shapely. In Shapely's functions.php, custom-logo support is declared. /** * Add support for the custom logo functionality */ add_theme_support(...

I've tested various ways to manage my project dependencies in Python so far: Installing everything global with pip (saves spaces, but sooner or later gets you in trouble) pip & venv or virtualenv...

This error raised while installing geopandas. I've looking for its solution on the web, but none of them really explain what happened and how to solve it.. This is the full error: Collecting...

I try to import geopandas in my jupyter notebook. import geopandas as gp and I get the following error: ImportError:...

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...

I have a geodataframe showing ~25 locations represented as point geometry. I am trying to come up with a script that goes through each point, identifies the nearest location and returns the name...

Is there a method in shapely or a similar library that is exactly equivalent to postGIS method st_makevalid? As it stands, using .buffer(0) as recommended here is not enough. Are there any pure...

I am trying to execute PyInstaller on a my script. I installed all of the required packages and the .exe is succesfully created. But when I execute it on another machine, I get he Following...

I'm trying to use shapley, and to use it for what I need it for, I have to import "from shapely import geometry" but I get the error OSError: Could not find lib geos_c.dll I've tried to install...

I'm working with Shapely polygons and I need a way to delete all smaller polygons contained within a bigger polygon. I tried using the .contains() method which Shapely provides, but the method...

I have tried to uninstall and reinstall matplotlib in my tf-gpu enviornment I made but I keep getting this error: ImportError: cannot import name 'rcParams' from 'matplotlib' This is the entire...

I have a column in a GeoPandas dataframe with strings like this one '{type=Point, coordinates=[37.55, 55.71]}' or this '{type=MultiPoint, coordinates=[[37.6, 55.4]]}'. It can be a polygon or any...

I have a script, which takes data from oracle, puts data to pandas.DataFrame -> geopandas df and exports to geoJSON: import cx_Oracle import pandas as pd import geopandas as gpd from...

I'm currently developing a software which is doing a lot of spatial analysis and checks overall, if the user has done something which is discouraged. To check the validity of a Polygon (LinearRing...

I'm aiming to plot the boundaries of clusters of MSOAs (contiguous geographical units in UK) to do so I've downloaded a shapefile of MSOA boundaries from here. I then add a column of cluster...

How do you triangulate a polygon in Shapely? Shapely actually offers a triangulate() function, but that only triangulates the vertices of the polygon as a point set. For convex polygons the...

I am using shapely in python and trying to generate evenly spaced points in a grid that fall within a shape in the fastest O(n) time. The shape may be any closed polygon, not just a square or...

I have a fastapi app that I want to deploy to google cloud run. With a gRPC python project, We deploy it as gcloud beta run deploy countries --source . But this doesn't deploy as expected. I...

i have a geoJSON geo = {'type': 'Polygon', 'coordinates': [[[23.08437310100004, 53.15448536100007], [23.08459767900007, 53.15448536100007], [23.08594514600003, 53.153587050000056], ...

Trying to read a shapefile (.shp) and received an ImportError after executing the below line of code. I even pip installed GDAL, geopandas, fiona and shapely before executing the below...

I have to find if the point belongs to an area. Information is given by geojson file. I created DataFrame by: choro = pd.concat([pd.DataFrame({'name':block['properties']['name'], 'area':...

I have a curve parameterized by time that intersects a shape (in this case just a rectangle). Following this elegant suggestion, I used shapely to determine where the objects intersect, however...