I have a pandas dataframe with quite a few columns in it. Two of the columns are titled X and Y and represent human gaze coordinates. Each row contains a timestamp column and an instance of X and Y. Now, I am using the X and Y columns as Point(Shapely) coordinates for a few functions! ..

#### Category : shapely

I need to create hexagonal grid and convert it to polygons. As an input I have a shapely.Polygon. I found how to solve this problem in R and I’m wondering if there is a simpe workaround for python, using modules such as shapely or geopandas, not by generating hexs from the beginning. The idea under ..

i would like to find the distance between two geodata-frames as shown below in the code. the code posted below provide different distances values then those i get from postgis database.by visualising distances on qgis, the distances from the database postgis is more realistic and reliable than the ones i get from the below posted ..

I have a dataframe, which is a spatial data with coordinates and multiple other entries. df.columns=[‘longitude’,’latitude’,….,’data’] If I have the coordinates of a line profile, profile=[(x1,y1),(x2,y2)] and consider the profile have a custom width (5 km), How to extract the data rows in the dataframe which falls inside this profile? (Is there a particular function ..

in the below code i want to calculate the distance from a point to the nearest edge of a polygon.as shown in the results section below, the coordinates are provided.the code posted below shows how i find the distance from a point to the neatrest edge of a polygon. at run time, and as shown ..

I’m working on use a few Geojson files from GIS (shapes) about a Territory (River and waterway) using mesa-geo for agent based modeling. Goal Full Area I have managed to bring the geojson from the area, but when i have to add more geojson files i can’t, i have renamed them and i make sure ..

i want to calculated the distance from a point to the nearest edge of a polygon.the code posted below show how i calculated the distance.the distance i am getting from poly.boundary.distance(pt) is NOT similar to the distance i am getting from postgis. the results from postgis is more reasonable and correct.in the result section below ..

I have a Geopandas df ‘districts’ of all districts in Paris and a shapley point object ‘eiffel_tower’ of the Eiffel Tower. When I execute mask=districts.contains(eiffel_tower) districts[mask] I get an empty output. What could be wrong? TIA Sheri Source: Python..

I’ve been using Python, Shapely, Numpy and Geopandas to generate a dot density map. The dot density map points have different colors according to ethnicity, so it allows for understanding overall city demographics. I’ve been using some code similar to the function found in this answer to generate points that fall within a polygon. The ..

Is there a built-in function for dividing a polygon without using another polygon or linestring? Simply by dividing the polygon on itself into n parts of approximately equivalent area. An idea would be to transform the polygon into a linestrings and to get the interpolation points of these lines for example with: def get_linesegments(line, n): ..

## Recent Comments