Skip to content

Tag: geopandas

Switching off all Folium tiles

I’m wondering if it’s possible to switch off all Folium tiles that have been added to a Folium Map object. By default one tile should be selected, but could be displayed a blank background? It’s an option that I thinkg could be useful to enhance the visualization of the entities that have be…

geopandas midpoint on line

I have a geopandas dataframe of linestrings. Each line string is a single line. I want to get the midpoint of the line and append the point geometry to geodataframe in a column centroid. How do I achieve this? Answer LineString has a centroid, hence case of using it solution demonstrates this with output as v…

Converting a list of coordinates to point geometry

My geopandas df looks like this: As you can see, the geometry column is a list containing longitude and latitude values. Is there an efficient way to convert them to points? This works but is very inefficient: When I put this in a loop I get TypeError: len() of unsized object Basically I need the inverse of t…

Converting Geojson information to geopandas geometry

I have geojson file like this: I would like to extract the polygon information and save as polygon geometry in a geopandas data frame. I’m having trouble converting extracting this information from the geojson I would appreciate if anyone can help Answer you can construct valid geojson from you dict sni…

geopandas known intersection returns False

I have two sets of multipolygons. I want to select one polygon from one dataset (by using the matplotlib click event which works) and then select all polygons from the second dataset that intersect with it. When I plot the datasets they clearly overlap (see below) but my intersection always returns False. The…