We’re rewarding the question askers & reputations are being recalculated! Read more.

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
0
votes
1answer
273 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
99 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
83 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
124 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
84 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
81 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
77 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
53 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
27 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
45 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
835 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 ...
0
votes
0answers
240 views

Can't see or load raster data in QGIS

First time install and use for QGIS, running windows 7 In QGIS browser or through project>open I can not see any raster files/data, only vector data is shown. I do see them in ArcMap. When I try to ...
0
votes
1answer
143 views

MODIS HDF file without Coordinate System?

I am using the MOD04_L2 MODIS Aerosol Deep Blue product from the LAADS API. These files are in hdf4 format, but I am transforming them to hdf5. I did transform the files because I'm unable to compile ...
1
vote
1answer
150 views

Drawing graticule with GDAL/OGR?

I'm trying to generate a graticule with user-defined range of latitude, longitude, and interval; however, my code only displays one line of latitude and one line of longitude when loading it in QGIS. ...
1
vote
1answer
100 views

GDAL retile to create near-uniform file sizes?

I have a 60Gb raster vegetation dataset. I need to be able to access single pixels relatively quickly. At the moment, I am retiling at a fixed size, and saving those, indexing them in Python, and ...
0
votes
0answers
16 views

Referencing image using GCP-file?

I'm trying to automate the actual geo-referencing in PyQgis/PyQt5. I went manually over the built-in GDAL Georeferencer in QGIS and saved a GCP-file. Also, the actual commands used for the conversion ...
0
votes
1answer
39 views

Create mean raster stack from raster stack

I am trying to create a mean stack image(1 panchromatic layer) from a stacked tiff image(13 panchromatic layers). How do i go about doing this? My code: from osgeo import gdal import numpy as np #...
1
vote
1answer
128 views

Masking areas outside of polygon using GDAL?

I am trying to "mask" raster cells that are outside of a polygon layer, setting them to "NoData". Also, I need to use GDAL, rather than R which I normally use, because the raster is too large to fit ...
2
votes
1answer
172 views

How can I display an image on QGIS from a DJI drone using python?

I have a few images from a DJI drone and I can get all of the information from the image exifread. I am trying to get an image to be displayed in the correct location on a QGIS map. Is there an ...
0
votes
0answers
281 views

How to create GeoTIFF from PNG raster and and pgw world file with GDAL

I've used GDAL tools for several other operations on GeoTIFFs. There is lots of information on how to splice geotiffs into pgw world files and images, but I havent found ANY documentation on how to ...
1
vote
1answer
272 views

Opening .vrt file with rasterio in Python?

I have 3 raster files (.tiff files) which are geographically 3 consecutive tiles of a particular area. I am trying to make a .vrt file of 2 out of these 3 files using the gdalbuildvrt python command. ...
1
vote
0answers
60 views

Making color text file using GDAL?

I have an 8-bit greyscale image that I want to convert to a "heat map" based on data values (0-255), using a color ramp. I'm aware that gdaldem works with color-relief, so I used the following steps ...
0
votes
0answers
26 views

Nearblack pixel makes all pixel value to 0

I am trying to remove the dark edges around a boundary of a Drone image. I tried to use nearblack tool of gdal. However, it turns the entire pixel value to 0. This could be because all the pixel ...
0
votes
0answers
77 views

Changing color of GeoTIFF using GDAL and Mapbox?

I have a geotiff that I am importing to a mapping software that I want in the color pink. It is currently a white image, and I would like a GDAL option to change the color. I am using Mapbox, which ...
1
vote
1answer
77 views

Blurring raster data across tile boundaries?

I have a raster dataset that is made up of 280 tiles, 51Gb total. I need to smooth/blur the data, retaining the same resolution. I would like to blur across tile boundaries, where possible, so that ...
1
vote
1answer
192 views

Open .tiff, set projection, then re-save in Python with GDAL

I am trying to set the projections of a .tiff file from another file with GDAL in Python. I successfully set the projections, but how do I re-save the .tiff afterwards? Here is my code: ds = gdal....
1
vote
1answer
36 views

Error using GDAL to Export Raster to GeoTIFF

I am correcting and cropping GeoTIFF DEM data using GDAL 2.4.0 to obtain the image raster. After doing my manipulations, I have the raster I want (checked by plotting with plt.imshow()), but while ...
0
votes
1answer
75 views

Gdal_calc outputs image with no projection

I am trying to convert a pixel value above 0.02 to be nodata. However, the output file comes out with no projection. When I assign projection, QGIS loads it in the wrong place. gdal_calc.py -A "000-...
0
votes
0answers
69 views

Missing WFS driver in gdal installation

How do I enable WFS driver in gdal? I've installed gdal from the official osgeo source in Fedora 27 using make. But running ogrinfo --formats, the WFS support is missing. It seems that the format is ...
0
votes
0answers
18 views

Installing GDAL for Python having PostgreSQL already installed

I usually install GDAL following this instructions. Part of the process is to set up the GDAL_DATA environment variable to the path of the gdal-data folder of the previosly installed GDAL. Turns out ...
2
votes
0answers
176 views

Saving osgeo.gdal.Dataset as GeoTIFF or JPEG with world files using GDAL from Python?

I am trying to take a plain JPEG with no spatial references, apply ground control points (GCPs) to it, and output a georeferenced GeoTIFF or JPEG with world files. I found some code that seemed like ...
2
votes
1answer
268 views

Iterating through every raster cell and calculating distance to other cells using Python?

I have a binary raster (.tif) in ArcGIS that shows builtup areas (value=1) and non builtup areas (value=0) like this: In order to make a proximity analysis, I need to iterate through the raster with ...
1
vote
1answer
75 views

Installing ArcGIS Desktop , QGIS and independent Python packages on same machine?

I would like to have on the same machine all my GIS software installations. Both ArcGIS Desktop and QGIS come with their own Python installations but I want another independent Python where I can play ...
1
vote
0answers
117 views

No GDAL installers for latest versions of Python?

I usually install GDAL for Python using the files in GIS Internals. Since when installing packages through pip I was made aware that Python 2.7.16 is being deprecated next year, I went ahead and ...
1
vote
0answers
247 views

DLL error in various GDAL installations

I have a couple virtual machines with Python (2.7.16 and 3.6.6 - 64 bit) with GDAL installed using GIS internals installers and using this process However when running gdalinfo --version on the shell,...
0
votes
1answer
66 views

How to keep color changes / corrections of all GeoTIFF files during merge with gdal or in QGIS?

I am trying to merge two GeoTIFF files in QGIS or w/ gdal, but when I merge them I lose the color changes / corrections I made to the second GeoTIFF. Is there any way to keep the color changes I made ...
2
votes
2answers
64 views

Commandline tool to change RGB value of GeoTIFF

I would like to change the rgb-value of raster-tiffs from 0,0,0 to 1,1,1. Is there a commandline-tool that can change the rgb-values of GeoTIFF files? At the moment I use irfanview to change the ...
0
votes
2answers
45 views

Using dictionary of file names and DD coordinates to create points in shapefile using shapely?

I'm working on a Python script that strips the GPS info from images and uses that info to create a shapefile from that info. Right now I have all the file names as keys to tuples of decimal degrees ...
0
votes
0answers
25 views

Reloading raster file using GDAL in C#?

I'm trying to build an application to read in and display raster files using GDAL and C#. The opening and reading is fine. But, if I delete the file and reopen the file again, I encounter this ...
0
votes
0answers
245 views

Convert shapefile to DXF using ogr2ogr?

I want to convert shapefile with/without EPSG Code to DXF format. I've tried following commands ogr2ogr -f DXF output.dxf -t_srs EPSG:2004 stations.shp ogr2ogr -f DXF output.dxf stations.shp But ...
1
vote
1answer
52 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 ...
0
votes
1answer
68 views

Joining a csv file to shp (ogr2ogr)

I've been trying to use a ogr2ogr -sql call to create a ESRI.shp file with the joined attributes - but it keeps on failing due to "ERROR 1 SELECT from table inshape failed, no such table/feature" ...
1
vote
0answers
44 views

GDAL open failed-4

In SPHY mdel preprocessor (modules to process) i am facing a problem of GDAL Open Failed-4 (snap is attached). What could be the reason for this problem and how to resolve this issue?
0
votes
0answers
28 views

Add PNG as a layer in Mapnik

I'm playing around with Mapnik and trying to add a PNG image over a map created from an XML file. This is my XML file: <Map background-color="white" minimum-version="0.7.2" srs="+init=epsg:3395"&...
1
vote
2answers
85 views

Problem with PostGIS ogc_fdw: unknown SRS

I am trying to connect a WFS from within PostGIS using the ogr_fdw foreign data wrapper [https://github.com/pramsey/pgsql-ogr-fdw]. With most servers this works great! With one specific server I get ...
3
votes
1answer
74 views

How to use gdal warp with modified crop_to_cutline?

I know that this question might be confusing, so I'll try my best to explain it. I have a shapefile that I will be using to clip my raster: This is my shapefile (whole island of Palawan, Philippines)...
1
vote
0answers
24 views

Unable to download Sentinal file from S3 [duplicate]

I trying below command to download file gdal_translate --config CPL_TMPDIR temp -projwin_srs "EPSG:4326" -projwin 75.576740 31.138820 75.578092 31.137444 /vsicurl/http://sentinel-s2-l1c.s3-website....
1
vote
1answer
73 views

gdal2tiles.py multithreaded only works with base tileset

I'm using GDAL 2.4.0 on Ubuntu 18.04 Installed from the ubuntugis-unstable repository. When I use the gdal2tiles.py with the '--processes=n' flag the multithreaded operation works fine for processing ...
0
votes
0answers
23 views

lat/long coordinates of the extreme points in GeoTIFF [duplicate]

I have population count data from http://sedac.ciesin.columbia.edu/data/set/gpw-v4-population-count-adjusted-to-2015-unwpp-country-totals-rev11/data-download gdalinfo <filename> outputs the ...