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
0answers
7 views

Custom function for mosaic seams in Python GDAL

I was wondering if there is a way to implement a custom function for creating seams between the rasters that create a mosaic. More specifically, if I create a mosaic with gdal_merge or gdalwarp, the ...
0
votes
0answers
4 views

raster2pgsql - invalid pointer

I get the following error each time I run the raster2pgsql: [postgres@li1959-236 ~]$ raster2pgsql -I -C -s 4326 -M -F /home/temp/wrf_d02_202005010000.tif grib_test | psql -d cep Processing 1/1: /home/...
0
votes
0answers
7 views

Cannot execute gdalwarp in a Python notebook

I try to reproject a raster using gdalwarp. To do so I use the subprocess package of Python3 : command = [ 'gdalwarp', map_raster, map_raster_proj, '-t_srs', 'ESRI:54009' ] print(' '....
0
votes
2answers
579 views

Rasterizing by attribute in rasterio

According to Rasterizing shapefiles with GDAL and Python? it seems that gdal allows rasterization of a layer according to a certain attribute ds = gdal.RasterizeLayer(target_ds, [1], source_layer, ...
0
votes
1answer
20 views

How to burn values from a shapefile into raster with gdal.Rasterize?

I have this code to rasterise a point shapefile into raster TIFF. vector_ds = ogr.Open('stations.shp') shp_layer = vector_ds.GetLayer() shape_file = 'stations.shp' output_raster = os.getcwd()+'/...
2
votes
0answers
23 views

Displaying (Correctly?) Projected PNG onto Leaflet Map

I am trying to overlay a PNG onto a Leaflet map. My GDAL commands: UL="-125.002000 52.013300" LL="-125.002000 22.013300" UR="-66.492200 52.013300" LR="-66.492200 22....
0
votes
0answers
19 views

Can GDAL run XML Composition File for GeoPDF from command line?

The documentation page for PDF via GDAL includes the description for using an XML Composition File: https://gdal.org/drivers/raster/pdf.html#creation-of-pdf-file-from-a-xml-composition-file-gdal-3-0 ...
1
vote
1answer
348 views

Extracting certain portion of a geotiff with node-gdal

I use node server. And I want send coordinates of an area then extract related portion of the geotiff file (dem) using node-gdal. Is it possible to do this with node-gdal?
1
vote
1answer
78 views

Coordinates not consistently reversed (lon,lat interpreted as lat,lon) in Leaflet

I have a polygon layer fed from GeoDjango + PostGIS as GeoJSON. Its original CRS is 3908. It's being drawn as a GeoJSON layer in Leaflet in CRS 4326 (I figure it is transformed on the fly by Django ...
1
vote
2answers
30 views

Cut a multispectral TIFF into smaller parts

I have a multispectral image with 6 bands that I want to cut into smaller parts. It seems like a trivial task but I can't make it work. Approach 1: using rasterio.windows. I choose how many tiles I ...
2
votes
1answer
3k views

How to replicate gdalwarp -cutline in Python to cut out tif image based on the extents.kml file

In my python code I run the following command: command = 'gdalwarp rgb.tif rgb_output_cut.tif -cutline extent.kml -dstnodata 0 -q' os.system(command) This cuts rgb.tif based on the extents specified ...
0
votes
0answers
10 views

Point an existing QGIS installation at a different gdal framework

I have QGIS installed on a mac via the official qgis.org binary installer. I'm running QGIS 3.10 and it shows that it's compiled against GDAL 2.4.1. When I look at the GDAL Frameworks installed on my ...
0
votes
2answers
66 views

Stacking a raster with GDAL in python - vrt, translate, merge giving errors

I'm trying to create a composite of all my sentinel bands into one tif in python. I've tried doing a few things but nothing seems to be working. I am using an arcpy python environment as I need a few ...
0
votes
0answers
17 views

Creating a mosaic out of rotated raster with gdal_translate

I have a number of images (the amount does not really matter) which are georeferenced with a correct transform ( since they show correct position and rotation in qgis). But when I try to use ...
0
votes
1answer
84 views

Bundling GDAL 3.0.2 with PyInstaller

I'm not sure if this is the right Stack to ask in, but I've been recently trying to bundle the latest wheel of GDAL 3.0.2 x64 downloaded from https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal for ...
1
vote
1answer
690 views

Installing Python bindings for 64-bit Python on Windows

I installed GDAL and its Python bindings from GISInternals. While I believe that GDAL was installed correctly, the Python bindings have an issue. After opening a file with gdal.open I cannot read ...
0
votes
0answers
107 views

OGR_F_GetFieldAsInteger64 error with GDAL1.10 and Django 3 in Ubuntu14.04

I am using Ubuntu 14.04 for deploying a Geodjango application. Ubuntu 14.04 has GDAL 1.10 by default and i need GDAL 2+ versions for my application. Is there any way to install GDAL2 + versions in ...
0
votes
1answer
28 views

Write to GDAL raster to HDF5

Is there a way to write a GDAL raster to a HDF4 or HDF5 dataset using GDAL? I have found many examples that show how to read HDF datasets, but none on how to write them.
0
votes
1answer
65 views

Rotate raster before tiling

I have set of referenced rasters (.tif), which need to be tiled - but each of them need to be rotated by a certain degree before that using python (gdal mainly as other routines use it as well). In ...
2
votes
0answers
36 views

How can I automate the QGIS Raster Export -> Save as tool programatically?

I need to export a chunk out of an ArcGIS Server (Esri MapServer service) layer that is displayed in QGIS. GDAL's clip by extent and clip by mask can't handle a web layer through the tool. Using the ...
0
votes
0answers
15 views

Extract pixel values along with lat/lon bounds [closed]

I have a TIFF file with spatial resolution of 10km which means each pixel on the raster corresponds to a square of side 10 km on Earth. Is there a way to get the Lat Lon bounds ( upper left , upper ...
1
vote
1answer
428 views

Pulling Spatial Data in Geography Format From MS SQL Server 2008 Using ogr2ogr

Can the MSSQLSpatial driver support geography fields queried from MS SQL Server 2008 as spatial data? Background I have been using unixODBC on an Ubuntu 16.04 machine with ODBC Driver 17 for SQL ...
1
vote
0answers
28 views

Python gdal.translate doesn't write the output file

I am very new with gdal and python in general, therefore pardon my simple question. I have a geotiff (single band, black and white) that I want to change from grayscale to RGBA (becasue I want to use ...
5
votes
1answer
122 views

Are there any working examples of ogrlineref?

I'd like to understand how ogrlineref works but I can't find any examples. I'd like to see the actual "roads.shp" and "references.shp" mentioned in the example invocation: ogrlineref -create -l ...
1
vote
1answer
25 views

GDAL WMS service won't accept HTTPS connections

We have a system that is using the GDAL C# wrappers to talk to a WMS server. This all works ok when using HTTP, but if we try and connect to the same server using HTTPS then the call to GDAL. Open ...
2
votes
1answer
78 views

Why can't I make GeospatialPDFs using QGIS 3.14?

According to this link, QGIS 3.10 and newer can create GeospatialPDFs. However, when I go to export through layout view, the box is greyed out. What am I doing wrong? More details: When I go to export ...
1
vote
1answer
266 views

compile gdal with ESRI FileGDB_API Ubuntu

I'm trying to build GDAL on Ubuntu 16.04 with ESRI FileGDB_API driver support. I've followed the instructions here: https://trac.osgeo.org/gdal/wiki/FileGDB and have attempted to pass the location of ...
0
votes
0answers
8 views

gdal_rasterize and keep/create the attribute table

I want to rasterize my polygon by a given field, and keep/create the attribute table. Now, as a raster, the attribute table will contain a row by each unique value (category) in my raster, and no an ...
0
votes
0answers
47 views

Importing .bag (bathymetry) files into QGIS 3.x

I downloaded bathymetric data from the NOAA Bathymetric Data Viewer website: https://maps.ngdc.noaa.gov/viewers/bathymetry/ I've tried to import and view several .bag files from this website within ...
0
votes
0answers
25 views

Problem QGIS Read COG AWS S3

I have a public image in my Amazon S3 bucket. When I import it to QGIS using the HTTPS protocol and its URI, the image loads without problems. However, if I try to do it with the AWS S3 protocol, ...
1
vote
1answer
30 views

Converting GRIB2 to GeoTIFF

I am trying to convert a GRIB2 file to a GeoTIFF file using gdal. My Commands: gdal_translate -b 1 -a_srs EPSG:3857 some.grib2 some.grib2.tif gdalwarp -t_srs '+proj=longlat +datum=WGS84 +ellps=WGS84 +...
2
votes
1answer
64 views

Buffering a polygon to match an area

I have a large polygon (A) with a specific area. I also have another polygon (B) with area less than polygon A. I want to buffer the polygon B so that its area becomes equal to the area of A. from ...
0
votes
1answer
464 views

What is the Formula to get an Image's Bounding Box from it's GDAL GeoTransform Array?

I have a process which needs to read in an Image's GeoTransform Array, and convert it to the Bounding Box i.e. If the Input is: <GeoTransform> 7.8087700868360430e+05, 9.9974951285737870e+...
2
votes
1answer
290 views

How to close open files after processing.runlag() command (Qgis: Error No 24)

I'm creating a pyqgis script. In this script I use the processing.runalg command several times. The problem is that these processes are within a for loop. After several iterations, the error number 24 ...
1
vote
1answer
59 views

Measuring distance between features in linear units from vast layer in geographic coordinates in gdal

I have a point layer for a large area. The layer is in a geographic coordinate system. I need to make some distance-aware work with features from this layer. Actually, I need to build a buffer-layer ...
0
votes
0answers
55 views

Installing GDAL on Ubuntu 20.04 - unmet dependencies

I'm trying to install GDAL on my Ubuntu 20.04 with the following commands: sudo add-apt-repository ppa:ubuntugis/ppa && sudo apt-get update sudo apt-get update sudo apt-get install gdal-bin ...
1
vote
1answer
127 views

Convert an OGR File to a Raster

i tried out this recipe from the GDAL/OGR cookbook: from osgeo import gdal, ogr # Define pixel_size and NoData value of new raster pixel_size = 25 NoData_value = -9999 # Filename of input OGR file ...
1
vote
1answer
27 views

get “Cannot find coordinate operations” in GDAL 3; works in GDAL 2

I get the following error when trying to use GDAL 3.1.2 for computing the LLA from my custom gnomonic projections. Am I setting it up wrong? Missing some information/files? Would it be a misconfigured ...
3
votes
4answers
1k views

Combine multiple USGS topo quads into a single seamless raster?

I'm quite new to GIS (so please be patient with my incorrect terminology) but I'm teaching myself as much as I can in order to create my own map of the Boundary Waters Canoe Area in northern Minnesota....
0
votes
0answers
22 views

Numpy array to raster in python / GDAL

I have raw .dat file which i need to convert to a raster. I am currently using numpy to read the file data = np.fromfile('gsmap_gauge_now.20200805.0400.dat',dtype = np.float32) The coverage of this ...
1
vote
1answer
92 views

Value error when trying to load line and polygon GEOJSONs into PyCharm/Python

I'm a newb so apologies if there's incorrect formatting etc here. I'm trying to use GEOJSON files to visualise some data in Python using GeoPandas (GDAL, fiona, shapely, numpy, matplotlib are all ...
0
votes
1answer
27 views

How to use gdalwarp with negative and positive longitude?

I have a georeferenced image of Earth above the Pacific Ocean. Gdalinfo give me this : NC_GLOBAL#geospatial_lat_max=81.328201 NC_GLOBAL#geospatial_lat_min=-81.328201 NC_GLOBAL#...
1
vote
1answer
23 views

Attached image is missing unit support in GDAL 3+ (and associated PROJ4)

This image below worked with the GeoTIFF tools in GDAL v2. When loading it in v3 I get "proj_uom_get_info_from_database: unit of measure not found". What unit of measure isn't found, and is ...
0
votes
1answer
47 views

Use GDAL to resample and stack multidate image spectral bands

I have a Sentinel 2 multidate image data set and I'm trying to resample all of them at 10m and then stack them to apply a cloud mask, in Python language. Being new to programming, I have a hard time ...
0
votes
1answer
155 views

Using GDAL ogr2ogr correctly to generate vector MVT tiles

I am a bit lost here. I am trying to convert JSON to MVT tiles for Mapbox (directory format) using ogr2ogr. My problem is that no matter what I do on the Mapbox/browser side, the tiles do not show up. ...
1
vote
0answers
16 views

Object of Wrong GDALDatasetShadow Error

I am trying to crop the TIF images based on the shape file. After searching the web, I found the following code and manipulated it. from osgeo import gdal import os input_path = '/.../pics' ...
0
votes
1answer
40 views

Read color bil file striped in QGIS, R or gdal

I am trying to render a bil file I downloaded from this link, but in QGIS, R raster::raster() or gdal_translate it shows rotated and with stripes, as shown on the picture; I think it is a problem with ...
0
votes
0answers
7 views

NetCDF and GDAL C++ API compatibility

I am trying to read/write NetCDF file using the NetCDF C++ API: http://unidata.github.io/netcdf-cxx4/index.html Part of the program also operates on Shapefile using the GDAL C++ API: https://gdal.org/...
0
votes
1answer
50 views

How to make PROJ work via Anaconda in Google Colab?

I broke Google Colab with GDAL and Anaconda, how do I repair it? So hear my story: In a project I need to use the RSGISLib Python library (link) developed for object-based analysis of georeferenced ...
1
vote
1answer
46 views

How do I add projection information to this JPG and convert to geoTIFF in GDAL?

I have a .jpg image (weather satellite) that needs to have projection information applied to it and converted to geoTIFF in EPSG:3857, but due to the complexity of the projection I have no idea where ...

1
2 3 4 5
94