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
1answer
22 views

What do some of the parameters in gdalinfo represent?

For example, on the gdalinfo documentation, we have gdalinfo ~/openev/utm.tif Driver: GTiff/GeoTIFF Size is 512, 512 Coordinate System is: PROJCS["NAD27 / UTM zone 11N", GEOGCS["NAD27", ...
0
votes
0answers
14 views

Is there a way to get the scale of a map using gdalinfo? [on hold]

I'm completely new to GIS and using GDAL, and I was wondering if there was any way to extract the scale of a map, using information such as the Geo Transform, Corner Coordinates, WGS84 Extent, or ...
0
votes
0answers
21 views

Joining file pair for batch gdal_merge.py

I am new to Python and I have been going through past questions and searching trying to determine best way to batch mosaic files. I have a list of .tifs that have been converted from .hdf files I am ...
0
votes
0answers
6 views

gdal_retile.py killed when dealing with large .vrt + pixel function

I have to retile about 100,000 images of size about 2667x2667 pixels for geoserver. The source images' nodata area were badly damaged due to compression so I decided to use VRT pixel function max to ...
0
votes
1answer
24 views

Opening .Jp2 image in QGIS on Mac?

I am trying to open a Jp2 file in QGIS 3.4.5 on a macOS 10.14.5 Mojave. I am new to QGIS and have been looking through forums that discuss GRASS and GDAL but I don't understand the connection to QGIS....
0
votes
0answers
6 views

Initialize spatial_ref_sys table in MySQL 5.7

Using MySQL 5.7 for a spatial application and kind of baffled as to why there doesn't seem to be any nice way to prepopulate spatial_ref_sys. Isn't there any premade SQL script out there to fill the ...
0
votes
2answers
26 views

Invalid geometry after gdal.polygonize

After converting a raster file to a vector file using gdal.polygonize, I cannot carry out further commands (e.g. Clip) because the vector is produced with invalid geometries (as determined by the QGIS ...
0
votes
0answers
22 views

gdal_rasterized failed in terminal

I have this command: gdal_rasterize -l training -a "MC_ID" -ts 3473 4075 -te 42.4132272 -85.3704013 42.41419 -85.3692901 -ot Float32 -of GTiff "training.shp" "training_rasterized2.tif" What I am ...
0
votes
1answer
29 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 ...
0
votes
0answers
50 views

Clipping raster by feature using GDAL in QGIS?

I have successfully selected the feature from a shapefile (boundary) and intend to use this as a mask to clip the raster map underneath. However, having followed instructions when I open the GDAL > ...
0
votes
0answers
36 views

Hacks to make Python scripts faster? [closed]

I've got a GDAL/OGR-based Python script that's drawing buffers around roads. In any particular area, it goes road by road (feature by feature) drawing a buffer around a road, and appends that road's ...
0
votes
1answer
19 views

GDAL NULL Path Value On Production Server

I am using c# and visual studio. I have an app using GDAL that works perfectly on the Dev Server. When I transfer it to Production the app fails. I receive the following error message: An error ...
1
vote
1answer
14 views

ogr2ogr MSSQLSpatial truncating attribute fields

I have a Shapefile with a number of attribute fields defined in its corresponding .dbf file. I am trying to transfer this data to an Azure SQL Server DB using the following command: ogr2ogr -f ...
0
votes
0answers
43 views

Obtaining geographic coordinates of satellite images using Python? [closed]

Using a satellite image of a band it is possible to obtain the geographic coordinates and the value of the color in a matrix. I just obtained an array using GDAL but it just represents the colors of ...
0
votes
0answers
24 views

Unsupervised classification using Python? [duplicate]

Is there a way to use unsupervised classification with satellite images to determine similar regions using python with gdal or with any library?
1
vote
0answers
29 views

Gdalwarp orthorectification WorldView-3 not using RPC projection properly

I have a high-resolution WorldView-3 image that I am trying to orthorectify using gdalwarp -rpc -to "RPC_DEM=dem.tif" input.tif output.tif However the output is not aligned with Bing or Google maps ...
2
votes
0answers
26 views

GDAL Warp Memory Datasource as Cutline

I am attempting to use a memory vector to crop a raster using GDAL warp but I get the following error: ERROR 1: Cannot open <osgeo.ogr.DataSource; proxy of <Swig Object of type '...
0
votes
1answer
32 views

Offset in GeoTIFF coordinates Google Earth Engine extracts

I download a certain geographic location (lon,lat) with buffer radius around for MODIS products, such as MCD43A2/MCD43A4 from Google Earth Engine using ee, such as: lon = 10.452175 lat = 51.079206 ...
1
vote
0answers
17 views

Correct syntax for specifying multiple Layer Creation Options in ogr2ogr

I am trying to run a GDAL 300 command line command to convert a file to GeoJSONSeq, projecting output using ESRI:102008 (Albers North America), using a SQL query to choose and rename some columns, and ...
0
votes
0answers
22 views

Possible to import current version (v2) of the SQL Server Spatial binary format with QGIS/GDAL?

I'm running QGIS 3.4.3 on a Windows 10 machine and when loading vector layers from our MS SQL Server version 12 everything seems to be working great. No problems connecting or visualizing the data. ...
0
votes
0answers
19 views

Creating virtual tiles of raster in Python?

I have a large raster and want to analyze it on smaller subsets but also want to save space so I am trying to avoid actually tiling the raster. Is there a way to make virtual tiles that python can ...
0
votes
0answers
19 views

Unable to merge rasters: ImportError: DLL load failed: The specified module could not be found [closed]

I have recently come across an issue that I can't figure out how to solve. I am trying to merge two rasters (which I have previously done successfully on QGIS 3.4) however I keep getting this error ...
2
votes
1answer
42 views

How to change the field value of a specific feature in a Shapefile using GDAL/OGR?

I am trying to change the field value of a shapefile, but only in some specific features. However the code I have changes the value for all features in the shapefile. Is there any way of accessing the ...
3
votes
0answers
45 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 ...
1
vote
0answers
44 views

Unable to import GDAL in Python 3.7 [closed]

I have installed GDAL using conda and it installed successfully. But when I try import gdal in jupyter notebook, it is showing this error. -----------------------------------------------------------...
2
votes
1answer
41 views

How to make 'gdalUtils' package in R to use GDAL installed in OSGeo's directory instead of QGIS's directory

I have GDAL installed through QGIS and OSGeo in the directories: C:\Program Files\QGIS 3.6\bin\gdalinfo.exe C:\OSGeo4W64\bin\gdalinfo.exe My gdalUtils package uses GDAL installed in QGIS and I want ...
1
vote
0answers
19 views

Get maximum value from two raster using gdal_calc.py with option Ignore NoData calculation enabled

I would like to get maximum value from two raster using gdal_calc.py with option Ignore NoData calculation enabled. My question is similar to this unsolved problem: How do I get the maximum value of ...
2
votes
2answers
53 views

Calculate coverage percentage of an area covered by shapefiles using GDAL? [closed]

I have thousands of shapefiles covering around the world. I need to calculate coverage percentage. For example, a pixel located in Hawaii was covered by 100 of all shapefiles, then this pixel value of ...
1
vote
1answer
29 views

ogr2ogr write multiple layers to one geopackage

I'm using ogr2ogr to write a SQL query from PostGIS to a GeoPackage in a linux shell. Query by Query to many GPKG: ogr2ogr -f "GPKG" point.gpkg PG:"host=localhost dbname=data user=user password=******...
1
vote
2answers
46 views

What is the correct GDAL Calc Syntax?

I need to calculate in gdal_calc the following python script. if (A == 0 and B == 0): wd = 0.0 else: wd = np.arctan2(A,B) I have tried if(A = 0 && B = 0,(0.0), else,(...
0
votes
1answer
24 views

Error using gdalwarp

I have this NetCDF file of the Greenland ice sheet velocities but the coordinate system is NSIDC Sea Ice Polar Stereographic North (y: -655750 to -3355750 and x: -639750 to 855750 meters). I wanted to ...
0
votes
0answers
19 views

Create elevation-service from geotiff using python and gdal

I'd like to create a little server for us, that tells us the elevation of a point in a geotiff file. I already got it working basically using the following: dataset = gdal.Open('test_file.tif', gdal....
1
vote
1answer
27 views

Finding GDAL Build Format List?

I am building GDAL from source to limit the list of supported drivers however I cannot find a definitive list of formats and their appropriate shorthand names to use in my ./configure list to set them ...
3
votes
1answer
50 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 ...
2
votes
1answer
61 views

How to write a single pixel or a line of pixels to GeoTIFF using GDAL/Python

Let's say I want to write a single pixel or a 1D array of pixels (e.g.all at the same latitude) of pixels to a single-band of a Float32 GeoTIFF using the Python GDAL bindings. How can I do so? Or is ...
3
votes
2answers
46 views

Detecting 12bit images in 16bit

Setting For the purpose of a machine learning algorithm I'm tying to automatically scale images of arbitrary bitdepth to unit interval, i.e. I want to map pixels from [0,2x] to [0,1] simply by ...
-1
votes
0answers
28 views

Extracting Z coordinate from DEM - Python

I'm writing an algorithm in Python to extract Z coordinate of an DEM for a pair of X,Y coordinates. I'm using GDAL. The algorithm works correctly by extracting the Z coordinate from the DEM: Z = ...
0
votes
0answers
20 views

Error with Datetime fields when loading Tab file to SQL Server using OGR2OGR

I have a MapInfo Tab file that needs to be loaded to a MSSQL Server DDBB in a scheduled basis and I want to use OGR for this task. The tab is going to be appended in an existing DDBB table that has ...
0
votes
0answers
87 views

Why Does Jupyter/IPython Fail to load GDAL?

I've been trying to put together some Jupyter Notebooks which demonstrate some GDAL functionality but when I do from osgeo import gdal I get ImportError: DLL load failed: The specified procedure could ...
3
votes
1answer
48 views

Reclassify multiple raster files with GDAL [closed]

I have a directory containing multiple .tif files which I want to reclassify and save to a new directory. The following code already worked for a single raster. Unfortunately, I don't know how to use ...
0
votes
0answers
13 views

runGdal returns “gdalinfo failed - unable to open” […] “.hdf” file

I'm trying to use the function runGdalin R on a Mac and it seems that gdalinfo is not able to open the file. In the terminal, when I entered gdalinfo /MODIS/MCD12Q1.006/2009.01.01/MCD12Q1.A2009001....
1
vote
2answers
46 views

How to save raster with projection into Python

I applied a raster processing that is already in a known coordinate system with this code, import cv2 import numpy as np from matplotlib import pyplot as src img = cv2.imread(r'E:\2_PROJETS_DISK_E\...
0
votes
0answers
33 views

Converting CSV to GeoTIFF in QGIS/GDAL

I have a custom CSV file with the columns UTM easting, UTM northing, red, green, blue. The latter values represent a RGB color of the pixel value. Now I want to convert this CSV to a raster GeoTIFF. I'...
2
votes
0answers
22 views

Rasterize a geometry using gdal.RasterizeLayer()

I am writing a processing script using QGIS 3.4. I need to rasterize a polygon using gdal.RasterizeLayer. The problem is the polygon is a list of QgsGeometry objects and not a layer. n = (2*radiusInt)...
3
votes
0answers
60 views

Why an extra iteration on the first feature of a GeoJSON layer?

I'm using Python and GDAL to iterate over the features in a GeoJSON layer and I'm seeing this strange behavior where the first iteration is repeated a second time before moving onto the next feature. ...
2
votes
1answer
217 views

Ogr2ogr: ERROR 1: PROJ: pj_obj_create: Cannot find proj.db

I start using GDAL 3.0.0 using conda build. I successfully installed GDAL on my laptop (Windows 10) and I am trying to ingest MapInfo tab file into Elasticsearch index. I understood that I have to ...
0
votes
0answers
50 views

GDAL polygonize only particular values

I want to polygonize .tiff raster file for specific values. For example, using one method I firstly reclassified the raster by gdal_calc.py --calc="A*logical_and(A>0,A<1)" then used gdal....
0
votes
0answers
21 views

Using GDAL Java Library on MacOS

I'm using GDAL 2.4.1 on MacOS. Now I want to write a small application using the GDAL Java Library. It appears to be just a bridge between my code and the native GDAL Libraries, therefore I have to ...
0
votes
1answer
52 views

Get maximum pixel value within numeric range

I am working with MODIS Global Primary Production (GPP) rasters and I am trying to pick the max GPP pixel value in a series of 15 dates for a study area and create a new raster layer. MODIS GPP ...
0
votes
0answers
60 views

TypeError: 'int' object does not support item assignment

I am trying python for the first time. I have a raster layer of Type Float32, and another raster output of Type Integer created from this raster layer outside the python code. I want to scan every ...