geopandas

Sort station names after countries and save them as csv

Sort station names after countries and save them as csv Question: How can I sort a list of geographical coordinates into different lists based on the country and save each list as a separate CSV file? Koforidua_ANUC,6.109N,0.302W Kuching,1.491N,110.349E Kuopio,62.892N,27.634E Kuwait_University,29.325N,47.971E Edit: The comments from tripleee were helpful Is it possible to add regional mountain ranges …

Total answers: 1

Automatically set outline and fill color based on GeoJSON properties with geopandas

Automatically set outline and fill color based on GeoJSON properties with geopandas Question: I am making a program that retrieves GeoJSON data from past convective outlooks from the Storm Prediction Center (SPC) and plot it using geopandas. With my current code, it is able to plot outlooks correctly onto a map. However, the coloring isn’t …

Total answers: 1

How to extract coordinates falling in a bbox from a geopandas data frame?

How to extract coordinates falling in a bbox from a geopandas data frame? Question: I have a geopandas dataframe with coordinates and long with data frame I have a bbox. Now I want to apply the bbox on the data frame and extract the coordinates that’s falling in that bbox. I tried using gpd.clip to …

Total answers: 2

Getting "AttributeError: module 'shapely.geos' has no attribute 'lgeos'"

Getting "AttributeError: module 'shapely.geos' has no attribute 'lgeos'" Question: I am trying to do this exercise from momepy (https://github.com/pysal/momepy/blob/main/docs/user_guide/getting_started.ipynb), but on the third codeblock f, ax = plt.subplots(figsize=(10, 10)) buildings.plot(ax=ax) ax.set_axis_off() plt.show() I got the following error AttributeError Traceback (most recent call last) Cell In[12], line 5 1 buildings = gpd.read_file(momepy.datasets.get_path(‘bubenec’), 2 layer=’buildings’) 4 f, …

Total answers: 1

How to create polygon from bbox data in python?

How to create polygon from bbox data in python? Question: I have created a code in R which extracts bbox from a list of points and then creates a polygon using st_as_sfc. Now I am trying to do the same in python where I was able to get the bbox coordinates from the list of …

Total answers: 2

Find point where touching geometries touch each other

Find point where touching geometries touch each other Question: I have a GeoDataFrame with LineStrings and want to get all coordinates where the Geometries touch each other. I can find the ones who touch each other so far but how do I get the coordinates of the touching point? It should be as fast as …

Total answers: 1

GeoPandas: Apply function to row multiple time

GeoPandas: Apply function to row multiple time Question: I have a GeoDataFrame with the following columns. The column node_location is a dictionary of OSM node IDs with the corresponding coordinates. { "geometry": LineString(LINESTRING (8.6320625 49.3500941, 8.632062 49.3501782)), "node_locations": {75539413: {"lat": 52.5749342, "lon": 13.3008981}, 75539407: {"lat": 52.5746156, "lon": 13.3029441}, 75539412: {"lat": 52.5751579, "lon": 13.3012622} … } …

Total answers: 1

Getting address with geopy takes too long

Getting address with geopy takes too long Question: In the context of a project, I have hydrated 1.6 million tweets, i.e retrieved the metadata associated with the tweets such as date of creation, and location. My tweet dataset contains tweets from all over the world, however, I am only interested in tweets created in the …

Total answers: 1

trying to merge 2 GeoDataFrames with sjoin and ran for infinity

trying to merge 2 GeoDataFrames with sjoin and ran for infinity Question: I have 2 geopandas dataframe gdfTraffic_df – contains polygon in geometry column num of rows = 1,916,560 gdfAlerts_df – contains point in geometry column num of rows = 632,259 im trying to merge the 2 geodataframe to a new df that give me …

Total answers: 2