Re: [gdal-dev] reprojecting coastcolour (/meris) using python via GCPs

2014-02-17 Thread Anton Korosov
Hello Ivan, ReprojectImage() has a parameter psOptions() http://www.gdal.org/gdalwarper_8h.html#ad36462e8d5d34642df7f9ea1cfc2fec4 It should accept any of the warping options, e.g. '-tps' http://www.gdal.org/gdalwarp.html I'm not 100% sure (since I'm using Python) but it may work. I'll take thi

Re: [gdal-dev] reprojecting coastcolour (/meris) using python via GCPs

2014-02-18 Thread Anton Korosov
but using a VRT mechanism. maybe i can adapt this approach to get something working. thanks very much for the pointer -i -Message d'origine- De : gdal-dev-boun...@lists.osgeo.org [mailto:gdal-dev-boun...@lists.osgeo.org] De la part de Anton Korosov Envoyé : Monday, 17 February

Re: [gdal-dev] VRT creation from Python, adding existing geotiff as bands

2015-02-16 Thread Anton Korosov
Dear Rémi, you may want to look at our Python package NANSAT (https://github.com/nansencenter/nansat) which we build around the GDAL and especially VRT. We even have a separate class VRT() for creating, changing and using VRT files. More specific regarding your question, you can try to use the

Re: [gdal-dev] Getting warning when opening NetCDF file using gdal?

2015-06-30 Thread Anton Korosov
Hi! The format of the new OBPG OceanColor files is HDF5 (aka NetCDF4), so you should have your GDAL compiled with HDF5 support: http://www.gdal.org/frmt_hdf5.html Then you can access the content of the file using groups and variables syntax: gdalinfo HDF5:"A2015069035500.L2_LAC_OC.nc"://geop

Re: [gdal-dev] Getting warning when opening NetCDF file using gdal?

2015-06-30 Thread Anton Korosov
You can use 'ncdump -h A2015069035500.L2_LAC_OC.nc' ncdump is not part of gdal, but it will show you the contents of the dataset. In Python you can use netcdf4.Dataset to open HDF5 files. On 30/06/15 11:08, oz wrote: By specifying the chlor_a, it will just display all the info on chlor_a. But

[gdal-dev] Probably bug with HDF4-EOS driver

2016-08-10 Thread Anton Korosov
Dear GDAL developers, I was trying to access MODIS L1 data available e.g. here: ftp://ladsweb.nascom.nasa.gov/allData/6/MYD02HKM/ and since GDAL version (2.1.0) the values of Ground Control Points are completely wrong. GCPPixel and GCPLine are twice larger than should be and GCPX, GCPY are jus

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

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] 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

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

2011-08-05 Thread Anton Korosov
Hi Antonio! In python you'll probably have to open the dataset, loop through all bands, fetch description (or metadata) from each band and then decide if the required band exists. f = gdal.Open('HDF4_EOS:EOS_SWATH:"MOD021KM.A2010105.2120.005.2010106075131.hdf":MODIS_SWATH_Type_L1B:EV_1KM_Ref

Re: [gdal-dev] How to use gdalinfo for HDF

2011-08-05 Thread Anton Korosov
Hi! Looks like a syntax error. There should be a colon after EOS_GRID Try gdalinfo HDF4_EOS:EOS_GRID:"C:\filename.hdf":POSTEL:data1 At least that works at my Linux: gdalinfo HDF4_EOS:EOS_SWATH:"/host/gdaltest/MOD021KM.A2010105.2120.005.2010106075131.hdf":MODIS_SWATH_Type_L1B:EV_1KM_RefSB On

Re: [gdal-dev] Installing GDAL with GEOS and Python Bindings on Ubuntu Linux Natty Narwhal 11.04

2011-09-26 Thread Anton Korosov
Hi first install geos library using Ubuntu software center (libgeos, libgeos-dev) then download gdal source and configure it: ./configure --with-python -with-geos=yes then make sudo make install If that doesn't work give me a sign, I'll publish more detailed instructions. Good luck! Anton p

Re: [gdal-dev] subdatasets not read in a HDF file

2011-10-24 Thread Anton Korosov
Hi Joaquim! I'm curious why do you want to read cnt_pt_col and cnt_pt_row from a SeaWiFS file? These dataset (1D vectors, actually) only contains indexes of rows and columns for which latitude, longitude grids are given. And you can read lat/lon from GCPs. Or do you also feel that only ~100

Re: [gdal-dev] Warping onto an image with only GCPs

2011-12-16 Thread Anton Korosov
Hi! I'm not sure but probably my question is related to the one below. I'm trying to mosaic one MODIS images onto another with GDAL: gdal_translate HDF4_EOS:EOS_SWATH:"/Data/sat/GDAL_test/MYD021KM.A2011228.0925.005.2011229003113.hdf":MODIS_SWATH_Type_L1B:EV_1KM_RefSB -b 1 /data/modis1.tif gd

[gdal-dev] Warping onto an image with only GCPs with Python

2012-01-12 Thread Anton Korosov
ich is understandable because curvature of a MERIS images (given by GCPs) cannot be fully explained by few numbers in the geotransform. On 12/16/2011 03:56 PM, Anton Korosov wrote: Hi! I'm not sure but probably my question is related to the one below. I'm trying to mosaic o

[gdal-dev] Warping onto an image with only GCPs with Python

2012-01-13 Thread Anton Korosov
odis_reprojection_tool_swath > > Brian > > > On Thu, 2012-01-12 at 09:23 +0100, Anton Korosov wrote: >> Hello everyone! >> >> Some time ago I've asked about problems with gdalwarp (the e-mails >> below). I tried to utilize Python binding instead but got t

Re: [gdal-dev] numpy array to raster

2012-02-01 Thread Anton Korosov
Probably the problem is with data type. You obviously have data of float type and you give GDT_Byte to the gdal.GetDriverByName('GTiff').Create(). Either try to create array with Byte data or give GDT_Float32. In the latter case the produced geotiff will have 32 bits fo each pixel. It is not sup

Re: [gdal-dev] Geolocation Arrays ??

2012-02-08 Thread Anton Korosov
Hello Etienne! I also got such error when trying to process MODIS L1B images taken near the pole. Try to set some limited extent with the -te option for gdalwarp. It helped me, at least. Best regards! Anton On 02/07/2012 10:22 PM, Etienne Tourigny wrote: Even, Frank, thanks for your answer

[gdal-dev] Does GDAL API for Python use and in VRT?

2012-02-08 Thread Anton Korosov
Hello everybody! I'm trying to read values from a VRT file in Python. When I modify or it seem not to make any effect. I have a simple VRT of a Landsat7 file (below). It has neither scale nor offset. I launch the given script twice: 1st time to test the value of scale and the value from a

Re: [gdal-dev] Geolocation Arrays ??

2012-02-08 Thread Anton Korosov
that the value is correctly reprojected (the outlines of Florida are consistent). ==> Does this mean that gdalwarp -geoloc should always be used with -te option? Etienne On Wed, Feb 8, 2012 at 6:21 AM, Anton Korosov wrote: Hello Etienne! I also got such error when trying to process MODIS

Re: [gdal-dev] Loading a scaled rawfile via VRT

2012-02-16 Thread anton . korosov
Hi Solomon, I believe you can just specify the following tag within the ComplexSource: (of course setting the correct values) In this tag you can explicitly indicate the type of the source. For a more definite answer can you please give an example of the two VRT files that you create. Anton >

Re: [gdal-dev] python downsample API?

2012-04-11 Thread Anton Korosov
Hi Michael, I do that maybe in an awkward way but it saves time. 1. I create a VRT file (e.g. using CreateCopy) and open it using xml.etree.ElementTree.XML 2. I decrease rasterXSize and rasterYSize attributes of the VRTDataset tag 3. I also decrease xSize and ySize attributes of the DstRect ta

[gdal-dev] Magic number 441?

2012-04-16 Thread Anton Korosov
Dear list, what does the annoying error 'ERROR 1: Too many points (441 out of 441) failed to transform' mean? When I try to warp a MODIS image directly into tif it works perfect: gdalwarp -t_srs '+proj=latlong' -of GTiff -geoloc -te -4 51 14 66 -ts 900 1400 HDF4_SDS:UNKNOWN:"/data/A201210111

Re: [gdal-dev] gdal python script to calculate categories statistic

2012-04-17 Thread Anton Korosov
Hi Giuseppe, gdal_calc is built on operations with matrices using the Python module 'numpy' http://numpy.scipy.org/ Instead of digging into it I would suggest to study numpy functionality a bit. The following simple script somewhat solves your problem: import numpy as np """ you may data f

Re: [gdal-dev] Magic number 441?

2012-04-18 Thread Anton Korosov
utside the SRC image then gdaltranslate of the generated VRT file fails. That's obviously an error and I will create a ticket with examples and debugging output. So the solution for the problem is to set the BlockSize to the image size. With best regards! Anton On 04/16/2012 12:12 PM, A

Re: [gdal-dev] Reading a NetCDF file with python (not recognised as a supported dataset name

2012-06-08 Thread Anton Korosov
Hi Rutger, I remember I had similar problems when reading NetCDF in Windows. The solution in my case was pretty simple - I had to include the full path to the file in double quotes: Try this way (but replace this path with yours): ds = gdal.Open('NETCDF:"c:/data/LPRM-TMI_L3_DY_SOILM3_V001-2

Re: [gdal-dev] zonal statistics with gdal

2012-06-20 Thread Anton Korosov
Hi, though be prepared that converting large images into shape is quite slow. I would go opposite way: convert a shape to a raster [0, 1]; extract band from the image as another raster [2]; and then extract statistics using Numpy [e.g. 3]. [0] http://stackoverflow.com/questions/2220749/raste

Re: [gdal-dev] Read image from zip with python and GDAL

2012-07-03 Thread Anton Korosov
Dear Even, thank you very much for the info. I'm imressed by the gdal once again! Though I have a problem with LANDSAT tar.gz: fram:raw>tar -tf LT52280012006208KIS00.tar.gz L5228001_00120060727_B10.TIF L5228001_00120060727_B20.TIF L5228001_00120060727_B30.TIF fram:raw>gdalinfo /vsigzip/LT522800

[gdal-dev] how to create NETCDF with several 3D variables?

2012-07-23 Thread Anton Korosov
Dear list, how to create a NetCDF file with several variables that have more than two dimensions? I have to save time series of several fields (sst, chlorophyll, etc) in one file. I found that in order to create one 3D variable I can add NETCDF_DIM_EXTRA, NETCDF_DIM_time_DEF, NETCDF_DIM_time_

Re: [gdal-dev] how to create NETCDF with several 3D variables?

2012-07-23 Thread Anton Korosov
reate netcdf files from other formats, not write complex files. Anything else is a hack - better to use other tools if you want to combine bands, variables, etc. Etienne On Mon, Jul 23, 2012 at 2:07 PM, Chris Barker wrote: On Mon, Jul 23, 2012 at 7:50 AM, Anton Korosov wrote: how to create a N

[gdal-dev] Units of dimension variable in NetCDF is 'km'

2012-08-07 Thread Anton Korosov
Dear Etienne, I faced the following problem with the NetCDF driver: Units of the dimension variables are 'km' and values in the SRS are in meters, of course (e.g. Earth radius). Hence the calculated GeoTransform is 1000 times less than should be and the calculate latlons are incorrect. However

Re: [gdal-dev] Units of dimension variable in NetCDF is 'km'

2012-08-07 Thread Anton Korosov
imilar fix? Etienne On Tue, Aug 7, 2012 at 10:59 AM, Anton Korosov wrote: Hi! It seem to work fine with this patch. Should I make a ticket? Index: frmts/netcdf/netcdfdataset.cpp === --- frmts/netcdf/netcdfdataset.cpp (revis

[gdal-dev] order of dimension in HDF5 COSMO SKYMED driver?

2012-09-24 Thread Anton Korosov
Dear list, in gdal-dev archiveI found a question about COSMO SKYMED data which was obviously not answered: "COSMO delivers two kinds of HDF5 data: 1. Complex Dataset that is a [MxNx2] matrix. In this case the problem is that the gdal method Open() reads this Dataset not such as 2 Datasets of

Re: [gdal-dev] DODS building

2013-02-15 Thread Anton Korosov
Hello Juan Pedro Pérez! I've built GDAL 1.9.2 on Ubuntu with the default libdap from repositories: sudo apt-get install libdap11 sudo apt-get install libdap-dev ldconfig -p | grep libdap gives the following:     libdapserve

[gdal-dev] How to specify extent of a VRTWarpedDataset in Python?

2011-06-01 Thread Anton Korosov
Hi! we are developing software for automatic processing of satellite data and decided to base it mostly on GDAL-Python bindings. Can I ask you about options to create Warped VRT datasets in Python? 1. The command gdalwarp -t_srs '+proj=utm +zone=24 +datum=WGS84' -of VRT -tr 1000 1000 -te -10

Re: [gdal-dev] GDAL/OGR 1.8.1 Advance Warning

2011-06-28 Thread Anton Korosov
Hi Frank! There is a bug in the current Envisat driver which could be fixed in 1.8.1. Not all bands (MDS) are read properly from the MERIS Level 2 imagery. Below are last lines of the output of gdalinfo MER_RR__2PNPDK20110502_144833_24913102_00097_47956_7579.N1 MDSs are numbered from 1 to