All Questions
1,804 questions with no upvoted or accepted answers
9
votes
2
answers
3k
views
Adding support to Esri's FileGDB driver when fiona/gdal/osgeo were installed through Anaconda
Is there a way to tweak the fiona/gdal/osgeo packages installed through Anaconda so that they can be used to read/write GDB files using the ESRI FileGDB driver? The main thing I'm actually trying to ...
8
votes
0
answers
470
views
OGR failing to unpack polygons and respective holes from shapefile
I'm trying to unpack shapefiles in Python (v3.7.4) using the GDAL-OGR library (v2.3.3). Each shapefile has only one feature containing multiple polygons with holes. They cannot be produced differently....
8
votes
0
answers
676
views
GDAL contour line generation at DEM edges
In a Python application I use gdal.ContourGenerate() to generate contour lines (GDAL version 1.11.4 and 2.2.1) from DTED tiles. DTED tiles overlap at the top and the right with neighboring tiles.
...
8
votes
0
answers
1k
views
Fuller/Dymaxion in proj4/gdal/qgis?
I know this question has been asked a million times already, but I can't find many detailed responses on exactly what I want to do.
As far as I can tell, the full C code for the fuller projection is ...
8
votes
0
answers
2k
views
GDAL RasterIO performance in C++ vs ReadAsArray in python/numpy
I'm currently writing optimisations for a raster viewer program which uses gdal as it's base. It's currently written purely in python, and has some major speed issues which cause problems when we are ...
7
votes
0
answers
118
views
Finding geodesically flat regions in DEM data
I'm interested to find regions in some DEM data for Earth that are what I call geodesically flat, i.e. flat in the way that the path light travels is flat in the absence of strong gravitational fields....
7
votes
0
answers
1k
views
R sf package - link to GDAL
Is it possible to ask R {sf} package to use a GDAL installation I prefer?
So far I found how to check external software it uses:
library(sf)
sf_extSoftVersion()
# GEOS GDAL ...
7
votes
0
answers
482
views
How do I get the maximum value of raster cells ignoring nodata with gdal_calc?
I have two integer rasters, A and B, with the same dimensions and cell sizes. I want to compare each cell in A with each cell in B and keep the maximum value. In cases where both have nodata, I want ...
7
votes
0
answers
4k
views
What is the fastest version of gdal2tiles?
I have multi-CPU linux server, so I wonder what is the fastest parallel version of gdal2tiles.py ?
My Ubuntu version:
lsb_release -a
Description: Ubuntu 12.04.5 LTS
How I install the package:
...
7
votes
1
answer
353
views
Different results from GDAL raster attribute table command on mac and windows
I am trying to get the raster attribute table of the following file:
Shift_cult_past_current_prediction_20160107_gr1DD.tif available here: https://www.dropbox.com/s/fmomfpro3j6dmz8/...
7
votes
0
answers
1k
views
Gdal and module import error when creating an .exe application with pyinstaller
I’ve been struggling since three days in a row to create a windows executable application from my python application. I have managed to get results but I’m not at all satisfied with the workarounds I ...
7
votes
1
answer
3k
views
Uploading raster format (*.tif) to PostGIS through raster2pgsql
I'm new to PostGIS and raster file format. I'm currently working on NetCDF files and I want to import them into PostGIS through curl command line tool but its failed for me. So I jumped on to GDAL v1....
6
votes
1
answer
696
views
Installing GDAL with MrSID fails on Ubuntu
I'm trying to install GDAL from source on Ubuntu or CentoOS both, but it fails both times. I also tried GDAL 3.0 which did the same thing.
Is there any way easily get GDAL working with MrSID? I can ...
6
votes
0
answers
2k
views
Exporting QGIS Atlas using PyQGIS (qgis.core)
Windows 10, PyCharm, QGIS 3.10 installed via osgeo4w (64bit).
I set up a simple QGIS composer layout with a vector layer and a WMS base map on the map layout. The vector layer contains about 10 ...
6
votes
0
answers
222
views
Telling gdal_polygonize.py how to interpret colors / what does the `DN` field mean
I have lots of raster files I am converting to polys with gdal_polygonize.py. All these images have a consistent palette which I'd like to map to an attribute in the resulting polygons.
On most ...
6
votes
1
answer
5k
views
How to fix rasterio error: The EPSG code is unknown. Unable to open EPSG support file gcs.csv
I try to open a jp2 image with the Python's Rasterio package. The code is below. The problem is that the coordinate reference system is not recognised and when I want to see the meta attribute of the ...
6
votes
0
answers
461
views
Finding Raster Pixel Neighbors using GDAL?
I'm new to GDAL Python, and I'm working on a little recursive algorithm which requires finding the neighbors of a a pixel on a DEM raster. I've been able to do this by creating a little PixelLite ...
6
votes
0
answers
413
views
Adjusting georeferencing of GeoTIFF?
I have three thermal IR images of a boat acquired by a drone as it flew overhead. The images were taken at one second intervals, are GeoTIFF files and overlap one another. I don't know exactly how the ...
6
votes
0
answers
570
views
When should I use gdal_merge.py?
When building a single georeferenced image from a collection of tiles, gdalbuildvrt followed by gdal_translate is much faster than gdal_merge.py.
In my own measurements of
gdal_merge.py \
--...
6
votes
0
answers
877
views
Disable readdir on open in gdal_translate when using /vsicurl/
I'm using /vsicurl/ file handler to read Landsat 8 data out of S3. Following GDAL documentation "to minimize the total number of HTTP requests outside of the target GeoTIFF file" I set ...
6
votes
0
answers
1k
views
netCDF has wrong spatial extent in metadata
I have a netCDF file with spatial data ranging from x:528500 573500 y:350500 399500 on EPSG: 31287. If I open and explore the file with Panoply and show the data on a map all works like it should.
...
6
votes
0
answers
234
views
Gdal Python problem: black strips in image translation
I have a 500 x 500 m resolution world map of clumping index data (He et al., 2012) and I am trying to do two things at the same time: 1) to isolate the variables per plant functional type following ...
6
votes
0
answers
649
views
How to use GDAL Correlator?
I need to align several images using FOSS. There is Correlator tool in GDAL (source) that seems to be suitable for the job. But I was unable to find documentation for it or a tutorial. Can someone ...
6
votes
0
answers
1k
views
How to set Vertical Coordinate system when creating a 3D shapefile?
I'm working with GDAL v1.11 and am seeing the vertical CS stripped when exporting a 3D shapefile (from oracle spatial). This is the command I'm running:
ogr2ogr -f "ESRI Shapefile" B_POINT.shp (...
5
votes
1
answer
3k
views
ogr2ogr errors: PROJ: proj_create no database context specified, cannot prase CRS, proj.db lacks database.layout.version.major/minor metadata etc
I have a PostgreSQL/PostGIS database that I have been working on and it's generated in a docker container. I access it via PGAdmin to the docker DB or sometimes I create a backup and restore locally ...
5
votes
0
answers
512
views
Reproject WGS84 raster file to topocentric LTP-ENU using GDAL with a custom proj string
I have some raster files which are given in WGS84. As an example, here are some gdalinfo for one of those:
Driver: GTiff/GeoTIFF
Files: dem_r.tif
Size is 2000, 911
Coordinate System is:
GEOGCRS["...
5
votes
0
answers
462
views
ogr2ogr creates too many columns with LEFT JOIN
I am creating a GeoPackage using several shapefiles using ogr2ogr (GDAL 2.2.4):
ogr2ogr -f GPKG /path/to/out.gpkg -append -nln out -a_srs EPSG:4326 /path/to/in1.shp
ogr2ogr -f GPKG /path/to/out.gpkg -...
5
votes
0
answers
6k
views
Object of Wrong GDALDatasetShadow Error
I am trying to crop the TIF images based on the shape file. After searching the web, I found the following code and manipulated it.
from osgeo import gdal
import os
input_path = '/.../pics'
...
5
votes
1
answer
545
views
Optimizing pixel extraction from GeoTiff using Python
I am creating IDF Curves for work using python and 30-minute rainfall rate rasters. There are 24 rasters per day and about two decades worth of data. I basically input lat/lon coordinates and my ...
5
votes
0
answers
677
views
Resample a raster to the grid of another unaligned raster using GDAL/pktools
Is there a way to resample a raster to the grid of another raster using Bash utilities (GDAL or pktools), if both of the rasters do not necessarily have their origins aligned (and without an ...
5
votes
0
answers
3k
views
"Clip Raster by Mask Layer" produces zero values (and not Nodata) outside mask boundaries
This is my first question here. I have a big raster of the world's nighttime lights and want to clip it down to the Adm0 of a country:
In order to do so, in QGIS 2.18 what I do is using the Clipper ...
5
votes
1
answer
1k
views
Merging many rasters with Python script within QGIS using GDAL?
I have many rasters that im trying to combine in order to produce contours. They are in the .bil format so I understand that i need to translate them using gdal first but none of my attempts have ...
5
votes
0
answers
536
views
Run GDAL on android and perform operations
Could one run gdal on android devices to perform some GIS operation, like viewshed, contours, etc?
5
votes
0
answers
2k
views
How to install filegdb driver with GDAL in linux?
I have been working on GDAL with windows platform but now I require to shift to linux.
I have installed GDAL using
apt-get install gdal-bin libgdal-dev
pip3 install GDAL
Now i require support for ...
5
votes
0
answers
961
views
gdal_translate slightly changes output pixel values
I have used this batch script
for /r %%g in (*.jp2) do gdal_translate -co COMPRESS=LZW -co
NUM_THREADS=ALL_CPUS %%g %%~dpng.tif
to recursively convert all my .jp2 files in .tif files. However, the ...
5
votes
0
answers
2k
views
How to perform spatial join and obtain attribute in python/GDAL?
I am working on a script that will take an unprojected raster, and using a UTM grid (shapefile), will obtain the correct SRS (I have a shapefile where each zone is attributed with its numerical SRS) ...
5
votes
0
answers
887
views
Install OSGeo module in virtualenv
How can you install the osgeo module in a virtualenv? I downloaded QGIS using KyngChaos (www.kyngchaos.com/software/qgis) following https://arset.gsfc.nasa.gov/sites/default/files/land/webinars/...
5
votes
0
answers
460
views
Gdal.open crashes python for some .tif images
I just upgraded to GDAL 2.2.0 and now I'm having issues with my python kernel crashing when I run gdal.Open() on certain files that it used to work on when I had GDAL 2.1.2. It seems to only be ...
5
votes
0
answers
2k
views
Performing histogram streching using gdal_translate?
I have some rasters I want to perform histogram stretching on, and I want to use only open source tools, preferably using shell/bash command line.
I was thinking of using gdal_translate with setting -...
5
votes
0
answers
2k
views
Pansharpen Landsat 7 RGB using gdal_pansharpen.py
Is it possible to pansharpen Landsat 7 RGB band combination (without NIR) to have approximately the same intensities as the original RGB image with gdal_pansharpen.py (weighted Brovey algorithm)?
What ...
5
votes
0
answers
474
views
Can gdal be used to generate a single patch of the HEALPix projection?
Given a geo-referenced map of the world, I am able to produce a version with a HEALPix projection using gdalwarp like this:
gdalwarp -t_srs '+proj=healpix +a=1 +ellps=WGS84 +wktext' -te -3.14159265 -...
5
votes
1
answer
138
views
Determining resolution of specific image in PDF document
Can GDAL be used to determine the resolution of an image embedded inside a PDF? If not GDAL, is there another method?
I'm using gdal_translate to convert TIF+TFW files into geospatial PDF. I know ...
5
votes
0
answers
595
views
How to create tiles from c# code
I need to create tiles directly from c# code. The input file is in *.tif format. Is there a way to do this simply? I tried GDAL, but I found it complicated, I don't understand how to cut tiff into ...
5
votes
0
answers
10k
views
how to set the geotransform using GDAL in python
I am trying to create an image from a numpy array and georefenrece it so that I can import it into qgis. I have the latitude and longitude in degrees for the top left corner of the array as well as ...
5
votes
0
answers
840
views
gdal_retile.py leaving gaps in mosaic
I'm trying to create a seamless mosaic from the FAA's VFR aeronautical charts using gdal_retile.py. The end goal is to serve the mosaic using the ImagePyramid extension in GeoServer. However, I'm ...
5
votes
0
answers
2k
views
How to avoid "Unable to compute a transformation between pixel/line"?
I am trying to re-project from Equi-rectangular to the NASA global EASE grid (Equal Area Scalable Earth) grid 1383 586 with a ~25 km cylindrical projection (ESPG=3410). The file is provided as HDF5.
...
5
votes
0
answers
2k
views
How to set GDAL/cs2cs/proj to use NTv2 grid shift file when using EPSG codes?
I am using the GDAL API for Python for a script that takes only EPSG codes for inputs to specify source and target coordinate systems.
While the cs2cs command seems to handle quite well ...
4
votes
1
answer
237
views
gdalwarp sum resampling algorithm double counting at some specific resolutions
GDALWarp utility is double-counting my pixels in the sum algorithm for resampling in some cases. I don't believe it's something I'm obviously doing wrong.
I have a file, at 30 arcsecond resolution for ...
4
votes
0
answers
194
views
Using an input string in a file path for a input vector layer in QGIS model
I am building a QGIS model to perform field calculations on a large number of .shp files containing environmental information of different waterbodies. This model should be global for the different ...
4
votes
0
answers
186
views
How to specify GDAL driver to use for Processing INPUT?
How can I specify a specific driver to be used by GDAL/OGR when running a tool via Processing? GDAL/OGR calls them prefixes to the connection string, e.g. https://gdal.org/drivers/vector/gmlas.html#...