Skip to main content
Filter by
Sorted by
Tagged with
2 votes
2 answers
76 views

I have a group of triangles that will tile an area, one possible configuration is shown in the included image. I want to find out how many edges each triangle shares with adjacent triangles. So a ...
user32408262's user avatar
2 votes
1 answer
99 views

I made a shapefile containing the boundaries of all the worlds countries and some of their regions (like the states in the US, Canadian provinces, etc). I've been trying to set a boundary box of my ...
Gabe Mathews's user avatar
Advice
0 votes
2 replies
63 views

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,...
snow6oy's user avatar
  • 715
Advice
3 votes
5 replies
177 views

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 ...
ReX357's user avatar
  • 1,229
Advice
2 votes
4 replies
171 views

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 ...
Victor Savenije's user avatar
-1 votes
1 answer
282 views

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 ...
user26535132's user avatar
1 vote
1 answer
159 views

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 ...
jimbofreedman's user avatar
1 vote
1 answer
140 views

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 ...
Marti's user avatar
  • 91
0 votes
1 answer
98 views

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 ...
prayner's user avatar
  • 433
0 votes
1 answer
93 views

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 ...
Nevpzo's user avatar
  • 187
1 vote
1 answer
131 views

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 ...
rouar's user avatar
  • 17
0 votes
2 answers
183 views

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 ...
AJP's user avatar
  • 29.1k
8 votes
0 answers
268 views

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 ...
leonefamily's user avatar
1 vote
1 answer
271 views

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 ...
jojusuar's user avatar
2 votes
2 answers
81 views

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 ...
elksie5000's user avatar
  • 7,882
2 votes
1 answer
189 views

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 ...
Tomasm64's user avatar
0 votes
0 answers
207 views

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 ...
Karan Mahajan's user avatar
0 votes
2 answers
57 views

I have a polygon "poly" and a point "A". With the nearest_point function I can calculate the nearest point "p1" on the polygon to the point "A". Now I would ...
Matthias La's user avatar
0 votes
1 answer
95 views

I have some radiobuttons to select colour and width of a linestring in an embedded plot. I can't get the plot to clear when I select a new colour or width and the new plot is placed below the original ...
Helidad0's user avatar
1 vote
1 answer
96 views

I have a line vector where each segment has a randomly assigned direction. The image shows an example (which consists of two connected lines), How to set the direction of each line so that it is ...
user3065529's user avatar
2 votes
1 answer
235 views

I am having an issue obtaining a linestring from an intersection with a polygon using GeoPandas. The linestring is self-intersecting, which is what is causing my issues. A line intersecting a polygon: ...
Jet-Cadet's user avatar
0 votes
1 answer
170 views

I have this feature collection with a lot of points that form a shape: I need to create a polygon feature collection with this shape, I tried using the shapely multipoint.convex_hull method but the ...
Foncho's user avatar
  • 15
0 votes
1 answer
104 views

I have a set of longitudes and latitudes for which I need to create an enclosing Polygon. In some cases, these sets of points overlap and creating a Polygon has been giving me a lot of trouble. I have ...
blaufer's user avatar
  • 119
0 votes
1 answer
75 views

I have a (2000x2000) python array of 0's and 1's that represent whether a cell is free or not. I'd like to turn this dense representation into a shapely object. For example, an array of the type: 0 0 ...
none none's user avatar
  • 353
-1 votes
1 answer
264 views

In a shapely MultiLineString, I have LineStrings that may be disjointed. What is the best way of connecting it? I have attached an image example, where I need the blue line to be connected to the ...
nworbi's user avatar
  • 29
0 votes
2 answers
139 views

This Python script: from shapely import simplify, points, contains, Point circle = Point(0, 0).buffer(1.0, quad_segs=8).exterior simple = simplify(circle, 0.1) simplifies polygon circle (red) and ...
Paul Jurczak's user avatar
  • 8,744
0 votes
1 answer
126 views

In my project there are two use-cases. The red and blue shapes are not overlapping in the first case, but they do in the second. case #1 case #2 In my test code I tried various predicates from ...
snow6oy's user avatar
  • 715
0 votes
1 answer
182 views

I have a Shapely multiline string that has multiple branches that I want removed. I've attached an image where the red is the main line that I want to keep and the black are to be removed. I can't ...
nworbi's user avatar
  • 29
0 votes
1 answer
102 views

I have a linestring which traces part of it's path back over itself (a there and back trajectory). When I try to intersect this linestring with a polygon to try to get the distance travelled within ...
user1894205's user avatar
1 vote
3 answers
221 views

I’ve been struggling with a problem related to collision detection and positioning in a 2D space, and I could really use some guidance on achieving good performance. I have a rectangular boundary (...
David H's user avatar
  • 13
1 vote
1 answer
41 views

I identify polygons that intersect, then compute their intersection and remove them from the first polygon. I get a weird left-over point. If I just take the difference between the polygons, this ...
MarcelD's user avatar
  • 115
0 votes
1 answer
53 views

I've got a geopandas (EPSG:4326) that when I plot, this is the result (a road intersection): What I'm trying to achieve is to "trim" these geometries around the center of the intersection. ...
Paulo Henrique PH's user avatar
2 votes
2 answers
416 views

I work on a segmentation model for historical documents. My dataset has the text lines as polygons but for a usable model training I need also the center-lines or baselines of the polygons. As an ...
bsteo's user avatar
  • 1,791
2 votes
3 answers
664 views

I have a polygon shapefile which was vectorized from a raster layer (second image). This shapefile contains thousands of features with just one column which represent polygon level (ranging 1-5). The ...
Naama's user avatar
  • 63
1 vote
0 answers
91 views

I'm trying to plot dxf file on matplotlib plot. Shape is drawn correctly but my offset unfortunately no. This is my shape: My shape And code I wrote: def draw_outside_offset(self, offset=6.0): ...
lpkkk's user avatar
  • 11
1 vote
0 answers
90 views

I have one polygon and want to calculate the wind direction based on the long boundary and point inside. The point is the wind's starting point and the direction follows the long distance to the short ...
zxdawn's user avatar
  • 1,039
0 votes
1 answer
276 views

I have a geopandas file with one of the columns being a shapely polgyon. Here is what it looks like. I tried to upload it to BiQuery using pandas_gbq.to_gbq(df,..., table_schema=[{'name': 'name', '...
Winston Li's user avatar
0 votes
1 answer
220 views

I am trying to make a choropleth map from county level FIPS data using this example from plotly. import plotly.figure_factory as ff import numpy as np import pandas as pd df_sample = pd.read_csv('...
Tyler's user avatar
  • 149
-1 votes
1 answer
235 views

I am interested in getting a LineString that is a cutout from an original Shapely LineString. Basically I want the geometry of the red line in the image which is between the two cyan points. I know ...
horsemeat's user avatar
2 votes
3 answers
541 views

Shapely's Polygon and LinearRing are not iterable (any longer, if I remember the history correctly). I often need to iterate over their vertices as Point objects (not tuple), and my current solution ...
Paul Jurczak's user avatar
  • 8,744
0 votes
1 answer
130 views

I've been working on a georeferenced data set using geopandas library, when I use gdf.plot() the figure I get is right,in the sense that latitude and longitude of the POINTS being ploted match the ...
nacholavarria's user avatar
0 votes
1 answer
62 views

In my tool hydrotopo, when I run find_edge_nodes to find topological relations for about 100,000 linestrings, it only costs about 10 seconds; but in code below, find_edge_nodes will cost about 30min: #...
forestbat's user avatar
  • 1,115
0 votes
1 answer
591 views

What I currently do: Read .shp file using GeoPandas (Python), parse it to GeoJSON and write the data into MongoDB (Create a 2D-Sphere Index on the collection for efficient querying.) Query a subset ...
FrostyFrog's user avatar
0 votes
4 answers
399 views

I would like to "average" several polygons having a substantial intersection, e.g. these three: Preferably using a Python library, e.g. Shapely. I don't see a suitable function there, which ...
Paul Jurczak's user avatar
  • 8,744
1 vote
0 answers
827 views

I am new to CAD and GIS and developing a functionality to convert dwg into shapefile using python libraries- ezdxf, geopandas and shapely. I am encountering issues during conversion, the code is ...
Rahul Roy Verma's user avatar
1 vote
1 answer
146 views

I have a polygon shapefile (actually, there are 170 such files) and want to calculate the elongation ratio for each polygon. The elongation ratio is the ratio of the short to the long side of the ...
ABC's user avatar
  • 358
1 vote
2 answers
126 views

I am looking at the shapely documentation for transform with the following examples: >>> from shapely import Point >>> from shapely.ops import transform >>> transform(Point(...
JoScratcherJo's user avatar
-2 votes
1 answer
186 views

I would like to calculate the shortest path from mines to ports, along the rail network. Since the mines and ports are not directly on the network, I first worked out the nearest rail point for each ...
user15852004's user avatar
0 votes
0 answers
158 views

I have a route that has several coordinates that would basically be point A to point B, point B to point C,..., until the route is completed. I receive coordinate data from a tracker on the route ...
opa's user avatar
  • 9
-1 votes
2 answers
523 views

I'm using Python. geopandas and shapelly to process the geometries of a road intersection. The geojson has a list of Polygons that I want to straighten into Lines, something like this: Does anyone ...
Paulo Henrique PH's user avatar

1
2 3 4 5
24