[Geoserver-users] NITF files incorrectly georeferenced

If I gdal_translate the files to ‘geotif’ first, they are correctly positioned on the map. Why is that?? Why doesn’t geoserver understand the NITF if GDAL clearly can?

···

From: Smart, Gary Export License Required - US UTAS [mailto:Gary.Smart@…7257…]
Sent: 22 September 2015 18:17
To: Daniele Romagnoli
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] [External] Re: NITF files incorrectly georeferenced

I don’t think I have ever seen a NITF output from GDAL which reports anything on the line ‘Coordinate System is:’ – I was under the impression that the wealth of information below described the Coordinate System.

I was also under the impression that geoserver could import random NITF images (these are large NADIR views) and serve them through the WMS (i.e. presumably using GDAL to orthorectify the imagery en-route). To do this, I thought it used the four corner georeferencing clearly contained in this NITF file and all the others I have.

Is this not the case? I can see the images using the ‘layer preview’ tool, so I presume it can serve them somehow – and they look warped as required. But they just seem to be in the wrong place on the Earth!

From: dany.geotools@…84… [mailto:dany.geotools@…84…] On Behalf Of Daniele Romagnoli
Sent: 22 September 2015 16:29
To: Smart, Gary Export License Required - US UTAS
Cc: geoserver-users@lists.sourceforge.net
Subject: [External] Re: [Geoserver-users] NITF files incorrectly georeferenced

Hi,

it seems like gdalinfo itself is unable to recognize the Coordinate Reference System of your sample.

Driver: NITF/National Imagery Transmission Format

Files: blah.ntf

Size is 5120, 10464

Coordinate System is `’ <------ EMPTY

Moreover, the gdalinfo shows that your file isn’t georectified: it contains ground control points (the reported WGS84 CRS is for the GCPs).

Therefore the sample is handled like a simple image (let’s say as a picture) using a Wildcard 2D Cartesian plane so that you can express coordinates as pixels positions.

You could consider using gdalwarp to georectify your samples so that they become valid for GeoServer.

Hope this helps.

Cheers,

Daniele

On Tue, Sep 22, 2015 at 4:45 PM, Smart, Gary Export License Required - US UTAS <Gary.Smart@…7257…> wrote:

I am trying to create a layer, either from a mosaic of NITF files, or even just a single NITF file. Some NITF files seem to work OK, but I have a many NITF2.1 files which have valid georeferencing but which fail to either mosaic or even load as separate NITF files. It is as if the NITF georeferencing is not being used.

When using the mosaic method, the store ‘.prj’ file ends up with:

LOCAL_CS[“Wildcard 2D cartesian plane in metric unit”, LOCAL_DATUM[“Unknown”, 0], UNIT[“m”, 1.0], AXIS[“x”, EAST], AXIS[“y”, NORTH], AUTHORITY[“EPSG”,“404000”]] which doesn’t look right given that the NITF gdalinfo’s are all close to…

Driver: NITF/National Imagery Transmission Format

Files: blah.ntf

Size is 5120, 10464

Coordinate System is `’

GCP Projection =

GEOGCS[“WGS 84”,

DATUM[“WGS_1984”,

SPHEROID[“WGS 84”,6378137,298.257223563,

AUTHORITY[“EPSG”,“7030”]],

TOWGS84[0,0,0,0,0,0,0],

AUTHORITY[“EPSG”,“6326”]],

PRIMEM[“Greenwich”,0,

AUTHORITY[“EPSG”,“8901”]],

UNIT[“degree”,0.0174532925199433,

AUTHORITY[“EPSG”,“9108”]],

AUTHORITY[“EPSG”,“4326”]]

GCP[ 0]: Id=UpperLeft, Info=

(0.5,0.5) → (1.292,52.662,0)

GCP[ 1]: Id=UpperRight, Info=

(5119.5,0.5) → (1.315,52.662,0)

GCP[ 2]: Id=LowerRight, Info=

(5119.5,10463.5) → (1.309,52.633,0)

GCP[ 3]: Id=LowerLeft, Info=

(0.5,10463.5) → (1.29,52.633,0)

Metadata:

NITF_ABPP=10

NITF_CCS_COLUMN=0

NITF_CCS_ROW=0

NITF_CLEVEL=06

NITF_ENCRYP=0

NITF_FBKGC= 48, 48, 48

NITF_FDT=20150922084921

NITF_FHDR=NITF02.10

NITF_FSCATP=O

NITF_FSCAUT=DGIC UK

NITF_FSCLAS=U

NITF_FSCLSY=UK

NITF_FSCLTX=

NITF_FSCODE=

NITF_FSCOP=00000

NITF_FSCPYS=00000

NITF_FSCRSN=

NITF_FSCTLH=

NITF_FSCTLN=

NITF_FSDCDT=

NITF_FSDCTP=O

NITF_FSDCXM=

NITF_FSDG=

NITF_FSDGDT=

NITF_FSREL=UK US

NITF_FSSRDT=

NITF_FTITLE=For map demo

NITF_IALVL=0

NITF_IC=NC

NITF_ICAT=EO

NITF_ICORDS=D

NITF_IDATIM=20020718092745

NITF_IDLVL=1

NITF_IGEOLO=+52.662+001.292+52.662+001.315+52.633+001.309+52.633+001.290

NITF_IID1=B014.F0003

NITF_IID2=18JUL029Z0000012ZX0E0003ZZ000A3856011611

NITF_ILOC_COLUMN=0

NITF_ILOC_ROW=0

NITF_IMAG=1.0

NITF_IMODE=B

NITF_IREP=MONO

NITF_ISCATP=O

NITF_ISCAUT=DGIC UK

NITF_ISCLAS=U

NITF_ISCLSY=UK

NITF_ISCLTX=

NITF_ISCODE=

NITF_ISCRSN=

NITF_ISCTLH=

NITF_ISCTLN=

NITF_ISDCDT=

NITF_ISDCTP=O

NITF_ISDCXM=

NITF_ISDG=

NITF_ISDGDT=

NITF_ISORCE= Ground Station

NITF_ISREL=UK US

NITF_ISSRDT=

NITF_ONAME=

NITF_OPHONE=

NITF_OSTAID=Ground Stn

NITF_PJUST=R

NITF_PVTYPE=INT

NITF_STYPE=BF01

NITF_TGTID=

Corner Coordinates:

Upper Left ( 0.0, 0.0)

Lower Left ( 0.0,10464.0)

Upper Right ( 5120.0, 0.0)

Lower Right ( 5120.0,10464.0)

Center ( 2560.0, 5232.0)

Band 1 Block=512x512 Type=UInt16, ColorInterp=Gray

I can view the NITF files and georeference them using GeoView and our own NITF viewer. I can preview the layer containing a single NITF file (in geoserver) but the georeferencing seems to be rubbish (perhaps origin at zero zero) even though the IGEOLO seems sound.

Any ideas?

Note that the mosaic tool crashes with (no too surprisingly) ‘No transformation available from system “EngineeringCRS[Wildcard 2D Cartesian plan in metric unit]” to “GeographicCRS[WGS84(DD)]”’



Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.

Ing. Daniele Romagnoli
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.

Hi,
please, read below…

···

On Tue, Sep 22, 2015 at 7:23 PM, Smart, Gary Export License Required - US UTAS <Gary.Smart@anonymised.com…> wrote:

If I gdal_translate the files to ‘geotif’ first, they are correctly positioned on the map. Why is that??

Could you please provide the gdalinfo output for that GeoTIFF?
Did you use gdal_translate or gdalwarp?

Why doesn’t geoserver understand the NITF if GDAL clearly can?

In GeoServer, a dataset need to be a GeoRectified one in order to be rendered in the proper place in the world.
(Otherwise, it is simply handled as a picture having coordinates [0,0]->[width,height])
Therefore a CoordinateReferenceSystem and a GeoTransform needs to exist for that dataset.
When GeoServer uses GDAL to support a file format, it parses the information provided by the GDAL driver itself.
As you can see from your previous gdalinfo, GDAL doesn’t return CoordinateSystem, GeoTransfom neither:

Coordinate System is `’ <---- EMPTY

No “Origin/Pixel Size”, “GeoTransform” values are returned by gdalinfo,

This is what I get from a sample Landsat GeoTIFF, instead:

Coordinate System is:

GEOGCS[“WGS 84”,
DATUM[“WGS_1984”,
SPHEROID[“WGS 84”,6378137,298.257223563,
AUTHORITY[“EPSG”,“7030”]],
AUTHORITY[“EPSG”,“6326”]],
PRIMEM[“Greenwich”,0],
UNIT[“degree”,0.0174532925199433],
AUTHORITY[“EPSG”,“4326”]]
Origin = (125.833874279984470,37.952780993377843)
Pixel Size = (0.000269528093009,-0.000269528093009)

As you can see, that dataset has both a valid CoordinateReferenceSystem as well as Origin and PixelSize parameter which basically represents the GeoTransformation needed to properly locate pixels of the image in the proper position in the world. )That means that the dataset is georectified).

I think that the gdal_translate/gdalwarp command you have used has parsed the underlying information to produce a georectified GeoTIFF.

Hope this helps.
Best Regards,
Daniele

From: Smart, Gary Export License Required - US UTAS [mailto:Gary.Smart@anonymised.com]
Sent: 22 September 2015 18:17
To: Daniele Romagnoli
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] [External] Re: NITF files incorrectly georeferenced

I don’t think I have ever seen a NITF output from GDAL which reports anything on the line ‘Coordinate System is:’ – I was under the impression that the wealth of information below described the Coordinate System.

I was also under the impression that geoserver could import random NITF images (these are large NADIR views) and serve them through the WMS (i.e. presumably using GDAL to orthorectify the imagery en-route). To do this, I thought it used the four corner georeferencing clearly contained in this NITF file and all the others I have.

Is this not the case? I can see the images using the ‘layer preview’ tool, so I presume it can serve them somehow – and they look warped as required. But they just seem to be in the wrong place on the Earth!

From: dany.geotools@anonymised.com…84… [mailto:dany.geotools@anonymised.com] On Behalf Of Daniele Romagnoli

Sent: 22 September 2015 16:29
To: Smart, Gary Export License Required - US UTAS
Cc: geoserver-users@lists.sourceforge.net
Subject: [External] Re: [Geoserver-users] NITF files incorrectly georeferenced

Hi,

it seems like gdalinfo itself is unable to recognize the Coordinate Reference System of your sample.

Driver: NITF/National Imagery Transmission Format

Files: blah.ntf

Size is 5120, 10464

Coordinate System is `’ <------ EMPTY

Moreover, the gdalinfo shows that your file isn’t georectified: it contains ground control points (the reported WGS84 CRS is for the GCPs).

Therefore the sample is handled like a simple image (let’s say as a picture) using a Wildcard 2D Cartesian plane so that you can express coordinates as pixels positions.

You could consider using gdalwarp to georectify your samples so that they become valid for GeoServer.

Hope this helps.

Cheers,

Daniele

On Tue, Sep 22, 2015 at 4:45 PM, Smart, Gary Export License Required - US UTAS <Gary.Smart@anonymised.com> wrote:

I am trying to create a layer, either from a mosaic of NITF files, or even just a single NITF file. Some NITF files seem to work OK, but I have a many NITF2.1 files which have valid georeferencing but which fail to either mosaic or even load as separate NITF files. It is as if the NITF georeferencing is not being used.

When using the mosaic method, the store ‘.prj’ file ends up with:

LOCAL_CS[“Wildcard 2D cartesian plane in metric unit”, LOCAL_DATUM[“Unknown”, 0], UNIT[“m”, 1.0], AXIS[“x”, EAST], AXIS[“y”, NORTH], AUTHORITY[“EPSG”,“404000”]] which doesn’t look right given that the NITF gdalinfo’s are all close to…

Driver: NITF/National Imagery Transmission Format

Files: blah.ntf

Size is 5120, 10464

Coordinate System is `’

GCP Projection =

GEOGCS[“WGS 84”,

DATUM[“WGS_1984”,

SPHEROID[“WGS 84”,6378137,298.257223563,

AUTHORITY[“EPSG”,“7030”]],

TOWGS84[0,0,0,0,0,0,0],

AUTHORITY[“EPSG”,“6326”]],

PRIMEM[“Greenwich”,0,

AUTHORITY[“EPSG”,“8901”]],

UNIT[“degree”,0.0174532925199433,

AUTHORITY[“EPSG”,“9108”]],

AUTHORITY[“EPSG”,“4326”]]

GCP[ 0]: Id=UpperLeft, Info=

(0.5,0.5) → (1.292,52.662,0)

GCP[ 1]: Id=UpperRight, Info=

(5119.5,0.5) → (1.315,52.662,0)

GCP[ 2]: Id=LowerRight, Info=

(5119.5,10463.5) → (1.309,52.633,0)

GCP[ 3]: Id=LowerLeft, Info=

(0.5,10463.5) → (1.29,52.633,0)

Metadata:

NITF_ABPP=10

NITF_CCS_COLUMN=0

NITF_CCS_ROW=0

NITF_CLEVEL=06

NITF_ENCRYP=0

NITF_FBKGC= 48, 48, 48

NITF_FDT=20150922084921

NITF_FHDR=NITF02.10

NITF_FSCATP=O

NITF_FSCAUT=DGIC UK

NITF_FSCLAS=U

NITF_FSCLSY=UK

NITF_FSCLTX=

NITF_FSCODE=

NITF_FSCOP=00000

NITF_FSCPYS=00000

NITF_FSCRSN=

NITF_FSCTLH=

NITF_FSCTLN=

NITF_FSDCDT=

NITF_FSDCTP=O

NITF_FSDCXM=

NITF_FSDG=

NITF_FSDGDT=

NITF_FSREL=UK US

NITF_FSSRDT=

NITF_FTITLE=For map demo

NITF_IALVL=0

NITF_IC=NC

NITF_ICAT=EO

NITF_ICORDS=D

NITF_IDATIM=20020718092745

NITF_IDLVL=1

NITF_IGEOLO=+52.662+001.292+52.662+001.315+52.633+001.309+52.633+001.290

NITF_IID1=B014.F0003

NITF_IID2=18JUL029Z0000012ZX0E0003ZZ000A3856011611

NITF_ILOC_COLUMN=0

NITF_ILOC_ROW=0

NITF_IMAG=1.0

NITF_IMODE=B

NITF_IREP=MONO

NITF_ISCATP=O

NITF_ISCAUT=DGIC UK

NITF_ISCLAS=U

NITF_ISCLSY=UK

NITF_ISCLTX=

NITF_ISCODE=

NITF_ISCRSN=

NITF_ISCTLH=

NITF_ISCTLN=

NITF_ISDCDT=

NITF_ISDCTP=O

NITF_ISDCXM=

NITF_ISDG=

NITF_ISDGDT=

NITF_ISORCE= Ground Station

NITF_ISREL=UK US

NITF_ISSRDT=

NITF_ONAME=

NITF_OPHONE=

NITF_OSTAID=Ground Stn

NITF_PJUST=R

NITF_PVTYPE=INT

NITF_STYPE=BF01

NITF_TGTID=

Corner Coordinates:

Upper Left ( 0.0, 0.0)

Lower Left ( 0.0,10464.0)

Upper Right ( 5120.0, 0.0)

Lower Right ( 5120.0,10464.0)

Center ( 2560.0, 5232.0)

Band 1 Block=512x512 Type=UInt16, ColorInterp=Gray

I can view the NITF files and georeference them using GeoView and our own NITF viewer. I can preview the layer containing a single NITF file (in geoserver) but the georeferencing seems to be rubbish (perhaps origin at zero zero) even though the IGEOLO seems sound.

Any ideas?

Note that the mosaic tool crashes with (no too surprisingly) ‘No transformation available from system “EngineeringCRS[Wildcard 2D Cartesian plan in metric unit]” to “GeographicCRS[WGS84(DD)]”’



Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.

Ing. Daniele Romagnoli
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.



Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.

Ing. Daniele Romagnoli
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.