Re: [gdal-dev] help resampling raster to coarser scale

2011-08-04 Thread Anton Korosov
Hi Etienne! What if you first process the original fine resolution image with a filter (low-pass, median, or manually created pixel function). Then the result, which is a fine resolution image but smoothed, could be resampled with the nearest neighbor. Anton On 08/05/2011 03:57 AM, Etienne

[gdal-dev] problem rasterizing categorical data from shapefile - 0 values at some intersections

2011-08-04 Thread Etienne
Hi all, I am trying to create a raster file with categorical data (land vegetation/cover positive indices) from a shapefile containing 1 layer of polygons.   I use the following command:  gdal_rasterize  -tr 0.0005 0.0005  -a_nodata -1 -of GTiff  -a_srs EPSG:4618 -a "CLASSE_ID" -ot Byte -init

[gdal-dev] help resampling raster to coarser scale

2011-08-04 Thread Etienne
Hi all, I am trying to resample a raster with categorical data (land surface vegetation/cover) from a high resolution (500m) to a coarser resolution.    I would like to do something similar to what the GRASS operator r.resamp.stats does, using the modal category present in the higher resolutio

[gdal-dev] Error linking GDAL library in Eclipse C/C++ for Ubuntu

2011-08-04 Thread Sebastian Villarroya
I am trying to build a C++ project that uses GDAL in Eclipse IDE C/C++ for Ubuntu. I have installed libgdal 1.7.3 provided by Ubuntugis using Synaptics Package Manager. I wrote a dummy code to test this installation #include #include "gdal_priv.h" #include "cpl_conv.h" // for C

Re: [gdal-dev] gdalwarp under python

2011-08-04 Thread Chaitanya kumar CH
Balazs, If you want to programatically perform the actions of gdalwarp, it's best to go through the code of grapwarp.cpp http://trac.osgeo.org/gdal/browser/trunk/gdal/apps/gdalwarp.cpp There are some more test scripts you can refer, if you want to do this through command line. http://trac.osgeo.o

[gdal-dev] gdalwarp under python

2011-08-04 Thread Balazs Szabó
Dear list! How can I use this two bash command with gdal-python bindings? gdal_translate -of GTiff -a_srs EPSG: -gcp 775 560 20.58329 48.12650 -gcp 9518 539 20.8329 48.12650 -gcp 9525 7136 20.83329 48.00150 -gcp 758 7134 20.58329 48.00150 o.tif s.tif gdalwarp -tps s.tif t.tif [I can done

Re: [gdal-dev] Compilation of gdal for reading hdf4 with python

2011-08-04 Thread Anton Korosov
Hi! Please read these pages of docs written by our programmer who have installed GDAL with HDF4 support on Windows. They were fastly developed rather for internal use but you might find them helpful. https://docs.google.com/document/pub?id=1cRaLQXoWh-Q6bRvkLq1t6ZUxk9Wae5eXd4_KpTeBbBw Don't h

Re: [gdal-dev] Checking if a label exists in a HDF file

2011-08-04 Thread Anton Korosov
Hi, Antonio! You can do that with the gdalinfo command prior to running a python script: gdalinfo MODIS_FILE.hdf | grep EV_1KM_RefSB | wc -l returns a number if subdataset EV_1KM_RefSB exist return 0 if not. triton:gdaltest>gdalinfo MYD02QKM.A2010217.1335.005.2010218190207.hdf | grep EV_1KM_Re

[gdal-dev] Checking if a label exists in a HDF file

2011-08-04 Thread António Rocha
Greetings I have a Python Script where I call gdalwarp binary (in Windows) to warp an image. But, before I run the gdalwarp I need to check if the file exists (DONE) and if a defined HDF layer exists. How can I check, using gdal, in a Script if a certain layer exists? THanks Antonio __