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 ArticleHow 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 ArticleDoes 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 ArticleRuntimeError 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 ArticleGDAL 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 ArticleGdal_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 Articlegdal2tiles 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 ArticleReadRaster() 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 ArticleHow 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 ArticleHow 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 Articlegdal_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 ArticleProper 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 ArticleCreate 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 ArticleIs 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 ArticleVector 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 ArticleHow 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 ArticleGDAL 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 ArticleRead 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 ArticleAdd 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 ArticleMinidump 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