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

36
votes
10answers
21k views

How to install GDAL with Python on windows?

Can anyone please explain to me in step by step instructions how to install GDAL/OGR with Python on Windows. I have Windows Vista and I have tried following the information on the website and it does ...
7
votes
2answers
6k views

ECW for QGIS 1.8 in Ubuntu 12.04

I have followed various online help guides on how to make ecw for QGIS 1.8 work in Ubuntu 12.04. I had it all working in Ubuntu 10.04 but since migration to 12.04 no such luck. Is there a guide that ...
2
votes
1answer
735 views

GDAL2Tiles: MapTiles from BSB/KAP are Switched

As an example I have a BSB file from NOAA which is a navigational map. The map has a SRS of WGS84 and a Mercator projection. I initially translate the file from BSB format to GTiff format using the ...
15
votes
3answers
3k views

How to call gdal_translate from Python code?

Is it possible to use some gdal API to call gdal_translate from Python code? I do not mean simply executing the gdal_translate.py from the file system, but rather call it somehow in code so I do not ...
12
votes
3answers
4k views

Clipping raster with vector layer using GDAL

I have installed GDAL using the Osgeo installer. How can I clip a raster layer with a vector layer programmatically? Is there any GDAL API available which can help me with this? I am using Python.
10
votes
1answer
1k views

How to access feature classes in file geodatabases with Python and GDAL?

I am trying to access a vector dataset in a ESRI File Geodatabase using Python + GDAL. I have successfully compiled GDAL with the file geodatabase API. The FileGDB driver is working correctly since ...
10
votes
2answers
2k views

How to get FGDB support in GDAL 1.9 without compiling?

I was hoping that I could use the 'master' (nightly-build) version of QGIS to get fgdb support without compiliing (I'm not a developer and frankly have wasted days of productive time trying to get ...
5
votes
2answers
2k views

How to georeference using GDAL tools?

I have a .tiff image that I am trying to overlay in google earth. For that I require to georeference it first. The image projection is UTM with NAD83 as datum. I know the lat/long of the four corners ...
0
votes
1answer
237 views

How to conditionnally assign a new value to pixels of a raster image?

Given a topographic GIS raster of one country crop.tif: Given a know pixel value such as elevation (z) is +73 : $ gdallocationinfo crop.tif 1 1 -valonly > 73 Given an elevation threshold n = 50 ...
5
votes
2answers
601 views

GDAL - Perform Simple Least Cost Path Analysis

I am investigating methods to perform a simple least cost path analysis with gdal. By simple, I mean using the slope of a dem as the only cost factor. I would prefer to do using the python or .net ...
1
vote
1answer
466 views

Delineate polygonal catchment areas from a raster using open-source GIS

I'm 90% sure this basic question has been asked before but looking through the other posts I simply do not see a useful answer. I need to calculate polygonal(vector) catchment areas from a raster ...
16
votes
6answers
5k views

How to cut a 'tiled image' from a raster dataset using GDAL?

I am working on an app that needs to create tiles (jpeg) from a given raster dataset. My initial inclination was to use gdal2tiles.py, but its performance seems like it could be improved. That leads ...
21
votes
1answer
2k views

Can ESRI's File Geodatabase API be Redistributed?

ESRI's file geodatabase API can now be used with GDAL/OGR - http://www.gdal.org/ogr/drv_filegdb.html however each individual seems to have to login to ESRI and download the API files individually. For ...
9
votes
2answers
3k views

How can I get a shapefile from a postgis query?

My data is in a PostGIS database. I would like to generate a shapefile from a query. How can I do that?
11
votes
2answers
743 views

How to reproject raster from 0 360 to -180 180 with cutting 180 meridian

I have a geotiff raster image that has a coordinate system with longtitudes from 0 to 360. The horizontal center of the image is 180 longtitude. See image below: I want to transform it to EPSG:4326 ...
9
votes
7answers
2k views

How to add field with filename when merging shapefiles with ogr2ogr?

I'm merging some shapefiles and I had some problems doing so inside QGIS, so i'm using ogr2ogr directly. I'm doing this (in a batch): ogr2ogr -overwrite %destination% %n1% ogr2ogr -update -append ...
4
votes
1answer
2k views

How to resample a batch of rasters using OGR/GDAL?

I'm looking for a function similar to GRASS r.resample. I have a folder full of TIF files and want to reduce their resolution ("scale them down") to reduce file size.
2
votes
2answers
3k views

GDAL: Convert specific RGB (GeoTIFF) color to transparent

I have an RGB GeoTIFF file and I want to convert a specific RGB colour to transparent. I would like to use GDAL for doing this, but external Python scripts are also an option (though I haven't learned ...
6
votes
2answers
3k views

How should I use GDAL to perform a transformation?

Greetings, I am a student who wishes to use GDAL to transform a series of images from Lambert Conformal Conic (EPSG: 9802) to Google Earth's WGS 84 (EPSG: 4326) for a web mapping project. I know ...
4
votes
2answers
1k views

FWTools ogr2ogr in Python

I am trying to convert MapINFO tabs to ESRI Shapefiles using FW Tools. I downloaded the tools and can run the FW Tools Shell and convert no problem: ogr2ogr -f "ESRI Shapefile" ...
0
votes
1answer
200 views

Gdal: How to get a pixel's value from raster image?

Given a topographic raster image. Given a pixel's coordinate in pixel/lines or geocoordinate. How to get it's pixel value ?
6
votes
8answers
4k views

Splitting shapefile into separate shapefiles for each feature?

I have a polyline shapefile with about 20 kinds of roads. I would like to know how can I create automatically a vector file for each one. I can use ArcGIS for Desktop, QGIS (or GDAL separately).
5
votes
5answers
1k views

Python, shapely library: is it possible to do an affine operation on shape polygon?

I am trying to create a rotated rectangle in lat/lon coordinates. Basically I have the coordinates of the center and rotation angle around the center. Is it possible to do using, shapely or gdal, or ...
4
votes
2answers
404 views

gdalwarp in a bash shell for loop

I would like mask several images in bash shell, gdalwarp works for me as a simple single line command: gdalwarp -cutline mask.shp -cwhere 'kepnev="a.tif"' -crop_to_cutline a.tif a_masked.tif ...
3
votes
1answer
2k views

How do you open shapefiles with ogr2ogr

I'm following along the D3 tutorial, and on this line: ogr2ogr \ -f GeoJSON \ -where "adm0_a3 IN ('GBR', 'IRL')" \ subunits.json \ ne_10m_admin_0_map_subunits.shp run into the following ...
2
votes
1answer
108 views

QGIS says “osgeo [python-gdal]” isn't installed on Mac

I know similar questions have been asked (like this one) -- but I'm encountering a unique problem. I installed GDAL complete 1.11 from KyngChaos, but when I open QGIS, I get the following error ...
2
votes
1answer
300 views

Flattening JP2 files to single band (i.e. averaging bands)?

I have created thousands of png tiles using ArcGIS and have merged groups of them into large jp2 files for serving via GeoServer. I need to flatten these to a single band so that I can apply a colour ...
0
votes
1answer
809 views

How current is GDAL in Java

I have used the ogr2ogr to import various formats to Postgres and have used GDAL utilities. Is there a complete Java port for these tools? Or are they simply wrappers calling JNI to C++ code? I have ...
18
votes
6answers
5k 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 ...
19
votes
3answers
4k views

What is Lanczos resampling useful for in a spatial context?

GDAL includes a resampling method beyond the normal mix of nearest neighbor, bilinear, cubic and splines: "Lanczos windowed sinc resampling". I understand that its a convolution filter, but unlike ...
8
votes
3answers
9k views

How can I install gdal 1.9.0 on my linux ubuntu server 10.04

apt-get install python-gdal installs version 1.6.0 and this is already installed. I would like to install the 1.9.0 version. Do I have to de-install 1.6.0 first and then compile manually or is there ...
14
votes
3answers
6k views

What's the easiest way to install GDAL and OGR for Python?

I am developing some code in Python, and I want to use the GDAL/OGR python bindings. What is the minimum I need to install in order to use the GDAL and OGR python bindings? What is the easiest way to ...
2
votes
1answer
3k views

How to process GRIB2 Data for Visualization?

My goal is to extract wind information from data provided to me in the GRIB2 format as it has been done in the attached image. I was curious if anybody had any experience with this format. I'm not ...
10
votes
2answers
2k views

How to split shapefile per feature in Python using GDAL?

is it possible to split a shapefile per feature in python? (best would be a solution where i can temporarily save the resulting vector objects to the memory instead to disk). The reason: I want to ...
8
votes
1answer
950 views

Importing GDAL from Python window of ArcGIS for Desktop?

I am trying to run some Python code using the Python window in ArcGIS 10.1 that uses both the arcpy and gdal modules. However, when I try and import the gdal module I get an error: ImportError: No ...
5
votes
1answer
3k views

How to import a raster into PostGIS?

I'm trying to follow the instructions here to load a raster into a PostGIS database: python raster2pgsql.py -s 4269 -I -r *.tif -F myschema.demelevation -o elev.sql I understand that I replace * ...
3
votes
2answers
188 views

How practical is this workflow, tiling from a complex, multi-step GDAL VRT?

This is probably a cw-candidate, but here goes.. I've got 1002 ~100 MB (5000'x5000') .tif files in a state plane (transverse merc) projection comprising a county-wide, 1-ft aerial dataset. After two ...
5
votes
2answers
2k views

GDAL Python bindings not picking up OGR PostgreSQL driver

I have a windows server (Microsoft Windows Server 2003) with: Python 2.7, PostgreSQL 9.04-1, GDAL 1.8.1 (installed from the windows installer (gdal-18-1500-core.msi) hosted at ...
5
votes
2answers
2k views

Geoserver 2.1.1 with ECW support

I am trying to add ECW support into Geoserver 2.1.1 (also tried 1.7.7) but no luck so far. Does anyone have a step by step guide to add the ECW support ? (the one However, my understanding is that ...
3
votes
4answers
3k views

How do I use ogr2ogr to convert a GML to shapefile in Python

I am trying to convert a GML to an ESRI shapefile using ogr2ogr utility in a python script. I have successfully installed the GDAL/OGR package via osgeo but I am now struggling to find/understand ...
2
votes
1answer
182 views

How to run OGR in ArcGIS Scripts?

When I run my script outside ArcGIS it works because during execution script uses a GDAL and OGR modules from osgeo. When I use script as a tool in ArcGIS it does not work. In PySripter I can import ...
4
votes
1answer
279 views

How to apply “Band” settings using gdal Python bindings?

I am trying to replicate the gdal_translate command, but using pure Python: gdal_translate infile.tif outfile.tif -co COMPRESS=JPEG -co PHOTOMETRIC=YCBCR -co TFW=YES -b 1 -b 2 -b 3 I have ...
4
votes
2answers
428 views

What's the best projection for rasterization of random latitude and longitude data in the northern Atlantic?

I have a dataset in the WGS84 geographic coordinate system that I would like to interpolate along a grid using Python. It appears gdal_grid is not available through the Python bindings, so I plan to ...
4
votes
2answers
4k views

How to install stable GDAL on Ubuntu 11.10?

I am trying to install the stable ubuntu package from here https://launchpad.net/~ubuntugis/+archive/ppa/+packages on my ubuntu 11.10 server I have added the ubuntugis stable repository to server's ...
2
votes
1answer
192 views

How can I dynamically trim the informational border off of FAA sectional raster charts?

I'm trying to write a script that can automatically use GDAL to crop the informational border from the FAA's published sectional charts (GeoTIFF) found here: I know that I can use gdal_translate ...
2
votes
1answer
584 views

merge raster images: error message procedure not found

I am using QGIS 1.8.0. Whenever I try to merge raster images I get the following error message: Traceback (most recent call last): File "C:\PROGRA~1\Quantum GIS Lisboa\bin\gdal_merge.py", line 36, ...
7
votes
1answer
1k views

GDAL RasterizeLayer Doesn't Burn All Polygons to Raster

I am trying to burn a shapefile to a raster using GDAL's RasterizeLayer. I pre-create an area of interest raster from a different shapefile, given a specific pixel size. This AOI then serves as a base ...
4
votes
0answers
841 views

gdal ImportError in python on Windows

Trying to import gdal for Python 2.7.3 on Windows XP: >>> import gdal Traceback (most recent call last): File "<stdin>", line 1, in <module> File ...
4
votes
2answers
964 views

Translating grid to USGS .dem in C# via GDAL

I am attempting to translate ArcInfo binary grids to USGS DEM format (.dem). I have installed the GDAL .NET bindings thru this build installer. I can get to GDAL in my C# add-in I am working on. ...
3
votes
1answer
368 views

Get the geotransform in Mercator given a pixel size away from the origin

I have a radar image with the following information: The projection is Mercator (Mercator_1SP in GDAL) The projection origin is 0º lat 0º lon At a given geographic coordinates (e.g. lon=10º ...