Questions tagged [gdal]

GDAL (Geospatial Data Abstraction Library) is an open source translator library & set of command-line utilities for processing raster spatial data formats. As a library, it presents a single abstract data model to the calling application for all supported formats. It also comes with a variety of useful commandline utilities for data translation and processing.

Filter by
Sorted by
Tagged with
2
votes
0answers
99 views

Change corner coordinates GEOTIFF

I have a geotiff and I have the corner coordinates set using gdal_translate and the a_ullr argument setting out the min/max long/lat. This provides a bounding box for the geotiff to be projected. But ...
2
votes
1answer
34 views

PostgreSQL- query a raster by XY

Windows 10, PostgreSQL 11 I successfully managed to export a .tif raster into PostgreSQL using raster2pgsql: raster2pgsql -s 27700 -I -C -M -Y "D:\Data_Location\country.tif" -F -t 50x50 public....
2
votes
2answers
22 views

Information in gdalinfo not shown

I have a geotiff and I checked it's metadata using gdalinfo.exe: Driver: GTiff/GeoTIFF Files: C:/image_test.tif Size is 3956, 34151 Coordinate System is `' GCP Projection = GEOGCS["WGS 84", ...
1
vote
1answer
42 views

Values change after re-projecting the NetCDF files to TIFF file

I am trying to re-project a NetCDF file to a uniform grid EPSG: 4326 and convert it to a TIFF file. However, after the GDAL re-projection the values in the file change, i.e. the values are not ...
2
votes
2answers
101 views

OGR: Load layer with sql statement and write to new data set

I am having difficulties after loading a shapefile with a sql statement with ogr. The layer and its features seem to be correctly loaded. Still I am not able to write them into a new shapefile or pass ...
0
votes
0answers
62 views

Fail to import gdal from conda environment?

I installed gdal from this link: http://www.gisinternals.com/query.html?content=filelist&file=release-1911-x64-gdal-3-0-0-mapserver-7-4-0.zip When I use the the following command from this ...
0
votes
0answers
160 views

How to convert Lat, Lon, Alt to ECEF and EPSG 4979?

I am programmatically generating data to use in Cesium's 3D Tile System. The data I have is in (Latitude, Longitude, Altitude) format. To display the data in Cesium, I have to first define a region to ...
3
votes
1answer
65 views

How do I combine GeoTIFF files covering the same area but storing different data into a single file?

I have shapefile cutouts (same shapefile across all images) of different GeoTIFF rasters (with different metadata and sometimes resolutions). How do I merge them into a single GeoTIFF file? I'm well ...
1
vote
0answers
71 views

What would cause a Cesium 3D-Tiles tileset to not even request it's content?

I am generating an I3DM through Python. I know that the I3DM is probably ok, since the 3d-tiles-tools allow me to extract the binary GLTF file from it. However, when I go to render the tileset in ...
0
votes
0answers
20 views

How to make sure GDAL Java binding doesn't crash my whole application?

I'm using GDAL Java binding to convert some files (ogr2ogr), such as shapefile to GeoJSON. The problem is when something goes wrong it crashes the whole application and I have to start it up again. ...
1
vote
0answers
33 views

File Size Limits with MBtiles

I'm running into an issue where my MBtiles files are exceeding the max file size for the file system when created with gdal. Is there a known method of creating a set of mbtiles files that don't ...
0
votes
0answers
50 views

Creating color relief from GeoTIFF using gdaldem returns font name

I'm trying to generate a color relief map from a SNODAS greyscale geotiff file scaled from 16-bit to 8-bit. Given the type of data and the scaling, it seems the pixel values are set at 1-5, with 5 ...
4
votes
2answers
117 views

Improving quality of tiles generated from Ordnance Survey Raster Data

I'm trying to generate some map tiles based on the Ordnance Survey Open Data (available from here). I don't have much experience with this, but I've read a few tutorials online and have managed to ...
1
vote
1answer
424 views

Store GeoTIFF with color table - Python [closed]

I have a large number of GeoTIFFs for which I would like to add and store symbology as Color table. What is the easiest way for doing that? I would like to use Python, maybe with GDAL.
3
votes
1answer
57 views

Generate a viewshed and merge it with another image using GRASS/GDAL command line? [closed]

I've found a tutorial showing exactly what I want to do (merge viewshed and hill shade or map) but unfortunately it is for QGIS users and I need it in pure command line instructions because I'm in a ...
1
vote
0answers
46 views

GDAL ZIPDecode:Decoding error [closed]

I work with large many (tens of thousands) of large (0.1-10 gigabytes) rasters in GDAL and Python and occasionally will see the following error: ERROR 1: ZIPDecode:Decoding error at scanline [XXX], ...
1
vote
2answers
24 views

How to use gdal_contour to APPEND data?

I'm trying to import contours from SRTM HGT files. First try (nice): gdal_contour -f PostgreSQL -a elevation -i 10 srtm/S01W069.hgt "PG:host=volcano-db user=postgres password=guesswhat dbname=...
0
votes
1answer
30 views

gdal FlattenTo2D makes geom null

I have a df that has geoms as ogr geom in 3D. I was trying to convert to 2D but it empties out the geom. ipdb> df['default_geom'][0] <osgeo.ogr.Geometry; proxy of <Swig Object of ...
0
votes
1answer
82 views

GDAL Calc Set Specific Values to Another Number

I have a GeoTiff raster with a format of Float32 and values 0.00 to 5.00. I am attempting to change all raster cells with a value below 0.10 to 0.10, and leave all other cells in the raster dataset ...
2
votes
0answers
28 views

HGT Elevation vs Calculated Elevation

I wondering how to interpret the elevation calculation. Per example. We are in Canada and I use SRTM3 files. I use the GDAL library to extract my elevation, everyting is ok, except: Why (or how) the ...
0
votes
1answer
89 views

Transforming a image to a shape defined by image corners in earth coordinates - Python

I have a source satellite image. It is a rectangular shape x by y. I also have the stored lon/lat coordinates of the corners and the center point in the xml meta file. Is there a way with the gdal or ...
0
votes
0answers
16 views

NDFD Grib2 geotransform

I am trying to transform the projection for my data in grib2 format to long/lat, but I'm not sure I'm using the correct EPSG. The data says it uses a "Lambert_Conformal" projection with a WGS84 ...
0
votes
0answers
103 views

Convert a raster to a polygon with gdal in command line

I want to convert a raster (agric.tif) to a polygon layer (agric.shp). I want to use gdal in command line since the QGIS (raster to polygon) seems to takes for ever (still running over an hour). I am ...
0
votes
0answers
31 views

Ouput of gdalinfo.exe --formats

I would like to get the output of the following command : gdalinfo --formats > formats.txt In Linux, it works In Windows, it works but the output is not completed. Do you know how to get the ...
0
votes
0answers
83 views

GDAL OGR Polygon.Contains(Point) returns false but point is contained in QGIS map

I'm sure I must be missing something here but for the life of me I can't see what it might be. I have been struggling for the last hour with an issue with the Contains() method in OGR. I am iterating ...
0
votes
1answer
104 views

Grib Metadata with GDAL in Python

I'm trying to use GDAL in python to conditionally select raster bands from a grib file based on the time when the weather feature was measured (think temperature). If I run GetMetadata() on the ...
0
votes
1answer
39 views

gdal_grid does not work in cron but works in terminal

I use the gdal_grid interpolation command. When I work in the terminal everything works perfectly. However, when I try to run the command in the bash script from cron then it does not work. Bash ...
1
vote
0answers
61 views

Filtering anomalous pixels from masked raster in Python?

I am struggling to succesfully filter out anomalous pixels from a Sentinel-1 image band mask (Pixel based), produced in Python. I am new to Python. By anomalies, in this situation, I mean ...
2
votes
2answers
240 views

Averaging overlapping rasters with gdal

I am working on creating a class which will merge several georeferenced rasters into one using different strategies, essentially taking average, max, min where the images are overlapping. So far I've ...
1
vote
1answer
77 views

Cropping GeoTIFF to square at specific lat/long for use as Unity 3d terrain heightmap?

I have some GeoTIFF files that contain elevation data. I have an area defined by latitude and longitude, and I would like to extract the elevation as a heightmap from the GeoTIFF files to use in Unity....
3
votes
1answer
158 views

GRASS GIS producing different slope than GDAL?

When producing a slope in GRASS GIS 7.4 the results are different than with QGIS (GDAL) and ArcMap for the same input data and same parameter (Z ratio is 1.0 and degrees). QGIS and ArcMap generate ...
2
votes
1answer
62 views

Reading large image using GDAL?

I want too read large image. The image size is 92117 x 30313 pixels. So far I know cv2.imread can not read large size. How can I read using GDAL API?
1
vote
1answer
95 views

Clipping tiff image with a bounding box with GDAL in Java

Since GDAL 2.1 GDAL and OGR utilities can be used as library functions, so this task is incredibly simple now: from osgeo import gdal ds = gdal.Open('original.tif') ds = gdal.Translate('new.tif', ds,...
1
vote
3answers
138 views

Numpy masked array to raster

I am trying to transform a masked array, result of a NETCFD4 file, to a raster. The array is saved as a masked array, with shape (500,805), and the mask is the value 32768.0. The array looks like: ...
3
votes
1answer
103 views

Seeking code behind Fix Geometries tool in QGIS?

I used the very nice "Fix Geometries" tool in the Processing Toolbox of QGIS 3.6 to repair a vector layer that was giving me trouble. The tool in QGIS worked just fine, but I was hoping to find out ...
1
vote
1answer
62 views

Invalid geometry error after polygonizing a GeoTIFF file

I wanted to clip an OSM vector layer with the boundaries of a raster image--a GeoTIFF file. I was able to polygonize the raster and obtain its boundary in a vector format. But I am getting a error ...
0
votes
0answers
49 views

gdal_translate not recognizing file format [duplicate]

I am trying to convert a .dat file to a .tif file using gdal_translate. The .dat file comes with an associated .Hdr file of the same name with the metadata (these are geospatial data from SNODAS). ...
1
vote
2answers
92 views

Installing GDAL on an ArcGIS machine?

I have ArcGIS Pro (2.3.x) installed on my PC. I have python scripts which call ArcGIS toolbox models and runs them. Everything works fine. Today I installed GDAL and Python bindings for GDAL. I also ...
0
votes
1answer
201 views

“Error 4: xxxxx.dat: not recognized as a supported file format.”

I am trying to convert a .dat file to a .tif file using gdal_translate. The .dat file comes with an associated .Hdr file of the same name with the metadata (these are geospatial data from SNODAS). ...
0
votes
1answer
84 views

Cascading union OGR Multipolygons?

I have 2 OGR Multipolygons that intersect, hence I want to cascade Union them. I tried this but it returns me empty and doesn't union it. Seems this works only on Polygons and not Mul;tipolygons. What'...
4
votes
2answers
81 views

Geopackage raster layer name is blank in QGIS Layers panel?

I added two rasters to QGIS: "site01.tif" and "site02.tif" then added them to a geopackage. When I drag the geopackage into QGIS, the geopackage layers display as expected but the layer names are ...
3
votes
1answer
102 views

Re-project GeoJSON from pixel-space to lat-long in Python

I have created a GeoJSON of linestrings in pixel space using Python. However, I now need to re-project the file to match the same projections and extent of the .tiff file I wish to layer the GeoJSON ...
1
vote
0answers
78 views

After installation of gdal (to enable PostGIS tools) on Windows, sf gives warnings about dependencies?

To get a PostgreSQL/PostGIS setup working on my Windows 10 machine I had to manually install GDAL using these instructions: https://sandbox.idre.ucla.edu/sandbox/tutorials/installing-gdal-for-windows ...
0
votes
2answers
80 views

Classify DEM pixels

I have a differential surface model dataset. That was made: DSM subtracted from DTM, so for example trees have negative height. It is a raster (TIFF) dataset, Type=Float32. I want to create a ...
0
votes
0answers
25 views

Merging two GRIB-2 files to single GRIB-2?

I have two neighboring GRIB-2 files. they cover several meteorological information layers like wind direction, wind speed, gusts speed, precipitation, etc. for a 3 days period. Their internal ...
1
vote
1answer
64 views

Trying to make calculation with gdal_calc.py?

I have a tif image that I'm trying to run gdal_calc.py. In the source file the values are between 1,118-9,704 and I want to divide all the values by 10,000 to get results between 0-1. This is the ...
2
votes
0answers
48 views

Running ogr2ogr script batchfile from SQL fails due to temporary drive mapping

I am trying to run the SQL procedure EXEC xp_CMDShell 'blahblah.bat' which needs to run an ogr2ogr script to create a kml from sql. The batch file works if I run it alone but with SQL permissions it ...
2
votes
1answer
24 views

GDAL Raster: How to obtain the cell ( and also the position) where maximum occurs?

I can obtain the maximum/minimum value of a raster via the ComputeRasterMinMax code: using (var ds = Gdal.Open(tiffFile, Access.GA_ReadOnly)) { var nCol = ds.RasterXSize; var nRow = ds....
1
vote
0answers
38 views

How to properly reorder the raster data from bottom up to top down?

When creating a raster I set the lower-left x/y values, and asc file has the following "header": ncols 1731 nrows 1863 xllcorner 17548488.944545675069 yllcorner -8069349....
3
votes
1answer
530 views

Converting NetCDF dataset array to GeoTiff using rasterio Python

I have read a NetCDF file using the netCDF4 library and then read one of its datasets ("Evapotranspiration") into a variable (variable contains array) using the following code. Subsequently now I am ...