Re: [gdal-dev] OGR Geometry methods

2011-07-11 Thread Chaitanya kumar CH
Marius,

Please do file a ticket with a small shapefile that shows this error.
http://trac.osgeo.org/gdal/newticket

On Tue, Jul 12, 2011 at 8:30 AM, Marius Jigmond
wrote:

> **
> After some more investigation that is likely NOT the issue. I have an
> ExecuteSQL statement which selects a certain polygon based on an attribute
> value. Unfortunately it seems to return the wrong feature. The feature I
> query for is unique so a duplicate is out of the question. Here's the code:
>
> #!/usr/bin/python
>
> from osgeo import ogr
> import sys, math, time, os
>
> aquifer = '/data/romania/judeteEPSG3844.shp'
> aqDS = ogr.Open(aquifer)
> sql = 'select * from judeteEPSG3844 where DENJUD = "CLUJ"'
> aqLayer = aqDS.ExecuteSQL(sql)
> feat = aqLayer.GetFeature(0)
> print aqLayer.GetFeatureCount()
> print feat.GetField('DENJUD')
> aqDS.ReleaseResultSet(aqLayer)
>
> The result:
> marius@mobi:~/temp$ run_sql.py
> 1
> TELEORMAN
> marius@mobi:~/temp$
>
> This explains why none of my centroids were remotely close to the polygon.
>
> Is there something wrong with my query or should I file a bug?
>
> -marius
>
>
> On Mon, 2011-07-11 at 20:46 -0500, Marius Jigmond wrote:
>
> I suppose a piece of code speaks louder :):
>
> xsect = False
> for i in range(gridLayer.GetFeatureCount()):
>   feat = gridLayer.GetFeature(i)
>   geom = feat.GetGeometryRef()
>   point = geom.Centroid()
>   for j in range(aqLayer.GetFeatureCount()):
> aqfeat = aqLayer.GetFeature(j)
> aqgeom = aqfeat.GetGeometryRef()
> if point.Intersect(aqgeom):
>   xsect = True
>   print 'ibound = 1'
>   break
>   if xsect:
> feat.SetField('IBOUND', 1)
> gridLayer.SetFeature(feat)
> xsect = False
>
> -marius
>
> On Mon, 2011-07-11 at 20:34 -0500, Marius Jigmond wrote:
>
> Hi everyone,
>
> I am trying to test whether centroids of polygons lie/intersect within
> another polygon. I have tried Intersect, Within, and Contains but they
> always return false. Should these methods work for my intended purpose or do
> I need to implement a point in polygon function? Thanks.
>
> -marius
>
> ___
> gdal-dev mailing 
> listgdal-dev@lists.osgeo.orghttp://lists.osgeo.org/mailman/listinfo/gdal-dev
>
>  ___
> gdal-dev mailing 
> listgdal-dev@lists.osgeo.orghttp://lists.osgeo.org/mailman/listinfo/gdal-dev
>
>
> ___
> gdal-dev mailing list
> gdal-dev@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



-- 
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] OGR Geometry methods

2011-07-11 Thread Marius Jigmond
After some more investigation that is likely NOT the issue. I have an
ExecuteSQL statement which selects a certain polygon based on an
attribute value. Unfortunately it seems to return the wrong feature. The
feature I query for is unique so a duplicate is out of the question.
Here's the code:

#!/usr/bin/python

from osgeo import ogr
import sys, math, time, os

aquifer = '/data/romania/judeteEPSG3844.shp'
aqDS = ogr.Open(aquifer)
sql = 'select * from judeteEPSG3844 where DENJUD = "CLUJ"'
aqLayer = aqDS.ExecuteSQL(sql)
feat = aqLayer.GetFeature(0)
print aqLayer.GetFeatureCount()
print feat.GetField('DENJUD')
aqDS.ReleaseResultSet(aqLayer)

The result:
marius@mobi:~/temp$ run_sql.py 
1
TELEORMAN
marius@mobi:~/temp$ 

This explains why none of my centroids were remotely close to the
polygon.

Is there something wrong with my query or should I file a bug?

-marius

On Mon, 2011-07-11 at 20:46 -0500, Marius Jigmond wrote:

> I suppose a piece of code speaks louder :):
> 
> xsect = False
> for i in range(gridLayer.GetFeatureCount()):
>   feat = gridLayer.GetFeature(i)
>   geom = feat.GetGeometryRef()
>   point = geom.Centroid()
>   for j in range(aqLayer.GetFeatureCount()):
> aqfeat = aqLayer.GetFeature(j)
> aqgeom = aqfeat.GetGeometryRef()
> if point.Intersect(aqgeom):
>   xsect = True
>   print 'ibound = 1'
>   break
>   if xsect:
> feat.SetField('IBOUND', 1)
> gridLayer.SetFeature(feat)
> xsect = False
> 
> -marius
> 
> On Mon, 2011-07-11 at 20:34 -0500, Marius Jigmond wrote:
> 
> > Hi everyone,
> > 
> > I am trying to test whether centroids of polygons lie/intersect
> > within another polygon. I have tried Intersect, Within, and Contains
> > but they always return false. Should these methods work for my
> > intended purpose or do I need to implement a point in polygon
> > function? Thanks.
> > 
> > -marius 
> > 
> > ___
> > gdal-dev mailing list
> > gdal-dev@lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/gdal-dev
> 
> ___
> gdal-dev mailing list
> gdal-dev@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] OGR Geometry methods

2011-07-11 Thread Marius Jigmond
I suppose a piece of code speaks louder :):

xsect = False
for i in range(gridLayer.GetFeatureCount()):
  feat = gridLayer.GetFeature(i)
  geom = feat.GetGeometryRef()
  point = geom.Centroid()
  for j in range(aqLayer.GetFeatureCount()):
aqfeat = aqLayer.GetFeature(j)
aqgeom = aqfeat.GetGeometryRef()
if point.Intersect(aqgeom):
  xsect = True
  print 'ibound = 1'
  break
  if xsect:
feat.SetField('IBOUND', 1)
gridLayer.SetFeature(feat)
xsect = False

-marius

On Mon, 2011-07-11 at 20:34 -0500, Marius Jigmond wrote:

> Hi everyone,
> 
> I am trying to test whether centroids of polygons lie/intersect within
> another polygon. I have tried Intersect, Within, and Contains but they
> always return false. Should these methods work for my intended purpose
> or do I need to implement a point in polygon function? Thanks.
> 
> -marius 
> 
> ___
> gdal-dev mailing list
> gdal-dev@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

[gdal-dev] OGR Geometry methods

2011-07-11 Thread Marius Jigmond
Hi everyone,

I am trying to test whether centroids of polygons lie/intersect within
another polygon. I have tried Intersect, Within, and Contains but they
always return false. Should these methods work for my intended purpose
or do I need to implement a point in polygon function? Thanks.

-marius
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] GML without geometry export forward shapefile with null geometry

2011-07-11 Thread aperi2007

Il 10/07/2011 23:19, Even Rouault ha scritto:

Le samedi 09 juillet 2011 21:04:25, aperi2007 a écrit :
Andrea,

Yes, I've confirmed that the GML driver doesn't handle wkbNone layers in a
optimal way. I've created http://trac.osgeo.org/gdal/ticket/4154 and commited
the appropriate fixes.

Best regards,

Even



Hi Even,

your patch work very well.

Regard,

Andrea.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] gdalnumeric problems with Python 3.2 Windows 7 64 bit

2011-07-11 Thread Isaac Gerg
Just ignore this.  Its from a colleague of mine. I reposted because for some
reason his message did not get posted to the list in a timeframe close to
when my messages are posted.

Apologies.

On Mon, Jul 11, 2011 at 1:55 PM, ELLIOT JAY RILEY  wrote:

> Hi everyone,
>
> I am using GDAL 1.8.1 with Python 3.2 on Windows 7 64-bit (
> http://www.gisinternals.com/sdk/PackageList.aspx?file=release-1600-x64-gdal-1-8-mapserver-6-0.zip).
>
>
> I am using the code at
> http://adventuresindevelopment.blogspot.com/2008/12/python-gdal-adding-geotiff-meta-data.html
>  and
> WriteArray() is giving me the following error builtins.ImportError: No
> module named gdalnumeric, File
> "C:\Python32\Lib\site-packages\osgeo\gdal.py", line 986, in WriteArray
>   import gdalnumeric.
>
> Why is the import for gdalnumeric not working?
>
> Thanks in advance,
> Elliot
>
> ___
> gdal-dev mailing list
> gdal-dev@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

[gdal-dev] gdalnumeric problems with Python 3.2 Windows 7 64 bit

2011-07-11 Thread ELLIOT JAY RILEY
Hi everyone,
I am using GDAL 1.8.1 with Python 3.2 on Windows 7 64-bit
().
  
I am using the code at 

 and WriteArray() is giving me the following error builtins.ImportError: No 
module named gdalnumeric, File "C:\Python32\Lib\site-packages\osgeo\gdal.py", 
line 986, in WriteArray  import gdalnumeric.
Why is the import for gdalnumeric not working?
Thanks in advance,Elliot
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] gdalnumeric problems with Python 3.2 Windows 7 64 bit

2011-07-11 Thread Isaac Gerg
Thank you!

On Mon, Jul 11, 2011 at 4:13 PM, Tamas Szekeres  wrote:

> Isaac,
>
> I've took a chance to install the numpy-amd64 packages from the site you
> mentioned. If the things are going well the tomorrow builds will contain the
> numpy enabled gdal win64 packages.
>
> I should however mention that I have some negative experiences with the
> numpy enabled GDAL (WIN64) packages since the GDAL python tests were
> crashing with this option, when I was trying to include this this last time.
> So in case if the tests are not working well, I must revert this addition
> and remove numpy from the Win64 setup. (The Win32 GDALpackages already
> contain numpy at http://www.gisinternals.com/sdk)
>
> Best regards,
>
> Tamas
>
>
>
>
>
> 2011/7/11 Isaac Gerg 
>
>> Im not sure I understood your original message.  In any case, I have it
>> working now though I used a different GDAL build than the one down by Tamas.
>>
>>
>> I uninstalled Tamas' build (had to delete a few files in the site-packages
>> directory) and then install the GDAL libs from here:
>>  http://www.lfd.uci.edu/~gohlke/pythonlibs/
>> GDAL-1.8.1.win-amd64-py3.2.‌exe
>>   [6.6 MB]  [Python 3.2]  [64 bit]  [Jul 08, 2011]
>>
>> My code now works!
>>
>> Isaac
>>
>> On Mon, Jul 11, 2011 at 2:47 PM, Even Rouault <
>> even.roua...@mines-paris.org> wrote:
>>
>>> Le lundi 11 juillet 2011 20:40:56, Isaac Gerg a écrit :
>>> > Hmmm.. I just downloaded numpy from here:
>>> > http://www.lfd.uci.edu/~gohlke/pythonlibs/ the 64bit windows one
>>> without
>>> > MKL.
>>> >
>>> > I installed it successfully and then reran the code.  Same error.  Any
>>> > ideas?
>>>
>>> Yes, as I said in my previous answer, you need numpy at your side, but
>>> that's
>>> not enough. The GDAL python bindings need to be rebuilt against a python
>>> with
>>> numpy installed. So some extra work would be needed on Tamas side.
>>>
>>
>>
>
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] gdalnumeric problems with Python 3.2 Windows 7 64 bit

2011-07-11 Thread Tamas Szekeres
Isaac,

I've took a chance to install the numpy-amd64 packages from the site you
mentioned. If the things are going well the tomorrow builds will contain the
numpy enabled gdal win64 packages.

I should however mention that I have some negative experiences with the
numpy enabled GDAL (WIN64) packages since the GDAL python tests were
crashing with this option, when I was trying to include this this last time.
So in case if the tests are not working well, I must revert this addition
and remove numpy from the Win64 setup. (The Win32 GDALpackages already
contain numpy at http://www.gisinternals.com/sdk)

Best regards,

Tamas





2011/7/11 Isaac Gerg 

> Im not sure I understood your original message.  In any case, I have it
> working now though I used a different GDAL build than the one down by Tamas.
>
>
> I uninstalled Tamas' build (had to delete a few files in the site-packages
> directory) and then install the GDAL libs from here:
> http://www.lfd.uci.edu/~gohlke/pythonlibs/
> GDAL-1.8.1.win-amd64-py3.2.‌exe
>   [6.6 MB]  [Python 3.2]  [64 bit]  [Jul 08, 2011]
>
> My code now works!
>
> Isaac
>
> On Mon, Jul 11, 2011 at 2:47 PM, Even Rouault <
> even.roua...@mines-paris.org> wrote:
>
>> Le lundi 11 juillet 2011 20:40:56, Isaac Gerg a écrit :
>> > Hmmm.. I just downloaded numpy from here:
>> > http://www.lfd.uci.edu/~gohlke/pythonlibs/ the 64bit windows one
>> without
>> > MKL.
>> >
>> > I installed it successfully and then reran the code.  Same error.  Any
>> > ideas?
>>
>> Yes, as I said in my previous answer, you need numpy at your side, but
>> that's
>> not enough. The GDAL python bindings need to be rebuilt against a python
>> with
>> numpy installed. So some extra work would be needed on Tamas side.
>>
>
>
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] FileGDB OGR driver test

2011-07-11 Thread Jeff McKenna

Hello everyone,

Today I am also testing the FileGDB support, and I was surprised to find 
that a wiki page in GDAL's 'buildhints' section had not been created, to 
record all of this great testing and discussionso others don't need 
to search the mailing list. I have begun the document here, with my 
Windows notes: http://trac.osgeo.org/gdal/wiki/FileGDB


Please anyone that has went through testing already please update that 
page with your own notes.


(I'd like to see this creating-a-buildhints-page as mandatory for any 
new format)


Thanks!

-jeff


--
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/


On 11-04-04 12:05 AM, Ragi Burhum wrote:

Hello list,

I am trying to test a new version of the FileGDB driver for OGR, but I
lack enough FileGDBs to test :)
If you have an *ArcGIS 10* FileGDB and would like to test the FileGDB
driver (and report back), feel free to grab a gdal-trunk binary I made
for Windows.

All I want to know is if it works with polygons and lines, so feel free
to test it with those types.

Known issues with build / FileGDB driver

- (driver issue) blobs and date fields are not handled at all
- (driver issue) read-only (for now)
- (build issue) I didn't include geos (means spatial operations will be
bounding-box based)
- (build issue) I didn't include the proj libraries (means a change of
coordinate system will not work)

you can use it like this:

//create kml from FileGDB class
ogr2ogr -f "KML" out2.kml
C:\Users\rburhum\Desktop\FileGDB_API_VS2008_1_0beta3\samples\data\ExecuteSQL.gdb
"Cities"

//create shapefile
ogr2ogr -f "ESRI Shapefile" myshape.shp
C:\Users\rburhum\Desktop\FileGDB_API_VS2008_1_0beta3\samples\data\ExecuteSQL.gdb
"Cities"

You can find the test binaries at


  http://bit.ly/gdZqar


Best Regards,

- Ragi


___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] gdalnumeric problems with Python 3.2 Windows 7 64 bit

2011-07-11 Thread Isaac Gerg
Im not sure I understood your original message.  In any case, I have it
working now though I used a different GDAL build than the one down by Tamas.


I uninstalled Tamas' build (had to delete a few files in the site-packages
directory) and then install the GDAL libs from here:
http://www.lfd.uci.edu/~gohlke/pythonlibs/
GDAL-1.8.1.win-amd64-py3.2.‌exe 
  [6.6 MB]  [Python 3.2]  [64 bit]  [Jul 08, 2011]

My code now works!

Isaac

On Mon, Jul 11, 2011 at 2:47 PM, Even Rouault
wrote:

> Le lundi 11 juillet 2011 20:40:56, Isaac Gerg a écrit :
> > Hmmm.. I just downloaded numpy from here:
> > http://www.lfd.uci.edu/~gohlke/pythonlibs/ the 64bit windows one without
> > MKL.
> >
> > I installed it successfully and then reran the code.  Same error.  Any
> > ideas?
>
> Yes, as I said in my previous answer, you need numpy at your side, but
> that's
> not enough. The GDAL python bindings need to be rebuilt against a python
> with
> numpy installed. So some extra work would be needed on Tamas side.
>
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] gdalnumeric problems with Python 3.2 Windows 7 64 bit

2011-07-11 Thread Even Rouault
Le lundi 11 juillet 2011 20:40:56, Isaac Gerg a écrit :
> Hmmm.. I just downloaded numpy from here:
> http://www.lfd.uci.edu/~gohlke/pythonlibs/ the 64bit windows one without
> MKL.
> 
> I installed it successfully and then reran the code.  Same error.  Any
> ideas?

Yes, as I said in my previous answer, you need numpy at your side, but that's 
not enough. The GDAL python bindings need to be rebuilt against a python with 
numpy installed. So some extra work would be needed on Tamas side.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] gdalnumeric problems with Python 3.2 Windows 7 64 bit

2011-07-11 Thread Isaac Gerg
Hmmm.. I just downloaded numpy from here:
http://www.lfd.uci.edu/~gohlke/pythonlibs/ the 64bit windows one without
MKL.

I installed it successfully and then reran the code.  Same error.  Any
ideas?

Isaac

On Mon, Jul 11, 2011 at 2:36 PM, Even Rouault
wrote:

> Le lundi 11 juillet 2011 20:27:12, Isaac Gerg a écrit :
> > Hi everyone,
> > I am using GDAL 1.8.1 with Python 3.2 on Windows 7 64-bit (
> >
> http://www.gisinternals.com/sdk/PackageList.aspx?file=release-1600-x64-gdal
> > -1-8-mapserver-6-0.zip<
> https://exchange1.arl.psu.edu/owa/redir.aspx?C=783cf
> > cdde12e4056b2ac3fd8875cc2b1&URL=http%3a%2f%2fwww.gisinternals.com
> %2fsdk%2fP
> > ackageList.aspx%3ffile%3drelease-1600-x64-gdal-1-8-mapserver-6-0.zip>).
> > (Thank you for providing this binary!)
> >
> > I am using the code at
> >
> http://adventuresindevelopment.blogspot.com/2008/12/python-gdal-adding-geot
> > iff-meta-data.html<
> https://exchange1.arl.psu.edu/owa/redir.aspx?C=783cfcdde
> >
> 12e4056b2ac3fd8875cc2b1&URL=http%3a%2f%2fadventuresindevelopment.blogspot.c
> > om%2f2008%2f12%2fpython-gdal-adding-geotiff-meta-data.html> and
> > WriteArray() is giving me the following error builtins.ImportError: No
> > module named gdalnumeric, File
> > "C:\Python32\Lib\site-packages\osgeo\gdal.py", line 986, in WriteArray
> >   import gdalnumeric.
> >
> > Why is the import for gdalnumeric not working?
>
> Likely because a numpy version compatible with Python 3.2 is needed when
> building the GDAL python bindings (and then when using them). I believe
> latest
> numpy releases are compatible with python 3.X
>
> >
> > Thanks in advance,
> > Isaac
>
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] gdalnumeric problems with Python 3.2 Windows 7 64 bit

2011-07-11 Thread Even Rouault
Le lundi 11 juillet 2011 20:27:12, Isaac Gerg a écrit :
> Hi everyone,
> I am using GDAL 1.8.1 with Python 3.2 on Windows 7 64-bit (
> http://www.gisinternals.com/sdk/PackageList.aspx?file=release-1600-x64-gdal
> -1-8-mapserver-6-0.zip cdde12e4056b2ac3fd8875cc2b1&URL=http%3a%2f%2fwww.gisinternals.com%2fsdk%2fP
> ackageList.aspx%3ffile%3drelease-1600-x64-gdal-1-8-mapserver-6-0.zip>).
> (Thank you for providing this binary!)
> 
> I am using the code at
> http://adventuresindevelopment.blogspot.com/2008/12/python-gdal-adding-geot
> iff-meta-data.html 12e4056b2ac3fd8875cc2b1&URL=http%3a%2f%2fadventuresindevelopment.blogspot.c
> om%2f2008%2f12%2fpython-gdal-adding-geotiff-meta-data.html> and
> WriteArray() is giving me the following error builtins.ImportError: No
> module named gdalnumeric, File
> "C:\Python32\Lib\site-packages\osgeo\gdal.py", line 986, in WriteArray
>   import gdalnumeric.
> 
> Why is the import for gdalnumeric not working?

Likely because a numpy version compatible with Python 3.2 is needed when 
building the GDAL python bindings (and then when using them). I believe latest 
numpy releases are compatible with python 3.X

> 
> Thanks in advance,
> Isaac
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


[gdal-dev] gdalnumeric problems with Python 3.2 Windows 7 64 bit

2011-07-11 Thread Isaac Gerg
Hi everyone,
I am using GDAL 1.8.1 with Python 3.2 on Windows 7 64-bit (
http://www.gisinternals.com/sdk/PackageList.aspx?file=release-1600-x64-gdal-1-8-mapserver-6-0.zip).
  (Thank you for providing this binary!)

I am using the code at
http://adventuresindevelopment.blogspot.com/2008/12/python-gdal-adding-geotiff-meta-data.html
and
WriteArray() is giving me the following error builtins.ImportError: No
module named gdalnumeric, File
"C:\Python32\Lib\site-packages\osgeo\gdal.py", line 986, in WriteArray
  import gdalnumeric.

Why is the import for gdalnumeric not working?

Thanks in advance,
Isaac
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] Re: Change the spatial reference of a shapeile

2011-07-11 Thread Chaitanya kumar CH
Exactly.

On Mon, Jul 11, 2011 at 8:31 PM, Solimyr  wrote:

> Sorry, I do not understand...You mean to write the spatialRef to a txt file
> and then doing something like:
>
> $ ogr2ogr  -a_srs spatialRef.txt  dst_shape.shp  src_shape.shp
>
> Is this what you mean? Where inside the txt file there is:
>
> GEOGCS["GCS_WGS_1984",
>   DATUM["WGS_1984",
>   SPHEROID["WGS_1984",637813.0,298.252223563]],
>   PRIMEM["Greenwich",0.0],
>   UNIT["Degree",0.0174532925199433]]
>
> Is correct?
>
> --
> View this message in context:
> http://osgeo-org.1803224.n2.nabble.com/Change-the-spatial-reference-of-a-shapeile-tp6561998p6571241.html
> Sent from the GDAL - Dev mailing list archive at Nabble.com.
> ___
> gdal-dev mailing list
> gdal-dev@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



-- 
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] ogr2ogr SQL Date Calculation

2011-07-11 Thread James Hiebert
In PostgreSQL, you should be able to do something like:


> SELECT now() - INTERVAL '30 DAYS';
   ?column?   
--
 2011-06-11 08:34:03.32524-07
(1 row)


See table 9-26 on this page:
http://www.postgresql.org/docs/8.4/static/functions-datetime.html
for a wide variety of other functions and options.

~James Hiebert

On Mon, Jul 11, 2011 at 04:11:54PM +0100, Langford, Robert wrote:
> All,
> 
> I am trying to use ogr2ogr as a scheduled command line task to run weekly to 
> convert a .SHP file to a .TAB file whilst filtering the data based on a date 
> field.  I would like to only convert records that have a date from the last 
> 30 days.
> 
> Therefore If the task ran today (11/07/2011) the below line would return the 
> required data:
> 
> ogr2ogr -f "MapInfo File" -sql "select * from DCPOLY where 
> DATE_CREA1>'2011/06/11'" D:\Data\Plan_Apps.tab D:\Data\DCPOLY.shp
> 
> Obviously if the task ran tomorrow the date would have to be changed to 
> '2011/06/12'.  So I need the field SQL to be something like:
> 
> DATE_CREA1> Todays_Date - 30
> 
> Does anyone know of a way to automate this using something like; GetDate(), 
> Now(), sysdate, Date /t, etc?  Any help would be greatly appreciated.
> 
> Many thanks,
> 
> Rob
> 
> 
> Robert Langford
> Systems Developer (GIS)
> Corporate Applications Team
> Salford City Council
> 
> Tel:  0161 793 2492
> Email:  robert.langf...@salford.gov.uk
> Web:www.salford.gov.uk
> 
> Salford Civic Centre,
> Chorley Road, Swinton, M27 5DA
> 
> 
> 
> 
> DISCLAIMER: The information in this message is confidential and may be 
> legally privileged. It is intended solely for the addressee.
> 
> Access to this message by anyone else is unauthorised. If you are not the 
> intended recipient, any disclosure, copying, or distribution of the message, 
> or any action or omission taken by you in reliance on it, is prohibited and 
> may be unlawful.
> As a public body, Salford City Council may be required to disclose this email 
> [or any response to it] under the Freedom of Information Act 2000, unless the 
> information in it is covered by one of the exemptions in the Act. 
> Please immediately contact the sender if you have received this message in 
> error. 
> 
> For the full disclaimer please access http://www.salford.gov.uk/e-mail.  
> Thank you.

> ___
> gdal-dev mailing list
> gdal-dev@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev


-- 
James Hiebert
Lead, Computational Support
Pacific Climate Impacts Consortium
http://www.pacificclimate.org
Room 113, University House 1, University of Victoria
PO Box 1700 Sta CSC, Victoria, BC V8V 2Y2
E-mail: hieb...@uvic.ca
Tel: (250) 472-4521
Fax: (250) 472-4830
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] Re: Change the spatial reference of a shapefile

2011-07-11 Thread Jean-Claude Repetto

Le 11/07/2011 12:12, Solimyr a écrit :

Thx, I tried to copy the file .prj but didn't work so I moved to use the
ogr2ogr method using -a_srs but I'm not able to do that...
I get the spatialRef using ogrinfo, like:


GEOGCS["GCS_WGS_1984",
 DATUM["WGS_1984",
 SPHEROID["WGS_1984",637813.0,298.252223563]],
 PRIMEM["Greenwich",0.0],
 UNIT["Degree",0.0174532925199433]]

But I don't know how use it with the ogr2ogr utility. I think that I must
just use this spatialRef to the new shapefile but I don't know why I must
put the source and also the dstI tried:


ogr2ogr -a_srs GEOGCS["GCS_WGS_1984",\nDATUM["WGS_1984",\n
SPHEROID["WGS_1984",637813.0,298.252223563]],\n
PRIMEM["Greenwich",0.0],\nUNIT["Degree",0.0174532925199433]] shape.shp

But doesn't work...


You can use EPSG codes :
-a_srs EPSG:4326

Jean-Claude
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] ogr2ogr SQL Date Calculation

2011-07-11 Thread Michael Shishcu
Hi Robert,

there is a Date command for windows commandline
http://ss64.com/nt/date.html

hope this helps

regards,
michael

On Mon, Jul 11, 2011 at 6:11 PM, Langford, Robert <
robert.langf...@salford.gov.uk> wrote:

>  All,
>
> I am trying to use ogr2ogr as a scheduled command line task to run weekly
> to convert a .SHP file to a .TAB file whilst filtering the data based on a
> date field.  I would like to only convert records that have a date from the
> last 30 days.
>
> Therefore If the task ran today (11/07/2011) the below line would return
> the required data:
>
> ogr2ogr -f "MapInfo File" -sql "select * from DCPOLY where
> DATE_CREA1>'2011/06/11'" D:\Data\Plan_Apps.tab D:\Data\DCPOLY.shp
>
> Obviously if the task ran tomorrow the date would have to be changed to
> '2011/06/12'.  So I need the field SQL to be something like:
>
> DATE_CREA1> Todays_Date - 30
>
> Does anyone know of a way to automate this using something like; GetDate(),
> Now(), sysdate, Date /t, etc?  Any help would be greatly appreciated.
>
> Many thanks,
>
> Rob
>
>
> *Robert Langford*
> *Systems Developer (GIS)*
> *Corporate Applications Team*
> *Salford City Council*
>
> Tel:  0161 793 2492
> Email:  *robert.langf...@salford.gov.uk* 
> Web:*www.salford.gov.uk* 
>
> Salford Civic Centre,
> Chorley Road, Swinton, M27 5DA
>
>
>
>
> DISCLAIMER: The information in this message is confidential and may be 
> legally privileged. It is intended solely for the addressee.
>
> Access to this message by anyone else is unauthorised. If you are not the 
> intended recipient, any disclosure, copying, or distribution of the message, 
> or any action or omission taken by you in reliance on it, is prohibited and 
> may be unlawful.
> As a public body, Salford City Council may be required to disclose this email 
> [or any response to it] under the Freedom of Information Act 2000, unless the 
> information in it is covered by one of the exemptions in the Act.
> Please immediately contact the sender if you have received this message in 
> error.
>
> For the full disclaimer please access http://www.salford.gov.uk/e-mail.  
> Thank you.
>
>
> ___
> gdal-dev mailing list
> gdal-dev@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] RE: How to get some special metadata of HDF5 Cosmo-Skymed file

2011-07-11 Thread Alex Mantaut
I'm not sure if I understood your problem... You can't find the
Calibration Constant?
In that case the calibration constant is a property of the Sxx group.
Check csk-product handbook page 45 for more information.

Hope it helps!
Regards

2011/7/11 RSyaoxin :
> Thanks Alex Mantaut .This document is what I previously reference.Maybe the
> problem is that I do not know how to extract "Calibration Constant"or"K"
> parameters.
> Kind Regards
>
>
> 
> Date: Mon, 11 Jul 2011 07:36:52 -0700
> From: [hidden email]
> To: [hidden email]
> Subject: RE: How to get some special metadata of HDF5 Cosmo-Skymed file
>
> To be honest I know nothing about radiation calibration... Did you
> checked out this document?
>
> http://www.e-geos.it/products/pdf/COSMO-SkyMed-Image_Calibration.pdf
>
> other relevant information can be found at:
>
> http://www.e-geos.it/products/cosmo.html
>
> Hope it helps!
> Regards
>
> 2011/7/11 RSyaoxin <[hidden email]>:
>> Thanks Antonio Valentino and Alex Mantaut. I've got these
>> parameters.I have
>> a new problem,I need to get the backscatter image,but the calibration
>> result
>> is not correct,the calibrated image pixels are all zero.I doubt that my
>> method is not correct.Who can give me some information about Cosmo-Skymed
>> radiation calibration?How should I do?
>> Best regards.
>>
>>
>> 
>> Date: Mon, 11 Jul 2011 06:55:54 -0700
>> From: [hidden email]
>> To: [hidden email]
>> Subject: Re: How to get some special metadata of HDF5 Cosmo-Skymed file
>>
>> Hi RSyaoxin,
>>
>> Antonio is right, there was an issue on geting the root metadata from
>> hdf5 files and is has been fixed in trunk, you will need to recompile
>> gdal in order to get that information.
>>
>>
>> After you rebuilt the library, an example on getting the metadata:
>>
>> #include "gdal_priv.h"
>> #include 
>> #include 
>> #include 
>> #include 
>>
>> using namespace std;
>>
>> int main(int argc, char **argv)
>> {
>> GDALDataset  *poDataset;
>>
>>   GDALAllRegister();
>>
>>   //Open the subdataset
>>   //The filename should be formated like this
>>   //HDF5:filepath://subdataset
>>   poDataset = (GDALDataset *) GDALOpen(
>>
>> "HDF5:CSKS1_DGM_B_HR_00_HH_RA_SF_20080211191721_20080211191753.h5://S01/SBI",
>> GA_ReadOnly );
>>
>>   if( poDataset == NULL )
>>   {
>>       cout <<"error opening dataset"<>   }
>>   else
>>   {
>>            //To get the metadata the item name should be formated like
>> this:
>>            //Every space and group separator should be replaced with
>> an underscore (_)
>>            //I.e. You need item Beam ID from group S01:
>>            const char *pszBeamId =
>> poDataset->GetMetadataItem("S01_Beam_ID");
>>            cout <<  pszBeamId <>            //I.e. You need item Rescaling factor the root:
>>            const char *pszRescalingFactor =
>> poDataset->GetMetadataItem("Rescaling_Factor");
>>            cout <<  pszRescalingFactor <>   }
>> }
>>
>> Best regards
>>
>>
>>
>> 2011/7/10 Antonio Valentino <[hidden email]>:
>>> Hi RSyaoxin,
>>>
>>> Il 10/07/2011 16:08, RSyaoxin ha scritto:
 Hi,all.
       I want to calibrate the Cosmo-Skymed radar data, and I need some
 parameters, such as "Calibration Constant","Rescaling Factor","Reference
 Incidence Angle" and so on.However,I'm a beginner,I don't know how to
 get
 HDF5 metadata,Somebody can give me a tutorial in c or c++?
       Furthermore,I used HDFView to see the file's metadata and found
 that
 these information is stored in the metadata corresponding to the "root"
 of
 the file, I try to use gdalinfo to get the file's metadata  and can't
 find
 it.That's why?

       Subdatasets:



 SUBDATASET_1_NAME=HDF5:"D:\CSKS3_GEC_B_WR_01_VV_RD_SF_20100720100133_20100720100148.h5"://MBI
   SUBDATASET_1_DESC=[9028x12156] //MBI (16-bit unsigned integer)



 SUBDATASET_2_NAME=HDF5:"D:\CSKS3_GEC_B_WR_01_VV_RD_SF_20100720100133_20100720100148.h5"://QLK
   SUBDATASET_2_DESC=[902x1215] //QLK (8-bit unsigned character)

 I hope to get some help.Thank you!
 Kind regards.
>>>
>>> The HDF5 driver has been recently updated to improve metadata management:
>>>
>>> http://trac.osgeo.org/gdal/changeset/22517
>>> http://trac.osgeo.org/gdal/ticket/2412
>>>
>>> The problem you are experimenting should be fixed in trunk but you need
>>> to re-build GDAL from sources to get it.
>>>
>>> regards
>>>
>>> --
>>> Antonio Valentino
>>> ___
>>> gdal-dev mailing list
>>> [hidden email]
>>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>>
>>
>> --
>> --
>>  Alex Mantaut
>> SUR Emprendimientos Tecnológicos
>>
>> Perú 345  Piso 5to Oficina "B" (C1067AAG)
>> Ciudad de Buenos Aires, Argentina
>> Tel. +54 (11) 4342-2976/84
>> [hidden email]
>> www.suremptec.com
>> ___
>> gdal-dev mailing list
>> [hidden email]
>> http:/

[gdal-dev] ogr2ogr SQL Date Calculation

2011-07-11 Thread Langford, Robert
All,

I am trying to use ogr2ogr as a scheduled command line task to run weekly to 
convert a .SHP file to a .TAB file whilst filtering the data based on a date 
field.  I would like to only convert records that have a date from the last 30 
days.

Therefore If the task ran today (11/07/2011) the below line would return the 
required data:

ogr2ogr -f "MapInfo File" -sql "select * from DCPOLY where 
DATE_CREA1>'2011/06/11'" D:\Data\Plan_Apps.tab D:\Data\DCPOLY.shp

Obviously if the task ran tomorrow the date would have to be changed to 
'2011/06/12'.  So I need the field SQL to be something like:

DATE_CREA1> Todays_Date - 30

Does anyone know of a way to automate this using something like; GetDate(), 
Now(), sysdate, Date /t, etc?  Any help would be greatly appreciated.

Many thanks,

Rob


Robert Langford
Systems Developer (GIS)
Corporate Applications Team
Salford City Council

Tel:  0161 793 2492
Email:  robert.langf...@salford.gov.uk
Web:www.salford.gov.uk

Salford Civic Centre,
Chorley Road, Swinton, M27 5DA




DISCLAIMER: The information in this message is confidential and may be legally 
privileged. It is intended solely for the addressee.

Access to this message by anyone else is unauthorised. If you are not the 
intended recipient, any disclosure, copying, or distribution of the message, or 
any action or omission taken by you in reliance on it, is prohibited and may be 
unlawful.
As a public body, Salford City Council may be required to disclose this email 
[or any response to it] under the Freedom of Information Act 2000, unless the 
information in it is covered by one of the exemptions in the Act. 
Please immediately contact the sender if you have received this message in 
error. 

For the full disclaimer please access http://www.salford.gov.uk/e-mail.  Thank 
you.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

[gdal-dev] Re: Change the spatial reference of a shapeile

2011-07-11 Thread Solimyr
Sorry, I do not understand...You mean to write the spatialRef to a txt file
and then doing something like:

$ ogr2ogr  -a_srs spatialRef.txt  dst_shape.shp  src_shape.shp

Is this what you mean? Where inside the txt file there is:

GEOGCS["GCS_WGS_1984",
   DATUM["WGS_1984",
   SPHEROID["WGS_1984",637813.0,298.252223563]],
   PRIMEM["Greenwich",0.0],
   UNIT["Degree",0.0174532925199433]]

Is correct?

--
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/Change-the-spatial-reference-of-a-shapeile-tp6561998p6571241.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


[gdal-dev] RE: How to get some special metadata of HDF5 Cosmo-Skymed file

2011-07-11 Thread RSyaoxin

Thanks Alex Mantaut .This document is what I previously reference.Maybe the 
problem is that I do not know how to extract "Calibration Constant"or"K" 
parameters.
Kind Regards 

 



Date: Mon, 11 Jul 2011 07:36:52 -0700
From: ml-node+6571128-1062291866-335...@n2.nabble.com
To: rsyao...@hotmail.com
Subject: RE: How to get some special metadata of HDF5 Cosmo-Skymed file

To be honest I know nothing about radiation calibration... Did you 
checked out this document? 

http://www.e-geos.it/products/pdf/COSMO-SkyMed-Image_Calibration.pdf

other relevant information can be found at: 

http://www.e-geos.it/products/cosmo.html

Hope it helps! 
Regards 

2011/7/11 RSyaoxin <[hidden email]>: 

> Thanks Antonio Valentino and Alex Mantaut. I've got these parameters.I have 
> a new problem,I need to get the backscatter image,but the calibration result 
> is not correct,the calibrated image pixels are all zero.I doubt that my 
> method is not correct.Who can give me some information about Cosmo-Skymed 
> radiation calibration?How should I do? 
> Best regards. 
> 
> 
>  
> Date: Mon, 11 Jul 2011 06:55:54 -0700 
> From: [hidden email] 
> To: [hidden email] 
> Subject: Re: How to get some special metadata of HDF5 Cosmo-Skymed file 
> 
> Hi RSyaoxin, 
> 
> Antonio is right, there was an issue on geting the root metadata from 
> hdf5 files and is has been fixed in trunk, you will need to recompile 
> gdal in order to get that information. 
> 
> 
> After you rebuilt the library, an example on getting the metadata: 
> 
> #include "gdal_priv.h" 
> #include  
> #include  
> #include  
> #include  
> 
> using namespace std; 
> 
> int main(int argc, char **argv) 
> { 
> GDALDataset  *poDataset; 
> 
>   GDALAllRegister(); 
> 
>   //Open the subdataset 
>   //The filename should be formated like this 
>   //HDF5:filepath://subdataset 
>   poDataset = (GDALDataset *) GDALOpen( 
> "HDF5:CSKS1_DGM_B_HR_00_HH_RA_SF_20080211191721_20080211191753.h5://S01/SBI", 
> GA_ReadOnly ); 
> 
>   if( poDataset == NULL ) 
>   { 
>   cout <<"error opening dataset"<   } 
>   else 
>   { 
>//To get the metadata the item name should be formated like this: 
>//Every space and group separator should be replaced with 
> an underscore (_) 
>//I.e. You need item Beam ID from group S01: 
>const char *pszBeamId = 
> poDataset->GetMetadataItem("S01_Beam_ID"); 
>cout <<  pszBeamId const char *pszRescalingFactor = 
> poDataset->GetMetadataItem("Rescaling_Factor"); 
>cout <<  pszRescalingFactor <   } 
> } 
> 
> Best regards 
> 
> 
> 
> 2011/7/10 Antonio Valentino <[hidden email]>: 
>> Hi RSyaoxin, 
>> 
>> Il 10/07/2011 16:08, RSyaoxin ha scritto: 
>>> Hi,all. 
>>>   I want to calibrate the Cosmo-Skymed radar data, and I need some 
>>> parameters, such as "Calibration Constant","Rescaling Factor","Reference 
>>> Incidence Angle" and so on.However,I'm a beginner,I don't know how to get 
>>> HDF5 metadata,Somebody can give me a tutorial in c or c++? 
>>>   Furthermore,I used HDFView to see the file's metadata and found 
>>> that 
>>> these information is stored in the metadata corresponding to the "root" 
>>> of 
>>> the file, I try to use gdalinfo to get the file's metadata  and can't 
>>> find 
>>> it.That's why? 
>>> 
>>>   Subdatasets: 
>>> 
>>> 
>>> SUBDATASET_1_NAME=HDF5:"D:\CSKS3_GEC_B_WR_01_VV_RD_SF_20100720100133_20100720100148.h5"://MBI
>>>  
>>>   SUBDATASET_1_DESC=[9028x12156] //MBI (16-bit unsigned integer) 
>>> 
>>> 
>>> SUBDATASET_2_NAME=HDF5:"D:\CSKS3_GEC_B_WR_01_VV_RD_SF_20100720100133_20100720100148.h5"://QLK
>>>  
>>>   SUBDATASET_2_DESC=[902x1215] //QLK (8-bit unsigned character) 
>>> 
>>> I hope to get some help.Thank you! 
>>> Kind regards. 
>> 
>> The HDF5 driver has been recently updated to improve metadata management: 
>> 
>> http://trac.osgeo.org/gdal/changeset/22517
>> http://trac.osgeo.org/gdal/ticket/2412
>> 
>> The problem you are experimenting should be fixed in trunk but you need 
>> to re-build GDAL from sources to get it. 
>> 
>> regards 
>> 
>> -- 
>> Antonio Valentino 
>> ___ 
>> gdal-dev mailing list 
>> [hidden email] 
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>> 
> 
> -- 
> -- 
>  Alex Mantaut 
> SUR Emprendimientos Tecnológicos 
> 
> Perú 345  Piso 5to Oficina "B" (C1067AAG) 
> Ciudad de Buenos Aires, Argentina 
> Tel. +54 (11) 4342-2976/84 
> [hidden email] 
> www.suremptec.com 
> ___ 
> gdal-dev mailing list 
> [hidden email] 
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
> 
> 
>  
> If you reply to this email, your message will be added to the discussion 
> below: 
> http://osgeo-org.1803224.n2.nabble.com/How-to-get-some-special-metadata-of-HDF5-Cosmo-Skymed-file-tp6567852p6571000.html
> To unsub

[gdal-dev] Custom geographic coordinate system and non valid translation

2011-07-11 Thread Rodolfo Bonnin
Hello all,

I'm trying to define a UTM projected coordinate system, with a custom
geographic coordinate system, to have a system similar to the geocentric
ITRF97, in gdal 1.8, which doesn't support that type.

 Part of the gdalinfo output  is:



_

PROJCS["UTM",
GEOGCS["ITRF97 (wgs84 equivalent)",
DATUM["International_Terrestrial_Reference_Frame_1997",
SPHEROID["GRS 1980",6378137,298.257222101,
AUTHORITY["EPSG","7019"]],
TOWGS84[0,0,0,0,0,0,0],
AUTHORITY["EPSG","6655"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",141],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",50],
PARAMETER["false_northing",0],
UNIT["Meter",1]]
GeoTransform =
  -14448629.2184734, -141.4557903812352, -1.43564504297578
  12357184.49239378, 14.97393042715653, 208.8248508563648
Metadata:
  PROJECTION_NAME=
Corner Coordinates:
Upper Left  (-14448629.218,12357184.492) (  0d 0' 0.01"E, 90d 0' 0.00"N)
Lower Left  (-14458678.734,13818958.448) (  0d 0' 0.01"E, 90d 0' 0.00"N)
Upper Right (-15472486.229,12465565.801) (  0d 0' 0.01"E, 90d 0' 0.00"N)
Lower Right (-15482535.745,13927339.757) (  0d 0' 0.01"E, 90d 0' 0.00"N)
Center  (-14965582.482,13142262.125) (  0d 0' 0.01"E, 90d 0' 0.00"N)




As you see the geographic coordinate system don't translate the corners
projected coordinates into the geographic ones.

Am I missing a parameter or is some concept wrong with the chosen wkt ?

Many thanks in advance.

-- 
Ing. Rodolfo Bonnin
SUR Emprendimientos Tecnológicos

Perú 345  Piso 5to Oficina "B" (C1067AAG)
Ciudad de Buenos Aires, Argentina
Tel. +54 (11) 4342-2976/84
rodolfobon...@suremptec.com.ar
www.suremptec.com
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] Meaning of nPixelSpace/nLineSpace in IRasterIO

2011-07-11 Thread Jorge Arévalo
Hello,

2011/7/8 Even Rouault :
> Le vendredi 08 juillet 2011 16:09:31, Jorge Arévalo a écrit :
>> Hello,
>>
>> I'm not sure of the meaning of nPixelSpace, nLineSpace IRasterIO args.
>>
>> >From GDAL doc I read:
>> nPixelSpace: The byte offset from the start of one pixel value in
>> pData to the start of the next pixel value within a scanline. If
>> defaulted (0) the size of the datatype eBufType is used.
>>
>> nLineSpace: The byte offset from the start of one scanline in pData to
>> the start of the next. If defaulted (0) the size of the datatype
>> eBufType * nBufXSize is used.
>>
>> and
>>
>> The nPixelSpace and nLineSpace parameters allow reading into or
>> writing from unusually organized buffers. This is primarily used for
>> buffers containing more than one bands raster data in interleaved
>> format.
>>
>> I know there are, basically, 3 interleave formats:
>>
>> BSQ (INTERLEAVE=BAND)
>> BIL (INTERLEAVE=LINE)
>> BIP (INTERLEAVE=PIXEL)
>>
>> Assuming a 3-bands (rgb) 4x4 raster, the pData array would look like
>> this ("|" used only to mark the end of a row):
>>
>> BSQ: r1 r1 r1 r1 | r2 r2 r2 r2 | r3 r3 r3 r3 | r4 r4 r4 r4 | g1 g1 g1
>> g1 | g2 g2 g2 g2 | g3 g3 g3 g3 | g4 g4 g4 g4 g4 | b1 b1 b1 b1 | b2 b2
>> b2 b2 | b3 b3 b3 b3 | b4 b4 b4 b4
>
> For the sake of simplicity, let's assume that the datatype is byte (if not,
> just multiply all values by GDALGetDataType(eDT) / 8),
>
> Yes, nPixelOffset = 1, nLineOffset = nBufferXSize, nBandOffset = nBufferXSize 
> *
> nBufferYSize.
>
> (nBandOffset is for GDALDatasetRasterIO())
>

Ok, understood.


>>
>> BIL: r1 r1 r1 r1 | g1 g1 g1 g1 | b1 b1 b1 b1 | r2 r2 r2 r2 | g2 g2 g2
>> g2 | b2 b2 b2 b2 | r3 r3 r3 r3 | g3 g3 g3 g3 | b3 b3 b3 b3 | r4 r4 r4
>> r4 | g4 g4 g4 g4 | b4 b4 b4 b4
>
> Yes, nPixelOffset = 1, nLineOffset = nBufferXSize * nBands, nBandOffset =
> nBufferXSize
>

Understood.


>>
>> BIP: r1 g1 b1 r2 | g2 b2 r3 g3 | b3 r4 g4 b4 | r1 g1 b1 r2 | g2 b2 r3
>> g3 | b3 r4 g4 b4 | r1 g1 b1 r2 | g2 b2 r3 g3 | b3 r4 g4 b4 | r1 g1 b1
>> r2 | g2 b2 r3 g3 | b3 r4 g4 b4
>
> You meant :
>
> r1 g1 b1 r1 g1 b1 r1 g1 b1 r1 g1 b1 |
> r2 g2 b2 r2 g2 b2 r2 g2 b2 r2 g2 b2 |
> r3 g3 b3 r3 g3 b3 r3 g3 b3 r3 g3 b3 |
> r4 g4 b4 r4 g4 b4 r4 g4 b4 r4 g4 b4 |
>
> right ?
>
> And nPixelOffset = nBands, nLineOffset = nBands * nBufferXSize, nBandOffset = 
> 1
>

Yes, you're right. Understood.


>>
>> Now my doubt.
>>
>> Does "byte offset" mean the byte space between the start of 2 valid
>> values in pData?
>
> The maths will speak better...
>
> If you output buffer starts at address pStart, for band b (numbered from 1) 
> the
> value of the pixel at line j (numbered from 0), column i (numbered from 0) of
> the output buffer will be stored at :
>
> pStart + i * nPixelSpace + j * nLineSpace + (b-1) * nBandSpace
>
> So nPixelSpace is the difference between the address of a pixel and the pixel
> at its right on the same line.
>

Absolutely clear now :-)


>> For example, the space between r1 and g1 in BIP
>> format. I guess if there's no trailing bits in the array (all the bits
>> are payload) the byte offset between the start of 2 valid values is
>> always the size of the data type. Then simply r1 = pData[0] and g1 =
>> pData[1] (BIP format)
>
> Not sure to follow you, hopefully the above explinations will answer your
> question ;-)
>

Don't worry. I understand now. You answered my question, yes.


>>
>> Isn't it the most common situation? In which situation has sense
>> having "gaps" between pixel values, or at the end of a row?
>
> Sometimes you just want to override the values of an allocated buffer with
> greater extent, so you need to provide a so-called "line stride" that is
> greater than nBufferXSize.
>

Ok.


>> I think I
>> don't really understand the sentence: "This is primarily used for
>> buffers containing more than one bands raster data in interleaved
>> format.".
>
> I guess it means that if you need to read from different bands with multiple
> calls to RasterIO() but in the same buffer, you can tweak nPixelSize and
> nLineOffset to let enough space for data from different bands and match the
> organization of the data as you've designed it.
>

Yep, ok. My doubt is already solved. Many thanks!

Best regards,
Jorge

>>
>> Thanks in advance, and best regards.
>> Jorge
>



-- 
Jorge Arévalo
Internet & Mobility Division, DEIMOS
jorge.arev...@deimos-space.com
http://es.linkedin.com/in/jorgearevalo80
http://mobility.grupodeimos.com/
http://gis4free.wordpress.com
http://geohash.org/ezjqgrgzz0g
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] RE: How to get some special metadata of HDF5 Cosmo-Skymed file

2011-07-11 Thread Alex Mantaut
To be honest I know nothing about radiation calibration... Did you
checked out this document?

http://www.e-geos.it/products/pdf/COSMO-SkyMed-Image_Calibration.pdf

other relevant information can be found at:

http://www.e-geos.it/products/cosmo.html

Hope it helps!
Regards

2011/7/11 RSyaoxin :
> Thanks Antonio Valentino and Alex Mantaut. I've got these parameters.I have
> a new problem,I need to get the backscatter image,but the calibration result
> is not correct,the calibrated image pixels are all zero.I doubt that my
> method is not correct.Who can give me some information about Cosmo-Skymed
> radiation calibration?How should I do?
> Best regards.
>
>
> 
> Date: Mon, 11 Jul 2011 06:55:54 -0700
> From: [hidden email]
> To: [hidden email]
> Subject: Re: How to get some special metadata of HDF5 Cosmo-Skymed file
>
> Hi RSyaoxin,
>
> Antonio is right, there was an issue on geting the root metadata from
> hdf5 files and is has been fixed in trunk, you will need to recompile
> gdal in order to get that information.
>
>
> After you rebuilt the library, an example on getting the metadata:
>
> #include "gdal_priv.h"
> #include 
> #include 
> #include 
> #include 
>
> using namespace std;
>
> int main(int argc, char **argv)
> {
> GDALDataset  *poDataset;
>
>   GDALAllRegister();
>
>   //Open the subdataset
>   //The filename should be formated like this
>   //HDF5:filepath://subdataset
>   poDataset = (GDALDataset *) GDALOpen(
> "HDF5:CSKS1_DGM_B_HR_00_HH_RA_SF_20080211191721_20080211191753.h5://S01/SBI",
> GA_ReadOnly );
>
>   if( poDataset == NULL )
>   {
>       cout <<"error opening dataset"<   }
>   else
>   {
>            //To get the metadata the item name should be formated like this:
>            //Every space and group separator should be replaced with
> an underscore (_)
>            //I.e. You need item Beam ID from group S01:
>            const char *pszBeamId =
> poDataset->GetMetadataItem("S01_Beam_ID");
>            cout <<  pszBeamId <            //I.e. You need item Rescaling factor the root:
>            const char *pszRescalingFactor =
> poDataset->GetMetadataItem("Rescaling_Factor");
>            cout <<  pszRescalingFactor <   }
> }
>
> Best regards
>
>
>
> 2011/7/10 Antonio Valentino <[hidden email]>:
>> Hi RSyaoxin,
>>
>> Il 10/07/2011 16:08, RSyaoxin ha scritto:
>>> Hi,all.
>>>       I want to calibrate the Cosmo-Skymed radar data, and I need some
>>> parameters, such as "Calibration Constant","Rescaling Factor","Reference
>>> Incidence Angle" and so on.However,I'm a beginner,I don't know how to get
>>> HDF5 metadata,Somebody can give me a tutorial in c or c++?
>>>       Furthermore,I used HDFView to see the file's metadata and found
>>> that
>>> these information is stored in the metadata corresponding to the "root"
>>> of
>>> the file, I try to use gdalinfo to get the file's metadata  and can't
>>> find
>>> it.That's why?
>>>
>>>       Subdatasets:
>>>
>>>
>>> SUBDATASET_1_NAME=HDF5:"D:\CSKS3_GEC_B_WR_01_VV_RD_SF_20100720100133_20100720100148.h5"://MBI
>>>   SUBDATASET_1_DESC=[9028x12156] //MBI (16-bit unsigned integer)
>>>
>>>
>>> SUBDATASET_2_NAME=HDF5:"D:\CSKS3_GEC_B_WR_01_VV_RD_SF_20100720100133_20100720100148.h5"://QLK
>>>   SUBDATASET_2_DESC=[902x1215] //QLK (8-bit unsigned character)
>>>
>>> I hope to get some help.Thank you!
>>> Kind regards.
>>
>> The HDF5 driver has been recently updated to improve metadata management:
>>
>> http://trac.osgeo.org/gdal/changeset/22517
>> http://trac.osgeo.org/gdal/ticket/2412
>>
>> The problem you are experimenting should be fixed in trunk but you need
>> to re-build GDAL from sources to get it.
>>
>> regards
>>
>> --
>> Antonio Valentino
>> ___
>> gdal-dev mailing list
>> [hidden email]
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>
>
> --
> --
>  Alex Mantaut
> SUR Emprendimientos Tecnológicos
>
> Perú 345  Piso 5to Oficina "B" (C1067AAG)
> Ciudad de Buenos Aires, Argentina
> Tel. +54 (11) 4342-2976/84
> [hidden email]
> www.suremptec.com
> ___
> gdal-dev mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
>
> 
> If you reply to this email, your message will be added to the discussion
> below:
> http://osgeo-org.1803224.n2.nabble.com/How-to-get-some-special-metadata-of-HDF5-Cosmo-Skymed-file-tp6567852p6571000.html
> To unsubscribe from How to get some special metadata of HDF5 Cosmo-Skymed
> file, click here.
> 
> View this message in context: RE: How to get some special metadata of HDF5
> Cosmo-Skymed file
> Sent from the GDAL - Dev mailing list archive at Nabble.com.
>
> ___
> gdal-dev mailing list
> gdal-dev@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



-- 
--
 Alex Mantaut
SUR Emprendimientos Tecnológicos

Perú 345  Piso 5to Oficina "B" (C106

Re: [gdal-dev] Re: Change the spatial reference of a shapeile

2011-07-11 Thread Chaitanya kumar CH
Solimyr,

It's hard to express the SRS WKT on command line. The easiest way is to save
the srs wkt into a file and use the filename in place of the srs_def for the
-a_srs option in the command.

On Mon, Jul 11, 2011 at 3:42 PM, Solimyr  wrote:

> Thx, I tried to copy the file .prj but didn't work so I moved to use the
> ogr2ogr method using -a_srs but I'm not able to do that...
> I get the spatialRef using ogrinfo, like:
>
>
> GEOGCS["GCS_WGS_1984",
>DATUM["WGS_1984",
>SPHEROID["WGS_1984",637813.0,298.252223563]],
>PRIMEM["Greenwich",0.0],
>UNIT["Degree",0.0174532925199433]]
>
> But I don't know how use it with the ogr2ogr utility. I think that I must
> just use this spatialRef to the new shapefile but I don't know why I must
> put the source and also the dstI tried:
>
>
> ogr2ogr -a_srs GEOGCS["GCS_WGS_1984",\nDATUM["WGS_1984",\n
> SPHEROID["WGS_1984",637813.0,298.252223563]],\n
> PRIMEM["Greenwich",0.0],\nUNIT["Degree",0.0174532925199433]] shape.shp
>
> But doesn't work...
>
> --
> View this message in context:
> http://osgeo-org.1803224.n2.nabble.com/Change-the-spatial-reference-of-a-shapeile-tp6561998p6570374.html
> Sent from the GDAL - Dev mailing list archive at Nabble.com.
> ___
> gdal-dev mailing list
> gdal-dev@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



-- 
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

[gdal-dev] RE: How to get some special metadata of HDF5 Cosmo-Skymed file

2011-07-11 Thread RSyaoxin

Thanks Antonio Valentino and Alex Mantaut. I've got these parameters.I have a 
new problem,I need to get the backscatter image,but the calibration result is 
not correct,the calibrated image pixels are all zero.I doubt that my method is 
not correct.Who can give me some information about Cosmo-Skymed radiation 
calibration?How should I do?
Best regards.

 



Date: Mon, 11 Jul 2011 06:55:54 -0700
From: ml-node+6571000-1433452921-335...@n2.nabble.com
To: rsyao...@hotmail.com
Subject: Re: How to get some special metadata of HDF5 Cosmo-Skymed file

Hi RSyaoxin, 

Antonio is right, there was an issue on geting the root metadata from 
hdf5 files and is has been fixed in trunk, you will need to recompile 
gdal in order to get that information. 


After you rebuilt the library, an example on getting the metadata: 

#include "gdal_priv.h" 
#include  
#include  
#include  
#include  

using namespace std; 

int main(int argc, char **argv) 
{ 
GDALDataset  *poDataset; 

  GDALAllRegister(); 

  //Open the subdataset 
  //The filename should be formated like this 
  //HDF5:filepath://subdataset 
  poDataset = (GDALDataset *) GDALOpen( 
"HDF5:CSKS1_DGM_B_HR_00_HH_RA_SF_20080211191721_20080211191753.h5://S01/SBI", 
GA_ReadOnly ); 

  if( poDataset == NULL ) 
  { 
  cout <<"error opening dataset" Hi RSyaoxin, 
> 
> Il 10/07/2011 16:08, RSyaoxin ha scritto: 
>> Hi,all. 
>>   I want to calibrate the Cosmo-Skymed radar data, and I need some 
>> parameters, such as "Calibration Constant","Rescaling Factor","Reference 
>> Incidence Angle" and so on.However,I'm a beginner,I don't know how to get 
>> HDF5 metadata,Somebody can give me a tutorial in c or c++? 
>>   Furthermore,I used HDFView to see the file's metadata and found that 
>> these information is stored in the metadata corresponding to the "root" of 
>> the file, I try to use gdalinfo to get the file's metadata  and can't find 
>> it.That's why? 
>> 
>>   Subdatasets: 
>> 
>> SUBDATASET_1_NAME=HDF5:"D:\CSKS3_GEC_B_WR_01_VV_RD_SF_20100720100133_20100720100148.h5"://MBI
>>  
>>   SUBDATASET_1_DESC=[9028x12156] //MBI (16-bit unsigned integer) 
>> 
>> SUBDATASET_2_NAME=HDF5:"D:\CSKS3_GEC_B_WR_01_VV_RD_SF_20100720100133_20100720100148.h5"://QLK
>>  
>>   SUBDATASET_2_DESC=[902x1215] //QLK (8-bit unsigned character) 
>> 
>> I hope to get some help.Thank you! 
>> Kind regards. 
> 
> The HDF5 driver has been recently updated to improve metadata management: 
> 
> http://trac.osgeo.org/gdal/changeset/22517
> http://trac.osgeo.org/gdal/ticket/2412
> 
> The problem you are experimenting should be fixed in trunk but you need 
> to re-build GDAL from sources to get it. 
> 
> regards 
> 
> -- 
> Antonio Valentino 
> ___ 
> gdal-dev mailing list 
> [hidden email] 
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
> 


-- 
-- 
 Alex Mantaut 
SUR Emprendimientos Tecnológicos 

Perú 345  Piso 5to Oficina "B" (C1067AAG) 
Ciudad de Buenos Aires, Argentina 
Tel. +54 (11) 4342-2976/84 
[hidden email] 
www.suremptec.com 
___ 
gdal-dev mailing list 
[hidden email] 
http://lists.osgeo.org/mailman/listinfo/gdal-dev






If you reply to this email, your message will be added to the discussion 
below:http://osgeo-org.1803224.n2.nabble.com/How-to-get-some-special-metadata-of-HDF5-Cosmo-Skymed-file-tp6567852p6571000.html
 
To unsubscribe from How to get some special metadata of HDF5 Cosmo-Skymed file, 
click here.   

--
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/How-to-get-some-special-metadata-of-HDF5-Cosmo-Skymed-file-tp6567852p6571081.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] How to get some special metadata of HDF5 Cosmo-Skymed file

2011-07-11 Thread Alex Mantaut
Hi RSyaoxin,

Antonio is right, there was an issue on geting the root metadata from
hdf5 files and is has been fixed in trunk, you will need to recompile
gdal in order to get that information.


After you rebuilt the library, an example on getting the metadata:

#include "gdal_priv.h"
#include 
#include 
#include 
#include 

using namespace std;

int main(int argc, char **argv)
{
GDALDataset  *poDataset;

  GDALAllRegister();

  //Open the subdataset
  //The filename should be formated like this
  //HDF5:filepath://subdataset
  poDataset = (GDALDataset *) GDALOpen(
"HDF5:CSKS1_DGM_B_HR_00_HH_RA_SF_20080211191721_20080211191753.h5://S01/SBI",
GA_ReadOnly );

  if( poDataset == NULL )
  {
  cout <<"error opening dataset" Hi RSyaoxin,
>
> Il 10/07/2011 16:08, RSyaoxin ha scritto:
>> Hi,all.
>>       I want to calibrate the Cosmo-Skymed radar data, and I need some
>> parameters, such as "Calibration Constant","Rescaling Factor","Reference
>> Incidence Angle" and so on.However,I'm a beginner,I don't know how to get
>> HDF5 metadata,Somebody can give me a tutorial in c or c++?
>>       Furthermore,I used HDFView to see the file's metadata and found that
>> these information is stored in the metadata corresponding to the "root" of
>> the file, I try to use gdalinfo to get the file's metadata  and can't find
>> it.That's why?
>>
>>       Subdatasets:
>>
>> SUBDATASET_1_NAME=HDF5:"D:\CSKS3_GEC_B_WR_01_VV_RD_SF_20100720100133_20100720100148.h5"://MBI
>>   SUBDATASET_1_DESC=[9028x12156] //MBI (16-bit unsigned integer)
>>
>> SUBDATASET_2_NAME=HDF5:"D:\CSKS3_GEC_B_WR_01_VV_RD_SF_20100720100133_20100720100148.h5"://QLK
>>   SUBDATASET_2_DESC=[902x1215] //QLK (8-bit unsigned character)
>>
>> I hope to get some help.Thank you!
>> Kind regards.
>
> The HDF5 driver has been recently updated to improve metadata management:
>
> http://trac.osgeo.org/gdal/changeset/22517
> http://trac.osgeo.org/gdal/ticket/2412
>
> The problem you are experimenting should be fixed in trunk but you need
> to re-build GDAL from sources to get it.
>
> regards
>
> --
> Antonio Valentino
> ___
> gdal-dev mailing list
> gdal-dev@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



-- 
--
 Alex Mantaut
SUR Emprendimientos Tecnológicos

Perú 345  Piso 5to Oficina "B" (C1067AAG)
Ciudad de Buenos Aires, Argentina
Tel. +54 (11) 4342-2976/84
alexmant...@suremptec.com.ar
www.suremptec.com
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


[gdal-dev] Re: Change the spatial reference of a shapeile

2011-07-11 Thread Solimyr
Thx, I tried to copy the file .prj but didn't work so I moved to use the
ogr2ogr method using -a_srs but I'm not able to do that...
I get the spatialRef using ogrinfo, like:


GEOGCS["GCS_WGS_1984",
DATUM["WGS_1984",
SPHEROID["WGS_1984",637813.0,298.252223563]],
PRIMEM["Greenwich",0.0],
UNIT["Degree",0.0174532925199433]]

But I don't know how use it with the ogr2ogr utility. I think that I must
just use this spatialRef to the new shapefile but I don't know why I must
put the source and also the dstI tried:


ogr2ogr -a_srs GEOGCS["GCS_WGS_1984",\nDATUM["WGS_1984",\n   
SPHEROID["WGS_1984",637813.0,298.252223563]],\n   
PRIMEM["Greenwich",0.0],\nUNIT["Degree",0.0174532925199433]] shape.shp

But doesn't work...

--
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/Change-the-spatial-reference-of-a-shapeile-tp6561998p6570374.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev