Skip to main content
Christoph's user avatar
Christoph's user avatar
Christoph's user avatar
Christoph
  • Member for 1 year, 2 months
  • Last seen this week
awarded
accepted
comment
Extracting linework from a GeoDataFrame
Seems to be a shapely problem: even (a := LineString(((0,0), (0,1), (1,1)))).intersection(a) results in a MultiLineString.
comment
Extracting linework from a GeoDataFrame
Thank you, this was indeed almost the solution. In order to also obtain the linework of the outer boundary, I added an additional row with geometry df.union_all().boundary to the boundary dataframe. However, many of the resulting geometries are actually MultiLineStrings. This can be fixed with a simple df.geometry = df.geometry.line_merge(), but I don't know why it is happening in the first place.
revised
Loading…
Loading…
Loading…
comment
Georeference an unreferenced image using rasterio in Python
Be aware that rasterio.transform.from_gcps tries to fit an affine linear transformation based on the GCP information. The precise transformation however, will usually not be linear. Instead of using the transform attribute of the dataset, you can store your list of GCPs in the gcps attribute to save the actual GCP information to the GeoTiff. Opening such a file with QGIS for example will then perform a more accurate reprojection based on thin plate splines.
awarded
awarded
awarded
revised
Loading…
Loading…