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

#### Category : geopandas

hi so I’m trying to import geopandas into my script import pandas as pd import geopandas as gpd from shapely.geometry import Point #handling txt #remove ‘lat=’ and ‘long=’ then type change from object to float to make point. df = pd.read_csv(‘latlong.txt’, header=None, names = [‘lat’,’long’, ‘name’,’description’]) df[‘lat’] = df[‘lat’].str.replace(‘lat=’, ”) df[‘long’] = df[‘long’].str.replace(‘long=’, ”) df[‘lat’] ..

I want to count how many points there are per Polygon # Credits of this code go to: https://stackoverflow.com/questions/69642668/the-indices-of-the-two-geoseries-are-different-understanding-indices/69644010#69644010 import pandas as pd import numpy as np import geopandas as gpd import shapely.geometry import requests # source some points and polygons # fmt: off dfp = pd.read_html("https://www.latlong.net/category/cities-235-15.html")[0] dfp = gpd.GeoDataFrame(dfp, geometry=dfp.loc[:,["Longitude", "Latitude",]].apply(shapely.geometry.Point, axis=1)) res = ..

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

I’m working in geopandas with a large number (around 4.5 million) objects, where each has a unique ID number (‘PARCEL_SPI’) and also another code (‘PC_PLANNO’). What I would like to do is write some code that, for each object, finds all other objects with the same PLANNO and adds their ID number as a list ..

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 have two dataframes, one is a GeoPandas dataframe, gdf, the other is a regular Pandas dataframe, scores. I’ve provided a look at both below. In[35]: gdf.head() Out[35]: TYPE TILE SHADOW geometry 0 DOWNED AA-55 N LINESTRING (-10393395.743 3537714.885, -103933… 1 DOWNED AA-58 Y LINESTRING (-10393417.905 3536848.899, -103934… 2 DOWNED AA-64 N LINESTRING (-10393362.034 3534592.812, ..

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

Suppose I have dataframe A which consists of two columns : geometry ( point) and also hour. dataframe B also consists of geometry(shape) and hour. I am familiar with standard sjoin . What I want to do is to make sjoin link rows from the two tables only when the hours are the same. In ..

I have a requirement to get higher precision geohashes of a lower precision geohash in efficient way (instead of converting to lon lat and then encode again ). I have found solution in other way where higher precision geohashes convert to lower precision geohash boxes. What I am trying to do out of above is ..

## Recent Comments