Quantcast
Channel: Question and Answer » gdal
Browsing all 397 articles
Browse latest View live

Using GDAL/C++ to calculate distance in meters

I’m using GDAL in C++, with WGS84. I want to calculate distance between two points in meters. The code snippet below tries to find the distance between 25N/75E and 25N/76E. The code, as is, returns...

View Article


How to place an numpy array into GeoTIFF image using python-gdal

I am attempting to export data of varying scales into GeoTIFF images…a new method for me. The problem I’m running into is when using the GDT_Byte pixel type, data values < 0 and > 256 are not...

View Article


Does gdal_calc only support 26 input raster files at a time?

In gdal_calc.py, input files are specified with letters A-Z. Here are two files, input.tif and input2.tif, being averaged into result.tif: gdal_calc.py -A input.tif -B input2.tif --outfile=result.tif...

View Article

RuntimeError opening rasterio array in GDAL

I’ve opened a GeoTiff with rasterio: import rasterio with rasterio.open('Africa.tif') as src: transform = src.meta['transform'] array = src.read(1) array([[203, 203, 203, ..., 0, 0, 0], [203, 203, 203,...

View Article

GDAL Create Layer WFS

So I’m trying to write a program that has the ability to read and write data from a WFS (Web Feature Service) I’ve managed to pull all the data I want from the WFS. Now I’m trying to write to it and...

View Article


Image may be NSFW.
Clik here to view.

Gdal_calc works but I get a pyhon error at the end of each process

I have a problem while using gdal_calc by a .bat file. Here is the code : call “C:OSGeo4w64bino4w_env.bat” gdal_calc -A”D:tuilage_script_1tuilagendvi4_810000_6370000_820000_6360000_ndvi.tif” –calc=”A”...

View Article

Image may be NSFW.
Clik here to view.

gdal2tiles only rendering half of tif

I am using gdal2tiles.py to render map tiles of some data. The file I use is generated by combining a .tif and .tfw using gdal_translate XX.tif XXn.tif Whenever I open up the file in QGIS, I see all...

View Article

ReadRaster() C#

I am new with GDAL in c#. Can some body help me to uderstand the method band.ReadRaster(). I need to know wich one is the return in C# and as well some documentation about what it means each parameter...

View Article


Image may be NSFW.
Clik here to view.

How to average gdal_hillshades?

For some unknow reason, my average of 3 hillshades is very dark : gdaldem hillshade input.tif hillshades_C.tmp.tif -s 111120 -z 5 -az 315 -alt 60 -compute_edges gdaldem hillshade input.tif...

View Article


How to not process when query is outside the raster extent ? (Error when...

Given a West North East South bounding box, I want to crop this data from a hundreds of inputXX.tif. Nearly every times but once, the query first print out that it “falls completely outside raster...

View Article

gdal_array.SaveArray() leaves dataset open in Python

When I use gdal_array.SaveArray() to create a raster, the newly created dataset appears to stay open in Python, preventing other processes from working with it. For instance, consider the following...

View Article

Proper projection name for NAD83 2011 revision

I have two PRJ files, one from ESRI and another from some custom GDAL/OGR code I wrote (pasted below). I was trying to have both work in NAD83 UTM10N with the 2011 revision. The ESRI file has 2011 in...

View Article

Create GeoTIFF from JPG and JFW files with gdal

I have a JPG image and the corresponding geospatial information on a JFW wolrd file in a ETRS89 geodesical system and UTM coordinates (EPSG:25830) 5.0000000000 0.0000000000 0.0000000000 -5.0000000000...

View Article


Is there an open source solution to access raster layers in an ESRI...

I’m looking for a way to access raster layers in an Esri File-GeoDatabase without using ArcObjects or ArcPy, specifically I would like to access the raster layers with GDAL. I understand that the GDAL...

View Article

Vector to Raster using GDAL (gdal.RasterizeLayer) : Error in Output...

For rasterizing a vector layer, I have tried gdal.RasterizeLayer method for converting vector(shapefile) to raster(tiff). But its giving raster output with NAN values(complete black image). I need some...

View Article


How to make a movie from a ascii grid files?

Lets say I have several ascii grid files for each time step for a particular location. I would like to spit out the image for each of these ascii grid files and legend on the side bar. I also would...

View Article

GDAL raster shifting with python error: 'NoneType' object has no attribute...

I’m trying to shift a georeferenced raster by 0.5m N and 0.5m W in QGIS using the python console: from osgeo import gdal # Open in read/write mode rast_src = gdal.Open('test_raster.tif', 1) # Get...

View Article


Read raster at request size through Python

I’m trying to read the raster (tif) file using Python. What I want is to read the raster at a specific request size rather than its original resolution. Example: If a raster has a cellsize of 5 x 5, I...

View Article

Add hillshade to naip imagery

I’ve been searching for quite a while now. Is there a way to merge a hillshade image with an aerial image with gdal? I’m just trying to create a hillshaded aerial image.

View Article

Minidump on exit in QGIS (2.8.2- Wien) 64-bit version when using GDAL in plugin

I am working on a plugin for QGIS that is working fine on 32-bit versions but I am having some problems while using it on the 64-bit standalone installation package. I have tried on several machines...

View Article
Browsing all 397 articles
Browse latest View live