All Questions
1,068 questions
3
votes
1
answer
2k
views
gdal_grid problem reading vrt file
I am trying to parse csv file and visualize it as geotiff using gdal_grid but I keep getting this error:
C:\work\testgdal1>gdal_grid -ot Float32 -l test test.vrt dona.tif
ERROR 1: Failed to ...
3
votes
1
answer
2k
views
NED (NAVD88) to WGS84 heights
I need to convert the 1/3 arc second DEM files from the NED into WGS84 ellipsoid heights. The documentation says that the NED is referenced to NAVD88. I've tried using gdalwarp as follows:
gdalwarp ...
3
votes
1
answer
844
views
Convert GDAL command line commands to Python script or code
I'm looking to convert my GDAL commands to Python code using either GDAL or Rasterio, as I've heard this is better to use.
I've been scratching my head at this and I could be missing some simple ...
3
votes
1
answer
2k
views
RGB composite of Landsat 8 bands not plotting correctly (Python, GDAL)
I am trying to create a natural color (RGB) image from Landsat 8 data (11 bands). Bands 4, 3, 2, correspond to red, green, blue respectively. When I stack them, however, the images i am getting are ...
3
votes
1
answer
988
views
Changing the Map Projection of a DEM File using gdalwarp?
I have downloaded the moons dem from: https://astrogeology.usgs.gov/search/details/Moon/LRO/LOLA/Lunar_LRO_LOLA_Global_LDEM_118m_Mar2014/cub
I want to change the projection to create a new ...
3
votes
2
answers
1k
views
Using QGIS Python interpreter outside QGIS
I'm writing a simple Python Geoprocessing script which leverages two specific modules:
from osgeo import gdal
import pyproj
The script must be shared with colleagues in my organisation.To avoid ...
3
votes
1
answer
603
views
Export a list of invalid geometries using Python
Is there a way to export a list of layers containing invalid geometry (e.g. self-intersections) via Python?
Our GIS server contains over 40,000 layers, some of which have all sorts of errors that ...
3
votes
1
answer
1k
views
Create rectified GeoTIFF given aux.xml produced from ArcGIS
I'm trying to create the rectified GeoTIFF image, given a raster TIFF image and aux.xml file generated from ArcGIS. The aux.xml contains information about the mapping from raster TIFF image to the ...
3
votes
2
answers
5k
views
How can I use GDAL to batch define a projection?
I have a fodler with 1500 ECW rasters, no spatial reference information defined. Can I use GDAL to batch define a projection for all 1500 in the folder?
3
votes
1
answer
2k
views
ogrinfo - specify what information you want returned
I am using ogrinfo to find out information about a shapefile
ogrinfo -so -al 'C:/test/test_shapefile.shp'
This obviously gives me a large summary, but I'm wondering is there any way to specify that I ...
3
votes
1
answer
964
views
Cannot access LibKML driver using OGR in Python
I am trying to read a kmz file using OGR in Python. I believe the standard driver for reading .kmz files is LibKML (Can ogr2ogr read .kmz files? How?), but I am only getting None when I am building ...
3
votes
3
answers
2k
views
gdal_merge.py not properly assigning NoData values
I am trying to create a 4-band raster image using gdal_merge.py but only the first band is getting the correct no data values assigned, according to ArcGIS and PCI. Here is my command:
gdal_merge.py -...
3
votes
3
answers
15k
views
Convert Lambert Conformal Conic to WGS84
I am trying to convert my "Lambert Conformal Conic map with 2 standard parallels" to the basic/standard WGS84 projection that Google Maps use.
I have 30 of these maps which I need to convert. They ...
3
votes
2
answers
2k
views
GDAL version in QGIS
When calling GdalUtils.version(), the returned information is
"2010100"
While I can identify GDAL2, I´m unsure about the next version steps. It could be 2.1.1 or 2.0.1 or 2.1.1.
Currently, the ...
3
votes
1
answer
2k
views
GDAL bindings problem with ArcMap 10.1 Python tool
I'm really getting mad with this. ArcGIS sometimes can be so just...irritating!
Forgive me if this question is by any means duplicating this one or similar ones, but I really can't find my way out of ...
3
votes
1
answer
2k
views
Unable to perform zonal stats in python because of Attribute Error
I am trying to carry out a simple zonal statistics task in python, and am having trouble getting this to work.
I have a raster layer (in black/grayscale) and a roads polygons layer (in green, actually ...
3
votes
2
answers
3k
views
Conditional statement in gdal calc
I have this statement working in arcpy but I want this to implement in gdal, especially with gdal_calc, if possible.
Rastercalc = Con(((C-B) > 2) & (B > 100), A, Con(((A-D)>15) & ((A-...
3
votes
2
answers
5k
views
Creating point shapefile from GeoTIFF using GDAL/OGR?
I have a 0.05 deg global maps (~8000 files) in GeoTiff format. It's a kind of a mask containig "1" and "0". I need to create a point shapefile for each raster with points located over "1" values of ...
3
votes
0
answers
302
views
qgis 2.8.1 - processing gdal 1.11.2 error (mac, 10.10.2)
i've just recently installed qgis 2.8.1 on my mac.
including all relevant packages from kyngchaos - i.e. GDAL Complete 1.11 framework package, Matplotlib Python module, numpy - and updated python to 2....
3
votes
4
answers
2k
views
Buffering pixels in an array- python
Is there a way in SciPy or NumPy to buffer values in an array?
I have several rasters that I read as arrays using gdal to do some math/masking and then I write the final array back to geoTIFF. One of ...
3
votes
2
answers
744
views
GeoServer changing raster color as scale changes
I have a Sentinel-2 image published on my GeoServer.
When I preview the layer, I can see it changes coloring somehow as I zoom in / out.
You can see examples in images below (look at the scale values ...
3
votes
1
answer
3k
views
Determining the Unit of Spatial Resolution of a raster image in Python
I have some raster images, and I would like to determine the GSD using Python.
I know that I can use rasterio.transform() or gdal.GetGeoTransform() to extract the spatial resolution of the image.
...
3
votes
2
answers
1k
views
GDAL Conversion of US Topo GeoPDFs
I've used GDAL_translate with "--config GDAL_PDF_LAYERS" option to convert US Topo GeoPDFs to GeoTIFF and it works great for creating collarless topos based on the new format.
However, I can't get it ...
3
votes
1
answer
3k
views
Rotating rasters using GDAL Geotransform (and ArcGIS Desktop)?
I am working on a GDAL driver for a proprietary grid-format. In some cases, the grids are rotated in order to get smaller file sizes. In my GDAL geotransform array, I do the following (showing a ...
3
votes
1
answer
1k
views
GDAL Python API - statistics valid percent information
I would like to know if the STATISTICS_VALID_PERCENT (percentage of valid (not nodata) pixels) information is accessible through the GDAL Python API?
It seems to be missing from the GetStatistics ...
3
votes
1
answer
657
views
QGIS processing script: No raster output from gdalogr:translate and gdalogr:cliprasterbyextent
When I import the following processing script in the QGIS Python console it does not give any error and even displays ("Executing algorithm xy").
However the output file is not generated. Does anyone ...
2
votes
1
answer
573
views
How can I modify a VRTRasterBand sub-class,etc from Python?
I am using GDAL to merge a series of overlapping rasters using Pixel Functions to combine the color bands. As a proof-of-concept, my approach has been to create a VRT, and then to modify it in a text ...
2
votes
1
answer
188
views
Which architecture to adopt when working with tile layers and Cartesian coordinates?
I'm currently working on a webmapping application dedicated to warehouse management. Where data is based on indoor geolocation and Cartesian coordinates system.
More precisely, the map background is ...
2
votes
1
answer
4k
views
GDAL: Raster Intersection
I have two raster layers.
(A) is state-sized, 30m.
(B) is county-sized, 3m.
I'd like to get a new raster (C) which is the part of (A) which coincides with (B), preferably scaled to the same ...
2
votes
1
answer
1k
views
ogr2ogr update failing to update shapefile int PostGIS
I have a bunch of shapefiles that I am looping in with a bash script to load and update files but the ogr2ogr fails. I am running gdal 1.92 on ubuntu 14.04.
for file in `ls *.shp`;do ogr2ogr -...
2
votes
1
answer
1k
views
Converting CIB data to Google Tiles with GDAL
I'm trying to convert CIB map data into Google compatible Tiles through the following process (in Linux, GDAL compiled from source):
gdalbuildvrt data.vrt A.TOC
gdal_translate -of VRT -expand rgba ...
2
votes
1
answer
195
views
Shifting extent and data values of NetCDF with GDAL
I am processing OSCAR third-degree ocean currents data from:
https://podaac.jpl.nasa.gov/dataset/OSCAR_L4_OC_third-deg
These are netCDF files. Longitude extends from 20 E to 420 E to avoid a break ...
2
votes
1
answer
288
views
Implement r.cross / ArcGIS Combine with GDAL
I am using GDAL to process a lot of rasters. I then need to combine all the arrays to create a single output raster that represents all the unique combinations of values.
I.E the same thing as r....
2
votes
1
answer
1k
views
Get data from a raster using two coordinate arrays with Python
I'm trying to find a function in Python, that given two arrays with geographic coordinates, returns a list or array of raster values in those positions. that is to say:
import numpy as np
""&...
2
votes
1
answer
5k
views
Polygonize raster file according to band values?
I want to polygonize a raster by using GDAL in python. I found this webpage:
Polygonize a Raster Band. But it creates a polygon feature layer. I want every band with the same value to create one ...
2
votes
1
answer
2k
views
Building GDAL for iOS
I am interested in building GDAL for iOS. I have managed to build successfully for macOS by building from sources with:
./configure --with-python=python3 --with-proj=/usr/local/Cellar/proj/7.0.1 --...
2
votes
1
answer
795
views
gdal_translate GeoTIFF to KMZ results in transparent image
I know this has been asked before but I have tried just about every post I've found and nothing seems to work.
I have a GeoTIFF where areas outside the dataset have been set to nodata
When I open the ...
2
votes
1
answer
2k
views
Read RAT (raster attribute table) using GDAL or other python libraries?
Referring to this post, is there any update on the reason why GDAL function band.GetDefaultRAT() always returns NoneType? I can't find much documentation.
I've tried to create a RAT for testing (...
2
votes
1
answer
1k
views
Applying coordinate systems and projections to unprojected images
I have a folder with many unprojected images (i.e. LocX_1_LocY_1.tiff to LocX_32_LocY_32.tiff) which have a naming convention that is associated with a text file that has surveyed locations of the ...
2
votes
1
answer
725
views
Inconsistencies in features count retrieved while consuming a WFS webservice
GDAL approach
I'm retrieving data using GDAL with the following
ogr2ogr -f GeoJSON basol.geojson \
--config OGR_WFS_PAGING_ALLOWED ON \
--config OGR_WFS_PAGE_SIZE 800 \
--...
2
votes
2
answers
865
views
Saving LAZ files to different location from input (LAS) files? [duplicate]
All of the command line examples I'm seeing show how to create LAZ files in the same folder as the LAS files, e.g.:
C:\Folder\tools>laszip F:\Folder\LAS_points\*.las
Unfortunately, I don't have ...
2
votes
0
answers
527
views
Preserve GCP's after gdalwarp
I'm trying to figure out how I can preserve my GCP's after a gdalwarp. I need the georeferenced GCP's data, so I can calculate the Root Mean Squared Error.
Is there a way to preserve this data, and ...
2
votes
2
answers
732
views
Problem with contour lines thickness in bigger zoom levels
I'm a beginner user of GDAL tools. I'd like to rasterize contour lines into Tiff file (for example such region: N47E006), everything works for quite small zoom levels e.g. 10... but the problem is ...
2
votes
1
answer
375
views
Convert gnomonic projection to Mercator
I'm trying for some time to convert a weather radar map (gnomonical projection) to mercator (EPSG_3395) and then layout it onto third-party web map so far unsuccessfully.
The original image:
The ...
2
votes
2
answers
2k
views
Accessing GeoTransform array from gdal on the Windows command line
I'm using the gdal library via OSGeo for Windows, and I was just wondering how to access the geotransform array for a .ecw file?
2
votes
1
answer
767
views
MapServer ESRI personal geodabase.mdb
I'm trying to read ESRI personal geodabase.mdb through OGR. I have my driver "PGeo" but when I write
ogrinfo INFLOR090812.mdb
I have this bug:
ERROR 1: Unable to initialize ODBC connection to ...
2
votes
1
answer
4k
views
Vector to Raster using GDAL (gdal.RasterizeLayer) : Error in Output Raster(generating output raster with NAN values)
For rasterizing a vector layer, I have tried gdal.RasterizeLayer method for converting vector(shapefile) to raster(tiff). But its giving raster output with NAN values(complete black image). I need ...
2
votes
1
answer
1k
views
Finding lat/lon of corners of geotiff file
I just recently managed to turn a GeoTIFF file into a .bmp file using gdal_translate. Now I need to find the latitude/longitude coordinates of the corners. I would prefer to use more of the gdal ...
2
votes
1
answer
1k
views
Converting a netCDF4 file to (georeferenced) GeoTIFF, problems with georeferencing
Let's assume a netCDF4 (.nc) file downloaded from https://s5phub.copernicus.eu/dhus/odata/v1/Products('e6e91b26-ca43-43d4-9c08-c9c14dd6737e')/$value . This is sulphur dioxide measurement dataset over ...
2
votes
1
answer
582
views
Reprojecting raster changes pixel scale (makes it darker)
I have an HH polarised SAR image as follows:
This is how it looks in QGIS in the default EPSG:4326 projection.
Now I would like to reproject this raster to ESRI:102020 (South Pole Lambert Azimuthal ...