The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
1
vote
0answers
22 views

Converting PBF to Shapefile with name:xx tags as a column in the attributes

I have a PBF file containing only rivers information (extracted using osmosis when waterway=river). A conversion of this PBF to SHP works fine with ogr2ogr when I am selecting fields like "osm_id" ...
0
votes
0answers
19 views

Using gdalwarp, how to first transform and then clip instead of vice-versa?

I have a large number of GeoTiffs that I need to clip by a polygon stored in a shapefile and then save them as a new raster. I use a gdalwarp command which I call from a Python script. These GTiffs (...
0
votes
0answers
23 views

Can't Open NetCDF file with GDAL module for Sentinel 3 Data

I downloaded a Sentinel 3B SLSTR Sl _L_RBT file and I am trying to open the Band 8 Nadir Thermal Band (S8_BT_in.nc) in NETCdf format. import gdal ds = gdal.Open( 'NETCDF: "/home/aaron/...
2
votes
3answers
1k views

osgeo.gdal.Translate - How to set compression on GDAL GTiff driver

How do I force the use of compression on the GTiff driver when called from osgeo.gdal in Python? Example on the workflow, which currently reads LZW tiffs and dumps them to uncompressed tiffs. from ...
0
votes
0answers
17 views

Mimik -crop_to_cutline from gdalwarp with rasterio.mask

I'm trying to clip a raster with some polygons, some of them lie party outside of the raster. In gdalwarp, if you set -crop_to_cutline, it will fill the exterior part with no data and make it be a ...
2
votes
1answer
67 views

How to clip raster inside of circle (python gdal)

I have a source raster and an ERSI shape file, want to crop the raster into the circle. raster = gdal.Open("raster.tif", gdal.GA_ReadOnly) #read raster projection=raster.GetProjectionRef() ...
0
votes
1answer
51 views

No module named 'osgeo' after installing GDAL on Mac

I installed GDAL on Mac and it was successful because when I type in the terminal : gdalinfo --version it renders me the right version. The issue is when I switch to Pycharm or the default IDLE of ...
0
votes
1answer
96 views

Gdal.warp broken in version 2.3.3?

I have two versions of Python gdal running in different environments. One is slightly older (2.1.1) and gdal.Warp seems to work just fine there, the newer version doesn't. Has anyone else had this ...
3
votes
0answers
34 views

Problem with QGIS GDAL Fill Nodata

I have been using the 'GDAL Fill Nodata' function in QGIS in order to rectify downloaded Landsat 7 images, having created a relevant mask. Whilst said function has been successful in resolving bands 1 ...
1
vote
1answer
899 views

Terrain correction / Orthorectification with gdal

Since MODIS Imagery Orthorectification (Open Source) had no answer, I will try to get one here with a similar problem: I got some raster datasets with GCPs in lat/lon, but without height information. ...
11
votes
2answers
20k views

Convert .tif with .tfw to a GeoTiff?

I have a tif image file, and a .tfw world file (created from OSM data with Mapertive). How can I (using linux command line) convert that to a GeoTIFF file? (i.e. I want to have one file, not 2). I'm ...
3
votes
1answer
113 views

How to change a numpy array's dimensions [closed]

I'm using GDAL Python API to read a raster into a NumPy array, it will return a array's shape like [bands, rows, cols], if we want to use OpencCV to deal with this array, it will cause some problem, ...
1
vote
2answers
3k views

Translating GeoTIFF to 16-bit PNG with GDAL

I have a GeoTIFF file which displays the following information when running gdalinfo: Band 1 Block=10012x1 Type=Float32, ColorInterp=Gray Description = Layer_1 Min=1638.991 Max=2577.040 Minimum=...
1
vote
1answer
49 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 ...
1
vote
1answer
332 views

Converting GeometryField to MultiPolygon using GeoDjango?

I am trying to add a bunch of school boundary files into the database. The boundary files are inconsistent. They are processed by DataSource as either Polygon, MultiPolygon, or GeometryCollection. ...
1
vote
1answer
585 views

Using gdalwarp with c# bindings?

I want to change projections for images using gdal bindings for c#. Gdal_translate seems like just renaming of projection (using a_srs parameter), but not reprojecting, so I used gdalwarp with s_srs ...
50
votes
8answers
20k views

Should GDAL be set to produce GeoTIFF files with compression? Which algorithm should be used?

I have a folder of GIS data that consists mainly of GeoTIFF files. The whole set weighs in at about 1.2 GB. I noticed that if I pack the contents into a tarball, it smashes down to about 82 MB. I ...
1
vote
0answers
23 views

Split .tif image in Python using GDAL

I am trying to split .tif image that i have downloaded from satellite imaginary. The .tif image is 114MB and has lot of data and i want to split the image into further small images to work more on the ...
2
votes
1answer
660 views

Keeping the original file name when batch processing GDAL translate?

I would like to convert .tif files to Idrisi or ENVI format. I would like to do a batch process, keeping the original filename. When I choose: "run as a batch process", as I can see, I still have to ...
10
votes
3answers
14k views

Converting a NetCDF file to GeoTIFF using GDAL?

I have a NetCDF file which contains data for the number of rain days in the UK. I'd like to convert it to a GeoTIFF, but can't get GDAL correctly georeference it. See dumps from gdalinfo below. I ...
0
votes
0answers
206 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 ...
0
votes
1answer
760 views

Python problem using GDAL

I used the instructions at https://pythongisandstuff.wordpress.com/2011/07/07/installing-gdal-and-ogr-for-python-on-windows/ I downloaded the following files: GDAL-1.11.1.win-amd64-py2.7.msi gdal-...
1
vote
1answer
51 views

How to compress ecw when gdal_translate from tiff to ecw?

I wish to translate geotiff 16gb to ecw, cause current size is so big. but when I run sudo gdal_translate ppp_2020.tif ppp_compr.ecw -co "COMPRESSION_RATE_TARGET =80" 0...70...80...90...100 - done. ...
2
votes
1answer
902 views

Rasterizing point layer with multiple features falling inside raster cell using GDAL?

How to make a raster with values that are the sum of all points inside each raster cell? The burn value is a specific attribute. Using gdal_rasterize or gdal.RasterizeLayer(), the resulting raster ...
0
votes
1answer
572 views

gdalbuildvrt error when mosaicking SRTM data with different NoData values?

I'm attempting to mosaic together 9 SRTM tiles downloaded from CGIAR to produce a DEM of Borneo. I'm using: gdalbuildvrt Borneo.vrt BorneoSRTM/*.tif where BorneoSRTM contains the 9 tif files to be ...
0
votes
2answers
5k views

Accessing GDAL from Terminal with OS X Mavericks?

I successfully installed QGIS on my iMac with OS X 10.9.1 Mavericks using the installers provided by Kyngchaos. However, I'm having troubles accessing GDAL / ogr from terminal. It's giving me the ...
29
votes
4answers
3k views

Learning resources for GDAL?

I quite often get stuck trying to solve particular problems, or getting syntaxes right. Apart from the details provided in the links on GDAL Utilities, does anyone know of any 3rd party resources/...
2
votes
2answers
254 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 ...
0
votes
0answers
20 views

GDAL calc difference between two NDVI rasters

I get a series of NDVI rasters every 2 weeks and need to calculate changes. The rasters overlap, but are different in area. The resolution is also a little different in each raster, raster 1: -0....
0
votes
0answers
19 views

R gdal_grid interpolation results in null values for elevation

I am trying to grid point cloud data. I created a csv with coordinates x,y and elevation z-values. The first lines of the .csv file look like this: "X", "Y", "Z" 666578.24179169,5747856.3361029,-0....
0
votes
1answer
174 views

GDAL ogr2ogr OracleSpatial to Shape: Multipolygons with wholes/multiparts are missing

We're holding geodata in an Orcale database (11g) with spatial extension. I want to unload specific polygons and convert them into Shape for further local processing. The table where I'm unloading ...
2
votes
0answers
2k views

Getting started with GDAL? [duplicate]

I'm completely new to GDAL and I'm going to use it to work with satellite images, DEMs, etc. I have some experience working with Visual C++ and the OpenCV library. And in fact my goal is to combine ...
2
votes
1answer
180 views

Using forceToLineString() with GDAL and Python?

For my script I'm looking for a method to convert a MultiLineString into a simple LineString. Example: MULTILINESTRING ((0 0,0 1),(0 1,0 2),(0 2,0 3,0 4)) ==> LINESTRING (0 0,0 1,0 2,0 3,0 4) I ...
0
votes
0answers
8 views

Image pyramid have wrong colors in Geoserver [duplicate]

Just want to start off with saying that I'm fairly new to geoserver and the fix to this may be very simple. So have managed to create an image pyramid out of a ~14 GB tif file. The files are fine ...
1
vote
1answer
41 views

GDAL rasterise vector to raster error

I am trying to convert a SHP vector file of X,Y,Z bathymetry. I am trying to use the GDAL Rasterise (vector to raster) tool. When I run it I get the following error in the log. I have tried looking ...
4
votes
1answer
368 views

extract() in R raster package slow with non-native format

I've noticed that running extract takes very different amounts of time depending on whether or not the raster is in memory, on disk in the Native format (.grd), or on disk in another format (e.g., ...
2
votes
1answer
61 views

GDALwarp HDF5 Image With Unknown Projection

I have a NetCDF file that contains a series of HDF5 bands. I am looking to project one of these bands contained within this file. I've attempted to use the following command to achieve this: gdalwarp ...
0
votes
0answers
436 views

Creating layer with geom type wkbGeometryCollection with gdal python?

I am having trouble creating a layer with geom type as geometry collection. Thus I am unable to output to a shapefile. I have attached code below. dstLayer is null. This does not happen if geom type ...
2
votes
1answer
669 views

GDAL conda install on Mac OS trouble

I'm trying to install gdal on my new computer in the anaconda environment using conda but having issues. All I've done so far is install Anaconda for python 3.6 and install gdal as described here + a ...
8
votes
2answers
5k views

GeoTiff to 16 bit tiff, png or bmp image for heightmap

I have a GeoTiff that acquired through processing Mars Hirise stereo images with ISIS3 and ASP. I want to convert it to a 16bit greyscale tiff, png or bmp file to use as a heightmap in a game engine, ...
1
vote
1answer
178 views

Converting large raster to vector?

I have a shapefile which contains 10.000 polygons and I want to know how many of them falls on a specific land use. Unfortunately, the land use map that I have to use is a raster map and not a vector ...
0
votes
1answer
271 views

'gdalwarp' is not recognized in Python3.6

I have created a batch file in Python 3.6.3 to clip a raster image using gdalwrap (I use some coordinates for clipping). Running the batch file in the command line gives error 'gdalwarp' is not ...
1
vote
1answer
122 views

Getting ValueError while creating VRT using python

I am trying to create VRT file using python(GDAL). I am getting "ValueError: array larger than output file, or offset off edge". How to solve this error? Code written for the same is as follows. ...
0
votes
0answers
18 views

Preventing Base Map is getting converted after loading the chart as a layer in MapInfo?

Whenever I am loading the chart into mapinfo using MapXtreme the basemap is getting converted. Because of which the chart is not coming in the right place. Can you please check my code what I am doing ...
6
votes
1answer
591 views

Merging GeoTiffs with GDAL causes grid-like artifacts?

I'm processing ASTER DEM tiles, merging them into larger blocks (to minimize visible tile edges) and importing the contours into a postgis database. Workflow: gdal_merge.py -of GTiff -o merged.tif ...
1
vote
2answers
324 views

Did GDAL install correctly in Winpython?

I installed the "gdal-201-1800-core.msi" and "GDAL-2.1.2.win32-py3.4.msi" in WinPython. It looks like the gdal could run in python shell.( there is no error when type "import gdal" ). But I could not ...
0
votes
1answer
372 views

gdal_translate with custom corner coordinates in python

I wish to convert this Python code using a gdal command line tool to using the gdal python library. I am using it to convert some PNG satellite images I am downloading to georeferenced TIFFs. I ...
0
votes
0answers
22 views

ogr2ogr sqlite dialect can't find functions

my question might be related to this Dissolve using ogr2ogr gives 'no such function: ST_union' What I am trying is st_unioning my landparcel polygons based on its group. The code is very ...
0
votes
0answers
15 views

GDAL Rasterize (Vector to Raster) not working with any extent

I am attempting to rasterize a road layer and neither the GRASS nor GDAL routines for this are working in QGIS 3.8.2. All of my data is in UTM. Here is my input (GDAL): { 'BURN' : 0, 'DATA_TYPE' : ...
0
votes
1answer
45 views

Setting correct proj4 string/info using GDAL

I am going to try and be as clear as I can - because I don't exactly know what I am doing but I am trying my best. I am sure this is probably simple but I have tried for hours to figure this out. I am ...