Tagged Questions

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

1
vote
4answers
556 views

Get vector features inside a specific extent

The problem: I have a very large vector layer with many features and a much smaller raster layer in a defined region. I want to get only those vector features which are within the raster layers ...
2
votes
2answers
527 views

Why do I get different output from gdal2tiles vs. maptiler?

I am trying to generate map tiles using gdal2tiles for an area much larger than MapTiler can handle. However, my tile caches are not showing up on the maps. I checked gdal2tiles by running the same ...
7
votes
1answer
2k views

How to get raster corner coordinates using Python GDAL bindings?

Is there a way to get the corner coordinates (in degrees lat/long) from a raster file using gdal's Python bindings? A few searches online have convinced me that there is not, so I have developed a ...
2
votes
0answers
102 views

efficiently slicing tiles with gdal C API

Im working a project using the gdal C api(in a block of objective-c) to slice TMS style png tiles. The code currently works, but I'm running into some trouble optimizing to run fast enough for use on ...
1
vote
0answers
171 views

using GDAL/OGR (faster)

Eventually, I was able to get the GDAL installed and compiled correctly using Visual C++ 2010. I even tested some of its methods on some geo-referenced raster files, and it looks like that all is ...
2
votes
1answer
125 views

gdal_retile.py tile naming scheme

Is there a way to define custom tile names during a gdal_retile.py process, other than the default _01_01. For instance, suppose I want to start naming my tiles at 100_100, is this possible?
0
votes
1answer
158 views

How to save image to disk with with gdal_translate?

I do: import os from gdal import * filename = 'c:/rast.jpg' outputTif = 'c:/rastOut.tif' os.system('gdal_translate filename outputTif') but it returns "1". gdal_translate doesn't save the image ...
1
vote
1answer
87 views

gdal_retile.py and gdal_translate Requirements

I basically need to use two GDAL utilities: gdal_retile.py and gdal_translate, on a Solaris 9 machine. I have tried compiling GDAL from sources, but this seems not to be working. So, since I have ...
0
votes
2answers
184 views

Handling MODIS NoData cells with gdalwarp

I'm using the gdalwarp tool to convert MODIS .hdf into GeoTiff files. I want to set the value of the nodata cells so that when I import the .tif image into Grass there is no black edge. I'm using the ...
1
vote
1answer
1k views

Python GDAL: Write new raster using projection from old

If I read in a raster image as an array, then make some changes to the values in the array, how do I then save the array as a raster with the same projection information as the original array? In ...
1
vote
2answers
956 views

Merging many rasters using Python

I have a list of many many rasters. I want to have a simple and easy to understand script that takes this and merges it into one big mosaic. I found a similar question but the accepted answer adivises ...
0
votes
1answer
253 views

gdaladdo positive and negative aspects?

I read and I read opinions and topics regarding this tool but I am still unclear if I should us this or not. In my project I have thousands off tiff files which need to be put on a map. The problem ...
0
votes
1answer
577 views

How to clip raster by multiple polygons in multi rasters?

Using QGIS, I want to clip a raster by multiple polygons contained in a single shapefile. I read that gdalwarp can clip my raster by multiple polygons BUT the output is a single merged clipped raster. ...
3
votes
1answer
120 views

Differences in raster extents in gdalinfo, SAGA & Quantum after resampling

I recently resampled a raster file using SAGA's Resampling module. The aim was to widen the extent of the new raster to two decimal places, where the original raster has three decimal places. The ...
1
vote
1answer
1k views

QGIS can't find osgeo after GDAL upgrade

Mac OS 10.6.8: I installed QGIS 1.8.0 with GDAL 1.8; then another app requires GDAL 1.9 and installed it; now QGIS can't find osgeo [python-gdal]. (I can't find any trace of GDAL 1.8 left in my ...
1
vote
0answers
124 views

Normalize with gdal_translate

I do not understand the command line when I try to work with gdal_translate in QGIS. I found this at the forum: Normalize raster values to 0-255 And tried this: *"If not, from within QGIS choose ...
3
votes
0answers
247 views

How to create raster attribute table to a raster data using gdal python?

I classified a remote sensing data and saved it as a raster using Gdal python. I want to create a raster attribute table for this classified result.. my classified raster has five classes with ...
10
votes
2answers
5k 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?
4
votes
3answers
5k views

How can I get the proj4 string or EPSG code from a shapefile .prj file? [duplicate]

I have to work with a shapefile defined in an unusual projection, which my GIS software does not know about. How can I get the proj4 definition or the EPSG code for the projection?
1
vote
1answer
94 views

GeoDjango - Use GDAL python binding in the shell

I would like to use the GDAL python binding in my GeoDjango site. The aim of this is to use ogr2ogr capabilities in a script. I am on windows 7 so I have installed GDAL-1.9.2.win32-py2.7 downloaded ...
3
votes
1answer
841 views

How to install GDAL 1.10 with OGR SQLite driver support on Ubuntu?

How can I install GDAL 1.10 with OGR SQLite driver support, and JPEG and PNG drivers per http://www.gdal.org/frmt_mbtiles.html
3
votes
3answers
2k views

GDAL_translate: converting ESRI GRID to Geotiff in batch

The Challenge: To batch convert 1000 rasters in ESRI Grid binary to Geotiff using either using a batch file or Python 2.7 without ArcGIS/Arcpy module. The Tools: Win7Pro, GDAL 1.9.2 (via OSGeo4W), ...
1
vote
0answers
208 views

How can I fix badly specified geographic coordinate system with units in arc-seconds?

Check out this depth-to-rock soil data. It is linked from here. The spatial reference system is a latlon, but the units are arcseconds. I could not reason out how to override the SRS even after ...
3
votes
1answer
536 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 ...
1
vote
1answer
406 views

How do i use gdal2tiles for creating tilecache?

I want to create tiled cache from raster file, so i downloaded gdal2tiles.py. Now i don't get what (and how) i must do with that python script file.
0
votes
1answer
199 views

multispectral images (Band Sequential format)

How can I create a multispectral image file (in band sequential (BSQ) format), from several 1-band images, using GDAL libraries? I work with C++ language. Thanks for your attention.
4
votes
2answers
820 views

Cartesian world sized projection WKT/EPSG code?

I am after the EPSG code or Well Known Text (WKT) of a projection that puts the centre of the earth a 0,0,0 and each point is a cartesian XYZ distance from that. My existing data is in WGS84 ...
3
votes
1answer
239 views

Setting Band Statistics on Raster Image (GeoTIFF)

After doing calculations on a raster and saving it, the image statistics are wrong and need updating. I find examples saying that this should do the job, like in this example: ...
4
votes
2answers
982 views

GDAL does not ignore NoData value

I am trying to calcualate the statistics of a TIFF. The script should ignore the NoData value, but doesn't. What causes this? import gdal from gdalconst import * # register all of the drivers ...
0
votes
2answers
100 views

OGR GetX() returns always zero

I am trying to get the first x-coordinates of a polygon. However I only get zero in return. What could cause that? import os, sys, gdal, ogr from gdalconst import * driver = ...
2
votes
1answer
212 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
223 views

OGR CreateLayer returns TypeError

I'm trying to create a shapefile layer based on the spatial projection of an already existing raster. (Ultimately, this will be used in gdal.Polygonize to get a shape from my raster data.) However, I ...
6
votes
1answer
435 views

ISIS to GDAL to QGIS: Georeferencing Mars Images

I'm trying to use QGIS to view some images from the Mars Reconnaissance Orbiter Context Camera. I use ISIS3 to download the images and convert them to mapped .cub files, following the instructions ...
3
votes
1answer
276 views

Python - OGR: Distance different than in ArcGIS

I want to determine the shortest distance between a point and a line. I use the following Python script to do so. If I compare the result of the script with the result of ArcMap's Near Analysis, I get ...
4
votes
1answer
329 views

OGR Info - Check for spatial index?

If we want to get information about a vector layer (shapefile for example) we could use ogrinfo: ogrinfo -so myshapefile.shp mylayer This returns a lot of pertinent information about the shapefile. ...
1
vote
1answer
272 views

Rasterize vector with gdal

"I would like to calculate the Euclidian distance from a residence to a public service of interest e.g. the distance from a residence to a green space (as the crow flies) in QGIS. After browsing the ...
4
votes
1answer
613 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 ...
1
vote
1answer
179 views

How do I install the las2ogr tool from liblas in Windows using the osgeo4w installer?

I was wondering if anyone has used the LAS2OGR tool? I heard about this from a previous post. The webpage gives the usage: http://www.liblas.org/utilities/las2ogr.html las2ogr -i mydata.las -o ...
2
votes
1answer
2k views

Installing GDAL with Java Bindings (gdal.jar) on Ubuntu 12.10

I am trying to build a postgis importer for mutliple shapefiles. After geotools took orders of magnitude longer than shp2pgsql to import my data, I decided to attempt to use the java bindings to GDAL ...
4
votes
1answer
171 views

Programmatic raster-vector calculation

I currently use GRASS' r.mapcalc to find the difference between vector and raster data using a loop and temporary files and layers. Is it possible to do the core calculation between raster with a ...
3
votes
1answer
484 views

How to import ECW into my postgis database with raster2pgsql (windows)

I'm working on windows 7 64 bits, postgis 2.01. I have to import ECW files into my postgis database. Unfortunatly, my postgis seems to has been compiled without gdal ecw support.When i do a ...
2
votes
1answer
107 views

Create ERDAS IMG Statistics using GDAL C++ API?

I want to create very many ERDAS .img files using GDAL under C++. I don't want to have to process them all in ArcMap to create statistics for them (mainly because ArcMap fumbles when calculating ...
1
vote
0answers
175 views

Question about geotiffs

My colleague and I are georeferencing a bunch of .tif images. After each image, we'll click "update georeferencing". The resultant .tif files are different between our computers and I'm trying to ...
1
vote
0answers
125 views

Are there limitations with gdal virtual raster option?

I am new at Postgis and I'm groping... I pretend to rasterize some weighty vector layers in Postgis, do some map algebra and reclassification with them and visualize intermediate as well as final ...
4
votes
1answer
347 views

Problem converting georeferenced jpgs to geotiff - image is shifted/warped

I have hundreds of georeferenced jpgs in ArcGIS 10 that I need to convert to geotiffs. I'm trying to use GDAL translate to create geotiffs from them. Everything works great except that the ...
0
votes
1answer
219 views

Geostationary satellite projection to be introduced in GDAL

I'm working on raster files and their spatial reference system is: PROJCS["Geostationary_Satellite", GEOGCS["GCS_Unknown datum based upon the custom ellipsoid", DATUM["D_Not specified ...
0
votes
1answer
84 views

gdal_contour creates an empty shapefile

I am running: gdal_contour -a elev hazard_interp4.asc haz_ak_contour_4_10 -i 10 the hazard_interp4.asc file has values in band 1 (singel band gray). With the above command, I get a shapefile that ...
0
votes
1answer
157 views

gdalwarp cant find libproj.dlib

Thought I had finally got Python, gdal and QGIS to play nicely together but just tried to do a batch transform using a bash script to call gdalwarp and it claimed it couldn't read the libproj.dlib ...
1
vote
0answers
95 views

Coarse heat map placement using gdal

I have generated a coarse heatmap of where data is available by 1 degree x 1 degree cells that I want to overlay on top of a world image. Using a python script I merged two images (heat map and a ...
0
votes
1answer
433 views

Most optimal algorithm for contour correctness?

Am creating an app which correctly calculates contours from a DEM file or any height-map given to it. The correctness of the contour holding the most importance, since a person viewing the contours ...