GDAL tool for convert color map to grayscale?
I need command line tool (I prefer from gdal tools) that convert color map to grayscale Several algorithms are possible – see Three algorithms for converting color to grayscale blog posting by John D....
View Articleconvert GTiff to AAIGrid results in cell size switch
I don’t have a clue why the conversion of a tif to an asc has that kind of behavior: original tif metadata Size is 466, 427 Coordinate System is: PROJCS["ETRS89_UTM_zone_32N", ... Origin =...
View ArticleGDAL, Georeferencing
I have been trying to use GDAL library to add geoinformation to an image. From the documentation from GDAL web page I could find that I could use GDAlSetGeotransform(), for that I need a six parameters...
View Articlegetting strange “grid” artifacts when creating hillshades using gdaldem
I’m trying to create hillshades from Czech elevation data (Fundamental Base of Geographic Data of the Czech Republic (ZABAGED®) – altimetry – grid 10×10 m) – a demo files is available here:...
View ArticleHow to Read&Write .tiff images in java using GDAL library
I searched many sites to learn about this but I didn’t find anything. I need step by step process for reading .tiff monochromatic image in java using Gdal library.
View ArticleReprojecting from Lambert Conformal Conic into EPSG:3857?
I’m trying to reproject a plain png image file into EPSG:3857 for use in an OpenLayers application. I’m pulling the image from the NWS site at:...
View ArticleOgr2ogr trying to import and convert shapefile to EPSG:3857
I’m attempting to import a shapefile (along with .prj file) to MySQL using Ogr2ogr and using the t_srs option set to EPSG:3857 (the default for Leaflet and Google Maps) but I’m getting odd results, eg:...
View ArticleCan't import libraries to rsaga
I get this error when I’m trying to import a raster to RSAGA: > rsaga.import.gdal(paste(rast_name, ".tif", sep=""),"RASTER", env= my_env) Module 'GDAL: Import Raster' not found in SAGA library...
View ArticleArcMap: Unknown Spatial Reference fix with GDAL/Python
I have a .tif file that I created with Python and when I open it in ArcMap it says it doesn’t have spatial reference information. Is there a way to set the spatial reference with GDAL if I have a .prj...
View ArticlewriteOGR alters MultiPolygon holes
I’having trouble using writeOGR to write GeoJSON files, when there are MultiPolygon objects. Here is an example: I’m creating a SpatialPolygonsDataFrame object from GeoJSON, with a single feature made...
View ArticleCalculating NDVI with Rasterio
I’m using Rasterio to read GeoTIFF files from Landsat 8 and calculate NDVI into a new GeoTIFF file. My code looks like this: import numpy import rasterio import subprocess with...
View Articledissolve polygons of GeoJSON with gdal/ogr
I have a GeoJSON with only polygons in it. I have to dissolve (merge) the polygons with the same “DN”-value. I found out that you can do it with shapefiles like this: ogr2ogr outputfile.shp...
View Articleuse gdal python bindings from the QGIS folder in a custom script
I have QGIS installed (on Windows) and can import this line from the QGIS Python console: from osgeo import gdal When I try the import in a python file it doesn’t work Traceback (most recent call...
View Articlechange projection in an ascii (x,y,z) file
I am having an ASCII file (lat,long,depth) in the Mars projection. I need this file to be converted into WGS-84 projection. How can I do the conversion for the ASCII files.
View ArticleInterpolation using GDAL
I am looking for some hints here. There is a shape file with point data of rainfall sampled at a regular grid, and there is a shape file with point data of soil attributes sampled at a regular grip but...
View ArticleHow do I access GeoTransform array from gdal on the command line?
I’m using the gdal library via OSGeo for windows, and I was just wondering how to access the geotransform array for a .ecw file.
View ArticleRead HDF4 data using python
I am now working with VIIRS/NPP Active Fires by using python gdal. But I cannot read the data inside the files. Filename = “NPP_AVAF_L2.A2012019.0600.P1_03110.2014057125956.hdf” Here is some...
View Articleread tiff to bmp in c# got only white image
i want to convert a tif image to bmp i was following tutorial in https://trac.osgeo.org/gdal/wiki/GdalOgrCsharpRaster but i dont get an image i want to see the code is : // Creating a Bitmap to store...
View Articleconnect gdal-java with tomcat
I am trying to run: SpatialReference poSourceSRS = new SpatialReference(); poSourceSRS.ImportFromEPSG(4326); String unit = poSourceSRS.GetAttrValue("UNIT"); System.out.println("unit: " + unit); on a...
View ArticleERROR 6: The PNG driver does not support update access to existing datasets
I was trying to overlay a shapefile to some raster images from a directory using gdal_rasterize. But then encountered this error ERROR 6: The PNG driver does not support update access to existing...
View Article