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 ...

learn more… | top users | synonyms

7
votes
1answer
230 views

Multiple versions of GDAL (32bit and 64bit) on same machine

I currently have GDAL installed on my Windows 7 64bit workstation. It is the 32bit version. I chose the 32 bit version because I wanted to use the GDAL Python bindings with a 32bit installation of ...
6
votes
2answers
722 views

Can I change the GDAL/OGR library that QGIS uses?

I have been adding a new format to OGR, all seems well and OGRInfo works. Now I would like to test my code out using QGIS. Is there an easy way to switch which GDAL lib QGIS uses on a windows box? ...
6
votes
2answers
341 views

Clarification of the “25D” option in ogr2ogr

[EDIT: In my original post, I had received an error that was based on a typo, so I scrapped that part of the question, but left the questions that still apply.] In the ogr2ogr docs it says: -nlt ...
5
votes
2answers
3k views

How to add *.ecw files to QGIS 2.0 on Windows?

How do I add and view *.ecw raster images in Qgis 2.0 ?
5
votes
2answers
416 views

Adding noise to a raster

I want to add some fine-grained noise to a raster in an automated python process (i.e. I do not want to use Photoshop or GIMP). I looked at PIL, but unless I'm mistaken, it doesn't seem to have any ...
4
votes
2answers
468 views

How to access Shapefile metadata using OGR?

I'm trying to use ogrinfo to get some details on a shapefile I downloaded. Currently, the only way I know how to do this is to load it into QGIS and manually click around to find any information on ...
4
votes
2answers
476 views

Gdal Python Bindings and File Geodatabase API

I'm trying to get python 2.7 to work with GDAL/OGR and an ESRI file geodatabase. There have been a few similar questions asked but the answers don't fully resolve my situation. I have installed the ...
4
votes
1answer
564 views

How to sum or even perform more complex mathematical operations (multiply, add a constant, …) two GDAL grids?

I have two grids with same cell size, same starting position (top left) and same grid size. I want to sum the grids and create a sum grid as an result: e.g. grid A + grid B = grid C How can I ...
4
votes
2answers
3k views

How to add color interpretation for raster bands using GDAL?

I have 3 separate 1-band GeoTIFF files. The color interpretation for band is gray. I want a 3-band RGB file. I've used gdal_merge.py gdal_merge.py -separate file1.tif file2.tif file3.tif -o ...
4
votes
1answer
210 views

Update PostGIS after updating GDAL?

I am using PostGIS 2.0 and I want to use the raster functionality through mapserver. It seems as if the latest official GDAL release 1.9.1 has an unstable PostGIS raster driver, as pointed out in a ...
4
votes
1answer
287 views

How to convert a png with known bounds from Plate Carree to Mercator with GDAL

I have a png image that shows the region defined by the geo bounds UpperLat, LeftLon, BottomLat, RightLon (in degrees & -ve for West Lon and South Lat) in Plate Carree EPSG:4326. I want to convert ...
4
votes
1answer
1k views

Qgis - How to change GDAL version

im working on Ubuntu 12.04 server; i noticed this when i installed additional support for ECW format into the GDAL 1.9.1 which worked ok. Then i tried to add ECW files to Qgis but it said they still ...
4
votes
2answers
469 views

How to fix a raster with wrong Eastings?

I get an error when trying to warp a tif file in QGIS: ERROR 1: Too many points (35721 out of 35721) failed to transform, unable to compute output bounds. I am using QGIS 1.7.0 Wroclaw with gdal ...
3
votes
2answers
49 views

gdalwarp leaves horizontal artifacts regridding from EASE-Grid (laea) to Polarstero (stere)

I'm trying to understand how to use gdalwarp to warp an image. I believe I'm doing the basics correctly, but I might be missing some gdalwarp options? Any help would be greatly appreciated. The ...
3
votes
1answer
231 views

How to find the distance to the nearest coastline from a land-based latitude/longitude point?

I'm completely new to GIS and unsure what I need to solve this problem: In the image above turquoise is actually land. Sea is white. I tried using the NASA Distance to the Nearest Coast data dump ...
3
votes
2answers
677 views

Issue Trying to create Zonal Statistics using Gdal and Python.

I am trying to create zonal statistics using Python and Gdal. I have a polygon shapefile and a raster file, and in order to do so, I am using a piece of code I found in StackExchange. The raster and ...
3
votes
2answers
207 views

Homebrew OGR with FGDB support on OSX 10.9

This answer worked beautifully in 10.8, but isn't working immediately in 10.9. The link to download the FileGDB API still works, but there are a bunch of options available I don't remember from ...
3
votes
2answers
182 views

How to work with OGR and GDAL in GP Service in ArcGIS for Server 10.1

I have got a lot troubles with GDAL and OGR in the context of ArcGIS Server on 64 bit server machine. I can run script that use GDAL in ArcGIS as Tool and in the debug mode in PyScripter, then ...
3
votes
2answers
491 views

How to set output resolution for gdalwarp to that of source file?

I have a large raster, which I want to re-project and crop for a new location that I'm creating in GRASS. I seem to have gotten the re-projection and cropping right with this call to gdalwarp: ...
3
votes
0answers
387 views

How to set GDAL/cs2cs/proj to use NTv2 grid shift file when using EPSG codes?

I am using the GDAL API for Python for a script that takes only EPSG codes for inputs to specify source and target coordinate systems. While the cs2cs command seems to handle quite well ...
3
votes
1answer
2k views

convert from HDF to GeoTiff

I am having some problems with the conversion from HDF to GeoTiff. I am following the steps described in this webpage. The problem is that I can't find what is the NDVI subdataset name (XXXX) in ...
3
votes
1answer
508 views

Grid registration issue converting from GeoTIFF to ARC ASCII Grid

I've got a 3 arc second digital terrain model represented as a 32-bit GeoTIFF that looks like this: $ gdal_info gom03_v1_0.tif Driver: GTiff/GeoTIFF Files: gom03_v1_0.tif Size is 10200, 7800 ...
3
votes
1answer
278 views

How to run OSgo4W shell script on Windows?

I have a lot of DEMs that I want to use to create hillshades, slopes and color relief from and would like to automate the processes using a shell script within OSgeo4W shell. Here is the code I used ...
3
votes
1answer
399 views

ogr2ogr / GDAL remove features in FileGDB while in use by ArcGIS Server map service

I'm using ogr2ogr to pull features out of Oracle and put them into a File GeoDatabase. The FGDB is being used by an active ArcGIS Server map service. This is all done for performance / reducing DB ...
2
votes
1answer
61 views

Georeferencing a raster using GDAL and Python

I want to georeference a raster using python and GDAL. My current approach is to call gdal_translate and gdalwarp using os.system and an ugly list of ground control points. I'd really like a way to do ...
2
votes
2answers
129 views

Exporting 16 bit single-band to 8 bit in SAGA/QGIS

Everytime with every function (e.g convert data storage type or gdal-translat -ot Byte) the output is a completely white map with a black border. only the "save as" export works, but the TIFF also ...
2
votes
2answers
109 views

Gdal: highest and lowest point/pixel, how to get their altitudes?

Given a .tiff topographic raster image. How to get the altitudes of the highest and lowest point/pixel ?
2
votes
2answers
406 views

GDAL Conversion of US Topo GeoPDFs

I've used GDAL_translate with "--config GDAL_PDF_LAYERS" option to convert US Topo GeoPDFs to GeoTIFF and it works great for creating collarless topos based on the new format. However, I can't get it ...
2
votes
1answer
183 views

file geodatabase api on osx mavericks via brewed gdal

I've got a new machine with a fresh install of OSX 10.9, and am having trouble getting esri's file geodatabase api to work correctly with my brewed gdal. This is a known issue, noted here: ...
2
votes
2answers
160 views

How to convert Point coordinates into CSV format?

The GDAL documentation describes how to convert a ShapeFile into CSV data. The layer create options (-lco parameter) allows to prepend the coordinates of Point features to the actual attributes ...
2
votes
1answer
121 views

gdal2tiles.py generating black tiles from .img file

I have a source HFA Erdas Imagine (.img) file which I'm trying to convert into tiles using gdal2tiles.py. I'm running: gdal2tiles.py -w google -g GOOGLEKEY input_file.img The HTML is generated ...
2
votes
1answer
241 views

Problem with georeferencer in Qgis 2 64bit installation

I tried to use the georeferencer in the new Qgis 2 64 bits for windows. I tried with the standallone installer and with the OSgeo4w installer. The problem is when I load the raster that I want to ...
2
votes
2answers
279 views

How do I know the vertical/horizontal units of my DEM? I'm creating a slope using gdaldem

I'm using gdaldem to create a slope map. I can apply a scale. The default is 1. The notes say: Ratio of vertical units to horizontal. If horizontal unit of source DEM is degrees (e.g WGS84 ...
2
votes
1answer
428 views

Using GDAL to connect to a WFS

I'm trying to connect to a wfs using GDAL, from reading some of the (fairly sparse) documentation on this i have found that this is possible if GDAL is compiled with the correct drivers (Curl, ...
2
votes
1answer
608 views

Why does ogr2ogr SHP import error out trying to create a database?

All, Can anyone tell me what the error is with OGR2OGR when trying to import a .SHP into MSSQLSPATIAL? ERROR 1: MSSQL Spatial driver doesn't currently support database creation. Please create ...
2
votes
0answers
365 views

Use GDAL/Python to add rasters (tiff) to an ESRI File Geodatabase

I'm using GDAL python to create a bunch of tiff files from a netcdf file. def modelout_to_geotif(netcdfile, outdir, VarName): """ Given the path to the netcdf output, produces geotiffs for ...
2
votes
1answer
123 views

Using the C++ GDAL API how do I set the GDAL_DATA path?

If I want to change the directory of the GDAL_DATA path or point to a different version of a csv file for EPSG numbers how do I do that using the C++ API?
2
votes
1answer
2k views

Python GDAL: Save array as raster with projection from other file

I have an array of data, and for each datapoint I know the latitude and longitude. I'd like to save it as a GTiff with the same projection as other rasters I have. This is what I've tried so far, but ...
2
votes
1answer
265 views

OGR - Weird GeomType -2147483645 on polygon shapefile

I am trying to import a shapefile (multipolygon) in an app with ogr but I got an error about invalid geom type. If I inspect the data with ogr like this: datasource = ogr.Open("c:\\temp\\data.shp") ...
2
votes
1answer
201 views

st_clip and gdal_translate: “Error browsing database for PostGIS Raster properties” - Why?

Im using shell-script, postgis2.0 and gdal for trying to clip raster apart, using an overlapping raster and a the_geom-object. At first I create a view to clip the overlapping part of the raster. It ...
2
votes
1answer
249 views

gdal.py as part of bat script in windows 7

I need to run the following bat file from a MS4W shell which has gdal_retile.py as the final option. I have added C:\ms4w\python\gdal to my pythonpath but within a pyscripter shell I can not import ...
2
votes
2answers
334 views

--optfile not working with gdal_retile?

I have the following gdal_retile command I am trying to run, but it errors on the --optfile: gdal_retile.py -v -r bilinear -levels 8 -ps 512 512 -co "tiled=YES" -targetDir pyramid --optfile files.txt ...
2
votes
3answers
1k views

Batch script converting and resampling orthophotos

I would like to convert more than 300 orthophotos produced at scale 1:8.000 with a pixel size of 0.8m X 0.8m from Ecw format to Tiff format and after resampling pixel values. My aim is to batch ...
2
votes
1answer
471 views

Finding lat/lon of corners of geotiff file

I am a GIS newbie. I just recently managed to turn a GeoTIFF file into a bmp file using gdal_translate. Now I need to find the latitude/longitude coordinates of the corners. I would prefer to use ...
2
votes
1answer
523 views

Simple band arithmetic on GDAL virtual rasters (VRT)

I want to calculate the difference of two bands. I have the individual bands stored somewhere, but I was thinking that maybe there's a way of producing a VRT file that is the result of this ...
2
votes
1answer
808 views

gdal_grid problem reading vrt file

I am trying to parse csv file and visualize it as geotiff using gdal_grid but I keep getting this error: C:\work\testgdal1>gdal_grid -ot Float32 -l test test.vrt dona.tif ERROR 1: Failed to ...
1
vote
2answers
126 views

GDAL/PYTHON: Batch Process Project All Level 2 HDF Files Only(Filter) and save to new directory

I have downloaded numerous hdf files from an ftp site. Let's say I already have 500 hdf files, 250 of them were level 1 hdf files and the rest were level 2. The level 1 format is: ...
1
vote
1answer
668 views

How to change GDAL version in QGIS to get ECW import to work

I’ve previously been successful in importing ecw into QGIS 2.0 but the same methods (for example How to add *.ecw files to QGIS 2.0 on Windows?) have failed with a fresh install of QGIS 2.2 with ...
1
vote
1answer
105 views

How to have PostGIS 2.1 and the Python osgeo library installed together without compiling from source?

My python application makes heavy use of the osgeo library. We're looking to upgrade from PostGIS 1.5 to PostGIS 2.1, and I'm having issues. I'm installing packages from the Ubuntu GIS PPA. Before, ...
1
vote
1answer
95 views

Unexpected output when using gdal_rasterize

Ok, I used the following code for converting my layer into raster format but I get a tif file that is completely black or white... from osgeo import gdal, ogr # Define pixel_size and NoData value ...