4
votes
Accepted
WFS output limited to 1000
Check the service capabilities https://geoservices.noord-holland.nl/ags/services/oi_dataservice_alg/MapServer/WFSServer?request=GetCapabilities&service=WFS&version=2.0.0
<ows:Constraint ...
4
votes
Equivalent of PostGIS ST_LineSubstring in Python: GeoPandas/shapely or any alternatives
You can use shapely.ops.substring.
Usage:
shapely.ops.substring(geom, start_dist, end_dist[, normalized=False])
If the normalized arg is True, the distance will be interpreted as a fraction of the ...
3
votes
UserWarning: Geometry is in a geographic CRS. Results from 'buffer' are likely incorrect
You need to understand Geographic coordinate systems and Projected coordinate systems.
Geographic CRS(such as 'EPSG:4326') is not suitable for measuring distance. Converting degree to distance ...
3
votes
Accepted
Why are my area calculations in Python so small with .area()?
You can create a function to find the utm zone for the centroid of the lat, long point then project to that zone and calculate area. I think it should work worldwide
import geopandas as gpd
import utm ...
3
votes
Difference in QGIS multipart to single parts and geopandas.explode()
There is an explode tool in QGIS, too. Explode means creating a separate line (feature) for each segment - thus each line consists of just two vertices: start- and endpoint.
Single parts, however, can ...
2
votes
UserWarning: Geometry is in a geographic CRS. Results from 'buffer' are likely incorrect
Reproject your data to a coordinate system with meters as units using
to_crs. Right now you are buffering with a distance of 0.001 degrees which means the distance will not be the same depending on ...
2
votes
Looking for GeoPandas equivalents of PostGIS "ST_DumpRings" and "ST_Dump" tools
Try either
.interiors:
Returns a Series of List representing the inner rings of each polygon
in the GeoSeries.
.exterior
Returns a GeoSeries of LinearRings representing the outer boundary of
each ...
2
votes
CRS is empty but GeoDataFrame plotted correctly when reading shapefile with GeoPandas
The shapefile is a bundle of files. One of them is the .prj.
When reading a shapefile with GeoPandas and either:
.prj is an empty file
no .prj file at all
the output will be None.
So, in this case, ...
1
vote
Accepted
Encoding issue while making GeoDataFrame from shapefile using URL
This seems to be a bug in a dependency of geopandas, the fiona package.
It was discussed on github here and should be fixed on a newer release (>=1.8.21).
So try updating the fiona package and see ...
1
vote
geopandas error "OSError: could not find or load spatialindex_c-64.dll" in PyCharm using OSGeo4W paths
To get geopandas working in a OSGeo Pycharm environment you need to import qgis processing using...
from qgis import processing
then...
import geopandas
will bring in the geopandas package
EDIT ...
1
vote
GeoPandas input file to shapefile with coordinate system information
Set the CRS when you create the GeoDataframe:
gdf = gpd.GeoDataFrame(df, geometry=etc..., crs="the CRS of your xy coordinates")
Note, this requires you know the CRS your coordinates are in ...
1
vote
Accepted
Using Shapely methods (explain_validity and make_valid) on shapefile
Two above method (explain_validity and make_valid) are applicable not to the shapefile itself, but to the objects (geometries of features) that it contains.
To apply the explain_validity() method:
...
1
vote
Filter by bounding box in GeoPandas
A quick solution to this if the shape you want to clip by is a box:
from shapely.geometry import box
bbox = box(*df_sussex.total_bounds)
df_clipped = gpd.mask(df, mask=bbox)
It uses the shapely....
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
geopandas × 1203python × 859
shapely × 212
shapefile × 119
coordinate-system × 101
pandas × 89
fiona × 72
geodataframe × 70
polygon × 65
spatial-join × 55
rasterio × 55
matplotlib × 50
postgis × 45
geojson × 42
qgis × 41
python-3 × 33
geometry × 31
gdal × 29
buffer × 29
linestring × 29
intersection × 28
raster × 27
dissolve × 24
pyproj × 21
postgresql × 17