[GRASS-user] [gdal-dev] Working with NTF files

Nikos Alexandris nik at nikosalexandris.net
Sat Jul 20 12:20:23 PDT 2013


Markus Metz:

[almost all previous discussion erased]

Following a test using an IKONOS-NTF set of files -- they do not contain SUBDATASETS.  
Actually, the same files as in my last/previous post.  Will re-test also for a NITF container 
that includes SUBDATASETs.


1)

> What says g.proj georef=your_geofile -p?

That's a very nice parameter which I never thought of to combine with "-p" :-)

,---8<--
g.proj -p georef=15JUN11IK0101000po_697515_pan_0000000.ntf
Trying to open with OGR...
...succeeded.
WARNING: Read of file 15JUN11IK0101000po_697515_pan_0000000.ntf was
         successful, but it did not contain projection information. 'XY
         (unprojected)' will be used
XY location (unprojected)
`-->%---


This is however 1) strange -- it misses a message like "Trying to open with GDAL..." and 2) 
(successively) not true because gdalinfo reports:

,---8<--
gdalinfo -proj4 -nomd -noct -nogcp 15JUN11IK0101000po_697515_pan_0000000.ntf | grep 
proj

'+proj=utm +zone=37 +south +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs '
`-->%---


Exactly the same happens (as above) for the multi-spectral bands. A bug?  Using this file in

"grass7 -c 15JUN11IK0101000po_697515_pan_0000000.tif /grassdb/test_Location"

creates the following Location:

,---%<--
g.proj -p
-PROJ_INFO-------------------------------------------------
name       : Lat/Lon
proj       : ll
datum      : wgs84
ellps      : wgs84
no_defs    : defined
-PROJ_UNITS------------------------------------------------
unit       : degree
units      : degrees
meters     : 1.0
`-->%---


2)
 
> What reports r.in.gdal when trying to import in a location that
> definitively does not match the SRS?

Now, r.in.gdal seems to correctly recognise the SRS!

,---8<--
r.in.gdal in=15JUN11IK0101000po_697515_pan_0000000.ntf 
out=import_test_15JUN11IK0101000po_697515_pan_0000000.ntf
ERROR: Projection of dataset does not appear to match current location.

       Location PROJ_INFO is:
       name: Lat/Lon
       proj: ll
       datum: wgs84
       ellps: wgs84
       no_defs: defined

       Dataset PROJ_INFO is:
       name: Universal Transverse Mercator
       proj: utm
       datum: wgs84
       ellps: wgs84
       zone: 37
       south: defined
       towgs84: 0,0,0,0,0,0,0
       no_defs: defined

       ERROR:
       You can use the -o flag to r.in.gdal to override this check and use
       the location definition for the dataset.
       Consider generating a new location from the input dataset using the
       'location' parameter.
`-->%---


> Both tests should be done both with the NITF file and with a
> subdataset of the NITF file.

Not applicable in this case, no SUBDATASETs in these file(s). 

Nikos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20130720/11adbe4a/attachment.html>


More information about the grass-user mailing list