Opened 21 years ago

Last modified 20 years ago

#377 closed defect (worksforme)

No proj reference string in created JP2KAK GeoJP2

Reported by: chash@… Owned by: warmerdam
Priority: high Milestone:
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description

Used CreateCopy to create a JP2KAK based GeoJP2 from an ERDAS IMG (with 
verified projection reference).  Reading the JP2 back returns an empty 
projection reference string (GetProjectionRef()).  Geotransform coeffs are 
there, but no projection ref.

Here is the VRT for the input image:
<VRTDataset rasterXSize="3847" rasterYSize="3848">
  <SRS>PROJCS[&quot;Polar Stereographic&quot;,GEOGCS[&quot;Undefined&quot;,DATUM
[&quot;Undefined&quot;,SPHEROID[&quot;WGS 
84&quot;,6378137,298.2572235630016]],PRIMEM[&quot;Greenwich&quot;,0],UNIT
[&quot;degree&quot;,0.0174532925199433]],UNIT[&quot;meters&quot;,1],PROJECTION
[&quot;Polar_Stereographic&quot;],PARAMETER
[&quot;latitude_of_origin&quot;,60],PARAMETER
[&quot;central_meridian&quot;,180],PARAMETER
[&quot;scale_factor&quot;,1],PARAMETER[&quot;false_easting&quot;,0],PARAMETER
[&quot;false_northing&quot;,0]]</SRS>
  <GeoTransform>-5.2913714043326245e+005, 5.5000000000000000e+002, 
0.0000000000000000e+000, 1.5872628595667370e+006, 0.0000000000000000e+000,-
5.5000000000000000e+002</GeoTransform>
  <VRTRasterBand dataType="Byte" band="1">
    <SimpleSource>
      <SourceFilename>x:/NIC/ERDAS_IMG/f5n.24.03139.2201.v.img</SourceFilename>
      <SourceBand>1</SourceBand>
      <SrcRect xOff="0" yOff="0" xSize="3847" ySize="3848"/>
      <DstRect xOff="0" yOff="0" xSize="3847" ySize="3848"/>
    </SimpleSource>
  </VRTRasterBand>
</VRTDataset>

------------------------------------------------------------------

Here is the WKT the ERDAS IMG file I'm opening gives:
PROJCS["Polar Stereographic",
    GEOGCS["Undefined",
        DATUM["Undefined",
            SPHEROID["WGS 84",6378137,298.2572235630016]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433]],
    UNIT["meters",1],
    PROJECTION["Polar_Stereographic"],
    PARAMETER["latitude_of_origin",60],
    PARAMETER["central_meridian",180],
    PARAMETER["scale_factor",1],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0]]

Change History (3)

comment:1 by warmerdam, 21 years ago

Chris, 

After modifying the file referenced a bit, I was able to do a conversion 
using the command:
 gdal_translate -of JP2KAK wrk.vrt out.jp2

I get the following (seemly correct) result:


warmerda@gdal2200[150]% gdalinfo out.jp2
JP2KAK: nResCount=6
GDAL: Got projection:
PROJCS["unnamed",GEOGCS["unnamed",DATUM["unknown",SPHEROID["unnamed",6378137,298.2572235629972]],PRIMEM["Greenwich",0],UNIT[,0.0174532925199433]],PROJECTION["Polar_Stereographic"],PARAMETER["latitude_of_origin",60],PARAMETER["central_meridian",180],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]]]
GDAL: GDALOpen(out.jp2) succeeds as JP2KAK.

Driver: JP2KAK/JPEG-2000 (based on Kakadu)
Size is 3000, 3000
Coordinate System is:
PROJCS["unnamed",
    GEOGCS["unnamed",
        DATUM["unknown",
            SPHEROID["unnamed",6378137,298.2572235629972]],
        PRIMEM["Greenwich",0],
        UNIT[,0.0174532925199433]],
    PROJECTION["Polar_Stereographic"],
    PARAMETER["latitude_of_origin",60],
    PARAMETER["central_meridian",180],
    PARAMETER["scale_factor",1],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]]]
Origin = (-529137.140433,1587262.859567)
Pixel Size = (550.000000,-0.000000)
Corner Coordinates:
Upper Left  ( -529137.140, 1587262.860) ( 18d26'11.61"E, 74d 2'43.98"N)
Lower Left  ( -529137.140, 1587262.860) ( 18d26'11.61"E, 74d 2'43.98"N)
Upper Right ( 1120862.860, 1587262.860) ( 35d13'41.67"W, 71d30'39.12"N)
Lower Right ( 1120862.860, 1587262.860) ( 35d13'41.67"W, 71d30'39.12"N)
Center      (  295862.860, 1587262.860) ( 10d33'31.16"W, 74d35'49.84"N)
Band 1 Block=512x128 Type=Byte, ColorInterp=Gray
  Overviews: 1500x1500, 750x750, 375x375, 188x188, 94x94
GDAL: GDALClose(out.jp2)

GDAL: GDALDeregister_GTiff() called.

I was working with the CVS version of GDAL, on Linux.  I presume
you have built from source on windows using Kakadu 4.0, is that right?
You didn't try to use an external libtiff or libgeotiff library did you?
Anything else you can think of that might be odd about your build config?

Could you try the same translation using the gdal_translate.exe in 
the OpenEV_FW_162?  

  http://gdal.maptools.org/dl/openev/OpenEV_FW_162.zip

I *think* this is some sort of build or version issue. 

comment:2 by warmerdam, 21 years ago

Chris, 

Did you get any further with this?


comment:3 by warmerdam, 20 years ago

Closing this since there hasn't been any further info.  Let me know if you can
help me reproduce the problem. 

Note: See TracTickets for help on using tickets.