1,194 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
Advice
0
votes
2
replies
55
views
How do I set the matplotlib co-ordinate system to SVG
A synopsis of my code.
import matplotlib.pyplot as plt
import shapely.plotting
from shapely.geometry import Polygon
facing = 'north'
shape = 'triangle'
polygon = Polygon(((1, 17), (9, 1), (17,...
Advice
3
votes
5
replies
143
views
Computing line intersection points on trapezoid-type grid
I need to compute ~2 million coordinates (64-bit float tuples)
They're the intersection points of lines that form a trapezoid-shaped grid (see visual below)
The shape of the trapezoid is different ...
Advice
2
votes
4
replies
137
views
Buffer a polyline by variable distance
I have a list of points (x,y) that constitute a polyline, each point also has a value (m).
I want a polygon which is the buffer of the polyline with variable distance m. So at each point, the polygon ...
-1
votes
1
answer
230
views
How to merge many nearly parallel line segments into a single density-weighted segment (Python/Shapely)?
I have a dataset of line segments derived from many GPS traces, where users have followed the same roads but their paths aren’t identical (think of thousands of cars driving along a road, each with ...
0
votes
0
answers
148
views
Can't convert geometry from back to WKT after exporting from MySQL
I have a MySQL table with a multipolygon column, which has OSM geometry for each country's territorial waters. This is exported (by AWS) to a parquet file every night, which I then download - but I ...
1
vote
1
answer
119
views
How to build a correct cartopy feature around the south pole?
I want to build a cartopy feature for Antartica in palaeo geography. I have the lon/lat of the coastline.
I cant find a way to have a nice plot in any projection.
Here is an example that plot a simple ...
0
votes
1
answer
86
views
Calculate overlap in cluster area between multiple clusters
I have a raster image. Using scipy, I am clustering pixels that belong to each peak in the histogram that corresponds to the values in the image. I am able to detect two clear peaks that are clearly ...
0
votes
1
answer
84
views
Converting user-drawn polygons on a Cartopy map to a binary mask in Python?
I'm trying to make a program using Tkinter, Cartopy and Matplotlib that would allow users to draw polygons on a map. Once the polygon is closed (right click), I want to convert it to a mask where ...
1
vote
1
answer
122
views
Star-center of a star convex shape
I'm working with 2D shapes represented by their boundary contours (as ordered x,y coordinates), and I want to check if a shape is star-convex. If it is, I'd like to find a star center — i.e., a point ...
0
votes
2
answers
140
views
Elegantly handling python type hint for Shapely polygon.exterior.coords
I'm using Python 3.12 and I would like to return polygon.exterior.coords as a type of list[tuple[float, float]] so that I can correctly enforce typing later in the program. I'm wondering if there is ...
8
votes
0
answers
248
views
Diagram of road intersection flows (Sankey or other)
I'm trying to make a road intersection flow diagram in Python. The problem is, that none of the Sankey-specific modules that I managed to find support setting coordinates of the nodes and rotation of ...
1
vote
1
answer
237
views
How can I fix Singular Matrix Warning when computing a concave hull with alphashape?
The actual warning printed is "WARNING:root:Singular matrix. Likely caused by all points lying in an N-1 space." This is a surprise to me, since my points clearly populate a 2D area and are ...
2
votes
2
answers
72
views
How to calculate distances within boundary of a polygon in geopandas?
I've got two geopandas geodataframes. One is a series of points of locations. Locations of bus stops, for example. Let's call it bus_stops
I've then got another geodataframe where geometry column is ...
2
votes
1
answer
155
views
Graph traversal algorithm using shapely geometry points
I am trying to create a path planning algorithm for a robotic mower to cut all the grass in a defined area while avoiding obstacles or restricted areas. I am using the Python Shapely library to define ...
0
votes
0
answers
178
views
Shapely intersection function not giving desired result
I am using python to work on polygons. I want to find intersection of two polygons and then find the intersection of the intersected polygon with two lines.the intersection of a polygon with a line ...