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
62 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
24 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
21 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
65 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
64 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
22 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
45 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
20 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 ...
0
votes
1answer
83 views

Reprojecting GeoTIFF from WGS84 to UTM with gdalwarp?

I have a GeoTIFF image in WGS84 and when I try with gdalwarp to reproject to UTM, it has a problem. Size of TIFF is J: 15769, W: 60027 J_LeftTop:2.0705046510 W_LeftTop:0.4974727391; J_RightTop:2....
0
votes
1answer
41 views

Blown out TIFF image after merge in QGIS?

I'm attempting to merge four GeoTIFF images in QGIS for the first time and am getting unexpected results. Navigating to Raster --> Miscellaneous --> Merge..., I set up the merge as follows: Once the ...
2
votes
0answers
51 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 ...
0
votes
1answer
59 views

How do I crop a TIFF down to a specific region?

I have two TIFFs that have the same pixel size. One of them is geolocated inside the other. I would like to crop the larger one down to the exact same extent as the smaller one. Is this possible with ...
1
vote
1answer
49 views

Using GDAL Warp results in odd pixel sizes and gaps

I am mosaicking one meter and three meter rasters to two meters in Python with GDAL Warp using the following code: cl_string = "-of GTiff -co COMPRESS=LZW -tr 2 2 -tap -r near -overwrite \ -multi -wo ...
1
vote
2answers
293 views

Inserting nodata value using GDAL?

I'd like to edit the nodata values in several raster files, but big number of these file doesn't have any nodata value defined, there is nothing to edit. I'v tried the gdal_translate -a_nodata ...
1
vote
0answers
14 views

QGIS quit unexpectedly

Running QGIS 2.18 on Mac OS 10.14. Python 2.7 and GDAL 2.1 installed. Trying to clip raster by polygon. (raster--> extraction --> clipper) Get error message. ("qgis 2.18 clipper The process failed ...
0
votes
1answer
55 views

Is saving rasters to VRT bad convention?

I'm working with a lot of rasters (dozens of thousands) and would like to store them for a while. They will be used intermittently, but never all at once! The size of VRT (~2 kb) is such a positive ...
0
votes
0answers
33 views

gdalwarp : I lose some pixels when I crop

My problem: When I crop with gdal gdalwarp -te minX minY maxX maxY input_raster.tif output_raster.tif I expect an output shape of (maxX - minX, maxY - minY) = (10980,10980) BUT : I get an output ...
1
vote
1answer
62 views

Creating boundaries from points and area measurements

I have a list of villages and the area measurement for each village. Is there a way to draw hypothetical boundaries of each village based on the area measurements and the calculation is able to ...
0
votes
1answer
63 views

Getting PNG binary data from GDALDataset

I have an in memory GDALDataset of driver type PNG. How can I get the binary PNG data to send to a web client without first writing the GDALDataset PNG to disk and reading it back as a binary file?
0
votes
0answers
71 views

Install GDAL for Mac

In this discussion: https://gis.stackexchange.com/a/281671/136706 Cheng recommends to "NOT use the 1 install GDAL Complete.pkg to install GDAL. Try use pip to get GDAL from PyPi instead." So after ...
0
votes
2answers
156 views

ERROR 1: NUMPY driver was compiled against GDAL 2.1, but the current library version is 2.2

When running my Python program, the following error came out: ERROR 1: NUMPY driver was compiled against GDAL 2.1, but the current library version is 2.2 What can I do to fix this?
0
votes
0answers
130 views

Installing OSGEO and GDAL in Ubuntu

I'm trying to run a Python program which needs to import from osgeo import gdal, ogr import osgeo.ogr, osgeo.osr from osgeo.gdalconst import * But when I run it outputs Traceback (most recent call ...
2
votes
0answers
80 views

GDAL processing output to memory in Pyqgis

How do I save GDAL processing output rasters to a temporary layer? Using 'memory:' for vector processes works fine, but I couldn't get it to work for GDAL processes. output_rast = self....
0
votes
0answers
53 views

gdal.ComputeProximity always returns 0-value raster

I try to create a raster layer with the smallest distance to cells with targeted value so I use gdal.ComputeProximity(). But I must do something wrong because my output raster contains only 0 values. ...
0
votes
1answer
25 views

Batch processing of GDAL clip function

When I am trying to batch process GDAL clipping in QGIS 2.18 with 30 raster files I get the following Error: GDAL command output: ERROR 1: Cannot compute bounding box of cutline. My ...
2
votes
1answer
57 views

Convert worldfile for jpg to worldfile for png

I am using 3 band jpeg files with 1 band png masks for image analysis. The names match except for extension, and I am merging the jpgs using gdalbuildvrt, then gdal_translate to generate a geotiff. I ...
1
vote
0answers
79 views

GDAL - Polygonize multiband raster and save pixel values of each band to corresponding attribute fields

I'm trying to polygonize 2 band raster(which was previously reclassified) and put values of each band into seperate attribute table column. Both bands overlap each other perfectly. This piece of code ...
3
votes
1answer
160 views

netCDF raster layers not loading in QGIS

I have worked with netCDF files in QGIS before, but since I installed QGIS 3.6 they won't load ("myfile.nc" is not an admitted raster data source), nor do they load in QGIS 2.18 anymore. I find this ...
2
votes
1answer
124 views

Is there a problem with some gdal functions in Mac version of QGIS3.4?

This morning I have been trying to clip, extract, do anything with a DEM in V3.4 on a mac10.14.3 (it works fine on linux Debian). I receive an error message in the dialog box - attached and the log ...
0
votes
0answers
36 views

gdal_merge adds black borders

I'm using gdal_merge.py to merge a few GeoTIFF's into a GeoPackage. The source files are UTM33 projection, 3 bands (RGB) without Nodata tags. They make up a non-rectangular mosaic, so gdal_merge ...
0
votes
0answers
36 views

Generating VRT in batch at GDAL

Is there any way to generate a virtual batch (.vrt) in batch? I imagine the coordinates should be in a .txt file and related to the name of the images that will be cropped. There are more than 1,000 ...
1
vote
0answers
71 views

Why gdal does not find gcps coordinates on SENTINEL images?

I use gdalwarp with python to overlay polygons on ENVISAT radar images. Everything goes well for this type of images but when I try with SENTINEL images, gdal does not find the georeferencing. It ...
0
votes
1answer
66 views

Clip shapefile based on another shapefile [closed]

I have two shapefiles with me, one big and one small. I want to clip part of big shapefile where the small shapefile is located. I tried QGIS vector intersect by geometry, but that is returning me ...
0
votes
0answers
56 views

Chinese encoding problem in ogr2ogr from DXF file to GeoJSON?

I have a dxf format file named test.dxf which has some Chinese characters inside. I tried to transform it to GeoJSON file using ogr2ogr -f GeoJSON test.geojson test.dxf and returned GeoJSON showing ...
1
vote
1answer
70 views

Writing numpy arrays to irregularly shaped, multiband raster

I have the following numpy arrays: predictions; type is float32; shape: (94, 1461) lats; float32; shape: (94,); centroid of cell in vector layer, decimal degs. lons; float32; shape: (94,); centroid ...
2
votes
1answer
101 views

How do I plot spatialpolygon dataframe layer on a leaflet map

I am not sure why this piece of code works library(leaflet) library(raster) adm <- getData('GADM', country='SGP', level=1) popup <- paste0("<strong>Name: </strong>", ...
0
votes
1answer
37 views

Calculate max of all cells of a raster with gdal_calc.py

I want to calculate max of all cells of a raster, i.e. the result should be a scalar. Regardless of what I call amax, max, numpy.max(A, axis=0) I always get a raster with the same WxH as the original ...
0
votes
1answer
45 views

Gdal Build Curl Error

I'm building gdal 2.4.1 with the following config options ./configure --with-libtiff=internal --with-geotiff=internal --with-jpeg=internal --with-gif=internal --with-openjpeg --with-opencl=yes --...
1
vote
1answer
33 views

gdalbuiltvrt output is different than the source images, when using dstalpha?

I have warped some images from various state plane coordinate to EPSG 3857, but the output of gdalbuildvrt is messed up (see image). I've tried dozens of different combinations of gdalwarped and ...
0
votes
1answer
49 views

Convert a .png file to a GeoTIFF while knowing the boundings

Disclaimer: I've already found this link Convert PNG to GeoTiff using GDAL - but it was of no help. Actually I've got a .png file of a hand-drawn map (I also got it in the .svg format in case this ...
0
votes
0answers
46 views

pyinstaller stops in the middle of process

I try to create a .exe from a .py script. I use Pyinstaller. The script runs fine with no errors in Pycharm. If I open the .exe my Tkinter opens I can choose the files etc.. And then in the middle of ...
1
vote
0answers
78 views

Merging multiple QgsRasterLayer objects to create virtual raster (.vrt file) using gdal

I am creating multiple QgsRasterLayer objects in pyqgis and I need to merge them into a virtual raster .vrt file which will eventually be loaded as a layer in QGIS. The QgsRasterLayer objects are ...
1
vote
1answer
169 views

rgdal installation error: How to set GDAL_DATA directory?

I've long had GDAL, proj, etc. installed and working fine for various other related software (e.g., QGIS). Unfortunately, every time R gets updated it tends to lose links to previously installed R ...
2
votes
1answer
74 views

Adding multiple Additional options to QGIS Batch processing?

How to add multiple additional options on qgis batch processing? result is : GDAL command: gdal_translate -of GTiff -co "COMPRESS=JPEG JPEG_QUALITY=75 PHOTOMETRIC=YCBCR TILED=YES" it should be ...
0
votes
2answers
269 views

GDAL create mbtiles with differing image by zoom level

I want to build an mbtiles with different map detail at different zoom levels (e.g. contours at 1m at levels >16 and 5m <=16). I've exported raster images at the right resolution using QGIS and now ...
1
vote
0answers
69 views

Very large GeoTIFF dataset to GeoPackage

I'm trying to mosaic a large GeoTIFF dataset into a GeoPackage with Gdalwarp (no reprojection). There are 512 .tif files, each with a single 8-bit grayscale band, and 1 meter resolution. I'm using -...
0
votes
0answers
32 views

gdalinfo --formats return different values in python3 than in OSGeo4W

I am working whit geopdf to obtain the layers. When I use driver = ogr.GetDriverByName('PDF') it return None, and obviously I can't open it. I have checked with the command gdalinfo --formats and it ...
1
vote
1answer
39 views

PNG driver chokes on raster gdal_transformed to ot byte

I'd like to extract a part of a DEM (data.linz.govt.nz wellinton lidar dem) and analyse it using gdaldem: $ gdalinfo /vagrant/public/assets/GeoTIFFs/17a17d1fae/lenz-mean-annual-temperature.2193.tif ...
0
votes
0answers
48 views

Mars DEM: Interpretation

I have processed the *.tif-file from https://astrogeology.usgs.gov/search/map/Mars/GlobalSurveyor/MOLA/Mars_MGS_MOLA_DEM_mosaic_global_463m as gdalbuildvrt mars.vrt <filename>, and now gdalinfo ...
0
votes
0answers
84 views

GDAL convert GeoTIFF to GEOPDF

Using following to convert GeoTIFF to geospatial PDFs. However, the generated PDF is not measurable in Adobe Reader. import cv2 import numpy as np from osgeo import gdal dataset = gdal.Open("sample....