[MAPSERVER-USERS] Accessing GDAL raster in MapServer

Pål Kristensen pal.kristensen at statkart.no
Mon Jun 2 01:54:06 EDT 2008


Hi Jeff!

Thanks for helping out on issue!

I did what you suggested, but without success. Bellow you will see the
mapfile, output from gedalinfo and the shp2img command and the error
message. Too me it looks like gdal actually is capable of reading the
raster, but for some reason mapserver fails to draw the map. 


Mapfile:
MAP
    NAME "Rendertest"
    STATUS ON
    SIZE 800 500
    DEBUG 4
    #IMAGETYPE PNG
    #IMAGECOLOR 255 255 255
    #SYMBOLSET "c:/ms4w/sym/symbols/SKsym.sym"
    #FONTSET "c:/ms4w/sym/skfonts/font.list"
    EXTENT -0.9542169 52.2914669 52.1350165 68.3413231
    SHAPEPATH "E:/RPF_test/"
    UNITS dd
    #MAXSIZE 2048
    #RESOLUTION 96    
    
    #PROJECTION
    #  "init=epsg:4326"
    #END
    WEB
        IMAGEPATH "C:/ms4w/tmp/ms_tmp/"
        IMAGEURL "/ms_tmp/"
    END
   LAYER
      NAME "Test"
      DEBUG 4
      STATUS ON
      DATA "rpf/a.toc"
      TYPE RASTER
      #MINSCALE 3000000
      #PROCESSING "RESAMPLE=AVERAGE"
      #PROCESSING "RESAMPLE=BILINEAR"
      PROCESSING "RPFTOC_FORCE_RGBA=TRUE"
      METADATA
         "wms_title" "Test"
         "wms_style" "Default"
      END
     # PROJECTION
     #    "init=epsg:4326"
     # END
   END
END

Output from gdalinfo:
Driver: RPFTOC/Raster Product Format TOC format
Files: E:\RPF_test\RPF\A.TOC
Size is 96646, 47616
Coordinate System is:
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"]],
    AXIS["Lat",NORTH],
    AXIS["Long",EAST],
    AUTHORITY["EPSG","4326"]]
Origin = (-0.954216867469881,68.341323106423786)
Pixel Size = (0.000549316406250,-0.000337068552253)
Metadata:
  NITF_FHDR=NITF02.00
  NITF_CLEVEL=03
  NITF_STYPE=
  NITF_OSTAID=DMAAC
  NITF_FDT=18090333ZMAR98
  NITF_FTITLE=       A.TOC
  NITF_FSCLAS=U
  NITF_FSCODE=
  NITF_FSCTLH=
  NITF_FSREL=
  NITF_FSCAUT=
  NITF_FSCTLN=
  NITF_FSDWNG=
  NITF_FSCOP=00000
  NITF_FSCPYS=00000
  NITF_ENCRYP=0
  NITF_ONAME=DMA Aerospace Center
  NITF_OPHONE=
Subdatasets:
 
SUBDATASET_1_NAME=NITF_TOC_ENTRY:CADRG_JOG-A_250K_6_0:E:\RPF_test\RPF\A.TOC
  SUBDATASET_1_DESC=CADRG:JOG-A:Joint Operation Graphic - Air:250K:6:0
 
SUBDATASET_2_NAME=NITF_TOC_ENTRY:CADRG_JOG-A_250K_5_1:E:\RPF_test\RPF\A.TOC
  SUBDATASET_2_DESC=CADRG:JOG-A:Joint Operation Graphic - Air:250K:5:1
 
SUBDATASET_3_NAME=NITF_TOC_ENTRY:CADRG_JOG-A_250K_4_2:E:\RPF_test\RPF\A.TOC
  SUBDATASET_3_DESC=CADRG:JOG-A:Joint Operation Graphic - Air:250K:4:2
 
SUBDATASET_4_NAME=NITF_TOC_ENTRY:CADRG_JOG-A_250K_4_3:E:\RPF_test\RPF\A.TOC
  SUBDATASET_4_DESC=CADRG:JOG-A:Joint Operation Graphic - Air:250K:4:3
 
SUBDATASET_5_NAME=NITF_TOC_ENTRY:CADRG_JOG-A_250K_4_4:E:\RPF_test\RPF\A.TOC
  SUBDATASET_5_DESC=CADRG:JOG-A:Joint Operation Graphic - Air:250K:4:4
 
SUBDATASET_6_NAME=NITF_TOC_ENTRY:CADRG_JOG-A_250K_4_5:E:\RPF_test\RPF\A.TOC
  SUBDATASET_6_DESC=CADRG:JOG-A:Joint Operation Graphic - Air:250K:4:5
 
SUBDATASET_7_NAME=NITF_TOC_ENTRY:CADRG_JOG-A_250K_3_6:E:\RPF_test\RPF\A.TOC
  SUBDATASET_7_DESC=CADRG:JOG-A:Joint Operation Graphic - Air:250K:3:6
 
SUBDATASET_8_NAME=NITF_TOC_ENTRY:CADRG_JOG-A_250K_3_7:E:\RPF_test\RPF\A.TOC
  SUBDATASET_8_DESC=CADRG:JOG-A:Joint Operation Graphic - Air:250K:3:7
 
SUBDATASET_9_NAME=NITF_TOC_ENTRY:CADRG_JOG-A_250K_3_8:E:\RPF_test\RPF\A.TOC
  SUBDATASET_9_DESC=CADRG:JOG-A:Joint Operation Graphic - Air:250K:3:8
 
SUBDATASET_10_NAME=NITF_TOC_ENTRY:CADRG_JOG-A_250K_3_9:E:\RPF_test\RPF\A.TOC
  SUBDATASET_10_DESC=CADRG:JOG-A:Joint Operation Graphic - Air:250K:3:9
 
SUBDATASET_11_NAME=NITF_TOC_ENTRY:CADRG_JOG-A_250K_3_10:E:\RPF_test\RPF\A.TOC
  SUBDATASET_11_DESC=CADRG:JOG-A:Joint Operation Graphic - Air:250K:3:10
 
SUBDATASET_12_NAME=NITF_TOC_ENTRY:CADRG_JOG-A_250K_3_11:E:\RPF_test\RPF\A.TOC
  SUBDATASET_12_DESC=CADRG:JOG-A:Joint Operation Graphic - Air:250K:3:11
Corner Coordinates:
Upper Left  (  -0.9542169,  68.3413231) (  0d57'15.18"W, 68d20'28.76"N)
Lower Left  (  -0.9542169,  52.2914669) (  0d57'15.18"W, 52d17'29.28"N)
Upper Right (  52.1350165,  68.3413231) ( 52d 8'6.06"E, 68d20'28.76"N)
Lower Right (  52.1350165,  52.2914669) ( 52d 8'6.06"E, 52d17'29.28"N)
Center      (  25.5903998,  60.3163950) ( 25d35'25.44"E, 60d18'59.02"N)

shp2img command:
shp2img -m C:\ms4w\apps\rendertest\mapfiles\rendertest.map -o test.png -i
png -all_debug 5

shp2img error:
msDrawRasterLayerLow(Test): entering.
msDrawGDAL(): src=0,0,96646,47616, dst=0,129,800,242
msDrawGDAL(): red,green,blue,alpha bands = 1,0,0,0
msDrawMap(): Image handling error. Failed to draw layer named 'Test'.
msDrawMap(): Image handling error. Failed to draw layer named 'Test'. <br>
msFreeMap(): freeing map at 0164B3E0.


Regards,
Pål Kristensen



Jeff McKenna-3 wrote:
> 
> hmm.  I would do the following for testing:
> 
> - remove all projection objects
> - remove MAXSIZE and RESOLUTION (in case they are causing trouble)
> - use gdalinfo commandline utility to get the exact extents of the  
> image (and to make sure your image can be read by your GDAL version)
> - make sure the UNITS value is set to the correct value
> - use the shp2img commandline utility for testing
> 
> 
> --jeff
> 
> 
> 
> 
> On 29-May-08, at 6:33 AM, Pål Kristensen wrote:
> 
>>
>> Hi!
>>
>> I'm trying to serve some CADRG (A.toc) data through MapServer, but I'm
>> obviously doing something wrong because all I get is some error  
>> messages in
>> the logfile. I'm currently using the latest MS4W release.
>>
>> This is how the mapfile looks like:
>> MAP
>>    NAME "Rendertest"
>>    STATUS ON
>>    SIZE 800 500
>>    DEBUG 4
>>    #IMAGETYPE PNG
>>    #IMAGECOLOR 255 255 255
>>    #SYMBOLSET "c:/ms4w/sym/symbols/SKsym.sym"
>>    #FONTSET "c:/ms4w/sym/skfonts/font.list"
>>    EXTENT -1 53 53 68
>>    SHAPEPATH "E:/RPF_test/"
>>    UNITS dd
>>    MAXSIZE 2048
>>    RESOLUTION 96
>>
>>    PROJECTION
>>      "init=epsg:4326"
>>    END
>>    WEB
>>        IMAGEPATH "C:/ms4w/tmp/ms_tmp/"
>>        IMAGEURL "/ms_tmp/"
>>        METADATA
>>            "ows_schemas_location" "http://schemas.opengeospatial.net"
>>            "ows_accessconstraints" "Copyright Statens kartverk 2007"
>>             "wms_srs" "EPSG:4326 EPSG:27391 EPSG:27392 EPSG:27393
>> EPSG:27394 EPSG:27395 EPSG:27396 EPSG:27397 EPSG:27398 EPSG:3034  
>> EPSG:32635
>> EPSG:32633 EPSG:32634 EPSG:32631 EPSG:32636 EPSG:32632"
>>            "ows_exceptions_format" "application/vnd.ogc.se_xml"
>>        END
>>    END
>>   LAYER
>>      NAME "Test"
>>      DEBUG 4
>>      STATUS ON
>>      DATA "rpf/a.toc"
>>      TYPE RASTER
>>      #MINSCALE 3000000
>>      #PROCESSING "RESAMPLE=AVERAGE"
>>      #PROCESSING "RESAMPLE=BILINEAR"
>>      #PROCESSING "RPFTOC_FORCE_RGBA=TRUE"
>>      METADATA
>>         "wms_title" "Test"
>>      END
>>      PROJECTION
>>         "init=epsg:4326"
>>      END
>>   END
>> END
>>
>> And this is the error message:
>> [Thu May 29 12:11:41 2008].641000 CGI Request 1 on process 1516
>> [Thu May 29 12:11:41 2008].688000 msDrawRasterLayerLow(Test):  
>> entering.
>> [Thu May 29 12:11:42 2008].125000 msResampleGDALToMap in effect:  
>> cellsize =
>> 0.053997
>> [Thu May 29 12:11:42 2008].125000 msDrawGDAL(Test): using  
>> RAW_WINDOW=805 0
>> 95841 47616
>> [Thu May 29 12:11:42 2008].125000 msDrawGDAL(): red,green,blue,alpha  
>> bands =
>> 1,0,0,0
>> [Thu May 29 12:11:42 2008].125000 msDrawMap(): Image handling error.  
>> Failed
>> to draw layer named 'Test'.
>> [Thu May 29 12:11:42 2008].125000 msFreeMap(): freeing map at 01535F40
>>
>> I would really appreciate any help on this issue?
>>
>> Regards,
>> Pål Kristensen
>> -- 
>> View this message in context:
>> http://www.nabble.com/Accessing-GDAL-raster-in-MapServer-tp17532414p17532414.html
>> Sent from the Mapserver - User mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
> ---
> Jeff McKenna
> FOSS4G Consulting and Training Services
> http://www.gatewaygeomatics.com/
> 
> 
> 
> 
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
> 

-- 
View this message in context: http://www.nabble.com/Accessing-GDAL-raster-in-MapServer-tp17532414p17594424.html
Sent from the Mapserver - User mailing list archive at Nabble.com.



More information about the mapserver-users mailing list