shapely

Dealing with "cracks" in the unary_union of several imprecise Polygons?

Dealing with "cracks" in the unary_union of several imprecise Polygons? Question: I used shapely.ops.unary_union on a number of 6-sided shapely.geometry.Polygons, and obtained the following shape A: Note how there are two "cracks" in the upper part. These are not intended, and are presumably caused by some floating-point edge cases. If you construct another shape B …

Total answers: 1

Multipolygon column from zip_code polygon

Sum column data while merging zip_code polygons to MultiPolygons in geopandas Question: I m working with python on a Jupyter notebook I have the following dataset: +——-+————+———-+—————————————————+ | zip | population | area# | polygon | +——-+————+———-+—————————————————+ | 12345 | 50 | 55 | POLYGON ((-55.66788 40.04416, -55.66790 40.044… | | 12346 | 100 | …

Total answers: 1

Is tere a way to process point in area faster in Python? shapely implementation

Is there a way to process point in area faster in Python? shapely implementation Question: I have attempted to try in Python the same thing I achieve in a GIS Software. I have 51 centroids to compare to 90,000+ parcels and find the overlap. It seems that my script is working (which I am happy …

Total answers: 2

Finding the minimum distance from a point to a curve

Finding the minimum distance from a point to a curve Question: I need to find the minimum distance from a point (X,Y) to a curve defined by four coefficients C0, C1, C2, C3 like y = C0 + C1X + C2X^2 + C3X^3 I have used a numerical approach using np.linspace and np.polyval to generate …

Total answers: 2

Checking if Points In Polygon (State) and Mapping the State

Checking if Points In Polygon (State) and Mapping the State Question: I am trying to map Point data to geographic locations (i.e. US states). I want to create a ‘States’ column by checking if the points fall within certain states using geojson data that has the polygon data in shapely geometry format, and the US …

Total answers: 1

Check if geographical polygon is valid

Check if geographical polygon is valid Question: I have a df that look like this coordinates={"type":"zone","bound":"POLYGON ((11.31767 43.32289, 11.32205 43.32467, 11.3235 43.32458, 11.32395 43.32474, 11.32411 43.32522, 11.32623 43.32516, 11.32647 43.32459, 11.32576 43.32435, 11.32581 43.32384, 11.32438 43.32332, 11.32803 43.32171, 11.32573 43.32016, 11.32571 43.31896, 11.32588 43.31844, 11.32319 43.31699, 11.32058 43.31589, 11.31782 43.31419, 11.3171 43.31093, 11.3166 43.31046, 11.31569 …

Total answers: 1

Draw line from every edge of the polygon to opposite vertex

Draw line from every edge of the polygon to opposite vertex Question: I am trying to draw a perpendicular line from every edge to the opposite vertex of a polygon. I am only interested if the line is inside the polygon. Otherwise, I do not want to draw it. I am using the shapely library …

Total answers: 1

Join 2 non-intersecting non-convex Polygons

Join 2 non-intersecting non-convex Polygons Question: these are the 2 polygons to be joined: this is the result needed: how I might approach the problem : Find the projection of polygon B on polygon A , create a convex-hull of polygon B and the projection, and join all using shapely.ops.unary_union(), I don’t know how to …

Total answers: 1

Python Shapely – Find which plot is greater than the other around intersection point

Python Shapely – Find which plot is greater than the other around intersection point Question: I have two LineStrings which are generated from random-like data. They share the same x-coordinate values. After finding their intersection point(s), I want to know which plot is greater than the other slightly before the intersection point. Here an example …

Total answers: 1

remove polygons with an intersection higher than a threshold

remove polygons with an intersection higher than a threshold Question: The goal is to remove polygons with an intersection higher than a threshold, let’s say 80% of the area from the smaller intersected polygon. In the following picture we see in first image how the small red circle in coordinate (2.06, 41.41) is overlapping with …

Total answers: 1