Skip to main content

New answers tagged

0 votes

Filtering records in GeoPackage file by numeric/text fields using GeoPandas/Fiona

You can pass a SQL statement to geopandas.read_file. Something like this: import geopandas as gpd sql = f""" SELECT * FROM "test" WHERE fieldX = 'klmno' ""&...
Pieter's user avatar
  • 3,159
0 votes

Combine multiple USGS topo quads into a single seamless raster?

You can do this in a couple of steps using: Quad corner data gdalwarp - to convert/clip the GeoPDF Obtain quad corners While extracting the neatline from the map is probably ideal, but it possible ...
Tom Brennan's user avatar
  • 5,269
0 votes

Setting band 4 of raster to alpha with GDAL?

If there's someone wondering, this can be done as well for a VRT using the Python API: from osgeo import gdal ... ds: gdal.Dataset = gdal.OpenEx(product_vrt_path, gdal.GA_Update) rb: gdal.Band = ds....
Guillermo Moreno Castaño's user avatar
0 votes

How to fix rasterio error: The EPSG code is unknown. Unable to open EPSG support file gcs.csv

try: crs = CRS.from_epsg(32634) = crs
Nat Ziemecki's user avatar
0 votes

Looping through GeoPackage layers with GDAL

Sample used is available at A pure Python approach without any other deps than GDAL from osgeo import gdal gdal.UseExceptions() ...
ThomasG77's user avatar
  • 31k
0 votes

Clipping raster image using coordinates from CSV file with Python

You can clip using rasterio.mask and geopandas: import geopandas as gpd import rasterio, os from shapely import box from rasterio.mask import mask raster_file = r"/home/bera/Drives/data1/gisdata/...
Bera's user avatar
  • 74.8k
1 vote

Add Scale and Offset to VRT from python

Not all VRT elements are supported in the gdalbuildvrt command line utility or gdal.BuildVRT function. The Scale and Offset elements aren't. You could either parse the VRT XML and add those elements ...
user2856's user avatar
  • 67.2k
0 votes

ogr2ogr giving "ERROR 1: Failed connect to; Operation timed out" error?

As bendecko pointed out, this is caused by (bafflingly) trying to parse the XSD. Pass in -oo XSD=/dev/null to stop it.
Mark's user avatar
  • 101
0 votes

Removing white background from GeoTIFF in GeoServer

For those who can install GDAL, it looks like the better command to do this is nearblack (also works with white ^^). It's made especially to remove black, white or custom color border background (...
Adrien Rey-Jarthon's user avatar
0 votes

DLL error in various GDAL installations

On a related matter Can't load requested DLL with GIS Internals: gdalinfo --version ERROR 1: Can't load requested DLL: ...\gisinternals\bin\gdal\plugins\gdal_GEOR.dll 126: The specified module could ...
nmtoken's user avatar
  • 13.5k
0 votes

Working with COG in GDAL

These training videos might be useful to you. You can download 1 meter data from the USGS National Map. Select the polygon option, draw a polygon around your area of interest, select the 1 meter ...
GBG's user avatar
  • 10k
3 votes

Splitting SHP file based on property starting with an underscore

It should be valid in SQL to have field names beginning with an underscore but I have seen that sometimes they ...
user30184's user avatar
  • 67.3k
3 votes

"Latitude Grid Not Spaced Evenly" warning from NCEP-NCAR reanalysis 2m Air Temp raster

As a first comment, please consider using terra because that package has now superseded the raster package. The filename already suggests that the data is distributed on a ...
darius.goergen's user avatar
0 votes

Warning1: TIFFReadDirectory:Sum of Photometric type-related color channels

This issue is fully documented in the linked reference(, but in brief, it revolves around a mismatch ...
苏云明's user avatar

Top 50 recent answers are included