[mapserver-users] Raster projection troubles - empty image by projection epsg:31255
Bartlomiej Burkot
pomiarowiec10 at poczta.onet.pl
Tue Sep 2 06:53:40 PDT 2014
Hi
I spent much time searching for reason why my raster does not appear in
WMS layer.
My raster is in EPSG:31255 projection
gdalinfo samle_raster.tif
Driver: GTiff/GeoTIFF
Files: samle_raster.tif
Size is 5000, 4000
Coordinate System is:
PROJCS["MGI / Austria GK Central",
GEOGCS["MGI",
DATUM["Militar_Geographische_Institute",
SPHEROID["Bessel 1841",6377397.155,299.1528128000008,
AUTHORITY["EPSG","7004"]],
TOWGS84[577.326,90.129,463.919,5.137,1.474,5.297,2.4232],
AUTHORITY["EPSG","6312"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4312"]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",13.33333333333333],
PARAMETER["scale_factor",1],
PARAMETER["false_easting",0],
PARAMETER["false_northing",-5000000],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AUTHORITY["EPSG","31255"]]
Origin = (-112500.000000057683792,274999.999999893829226)
Pixel Size = (0.249999999999589,-0.249999999999589)
Metadata:
AREA_OR_POINT=Area
TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
TIFFTAG_XRESOLUTION=72
TIFFTAG_YRESOLUTION=72
Image Structure Metadata:
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left ( -112500.000, 275000.000) ( 11d50'13.22"E, 47d36'16.17"N)
Lower Left ( -112500.000, 274000.000) ( 11d50'14.14"E, 47d35'43.80"N)
Upper Right ( -111250.000, 275000.000) ( 11d51'13.05"E, 47d36'16.95"N)
Lower Right ( -111250.000, 274000.000) ( 11d51'13.96"E, 47d35'44.57"N)
Center ( -111875.000, 274500.000) ( 11d50'43.59"E, 47d36' 0.37"N)
Band 1 Block=5000x1 Type=Byte, ColorInterp=Red
Description = Band_1
Metadata:
LAYER_TYPE=athematic
Band 2 Block=5000x1 Type=Byte, ColorInterp=Green
Description = Band_2
Metadata:
LAYER_TYPE=athematic
Band 3 Block=5000x1 Type=Byte, ColorInterp=Blue
Description = Band_3
Metadata:
LAYER_TYPE=athematic
I can show it in qgis and reproject to any coordinate system for example
epsg:3857.
My mapfile is:
MAP
IMAGETYPE PNG
EXTENT -120000 270000 -110000 275000
SIZE 800 600
RESOLUTION 72
CONFIG "MS_ERRORFILE" "../log/ms_error_standard.log"
DEBUG 5
NAME myname
CONFIG "CPL_DEBUG" "ON"
CONFIG "PROJ_DEBUG" "ON"
CONFIG "PROJ_LIB" "/usr/share/proj/"
PROJECTION
"init=epsg:31255"
END
WEB
METADATA
wms_title "standard data in wgw"
"wms_enable_request" "GetMap GetFeatureInfo GetCapabilities"
"wms_srs" "EPSG:31255 EPSG:4326 EPSG:3857 EPSG:2180 EPSG:31287"
END
END
LAYER
NAME "oneRaster"
DATA "samle_raster.tif"
TYPE RASTER
STATUS ON
PROJECTION
"init=epsg:31255"
END
METADATA
wms_title "Sample raster"
wms_srs "EPSG:31255"
END
END
END #MAP
I'm using mapserver 6.4.1 in cgi mode on the Ubuntu 14.04 linux
installed with apt-get install cgi-mapserver:
/usr/lib/cgi-bin/mapserv -v
MapServer version 6.4.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML
SUPPORTS=PROJ SUPPORTS=GD SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO
SUPPORTS=SVG_SYMBOLS SUPPORTS=RSVG SUPPORTS=ICONV SUPPORTS=FRIBIDI
SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER
SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER
SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS
INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
When Im requesting a map:
http://myhost/cgi-bin/wmsstandard?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=-112516.67630140134133399,273973.2257158225402236,-111233.66681915351364296,275020.36552757304161787&CRS=EPSG:31255&WIDTH=1038&HEIGHT=846&LAYERS=oneRaster&STYLES=&FORMAT=image/jpeg&DPI=96&MAP_RESOLUTION=96&FORMAT_OPTIONS=dpi:96
I got a message in /var/log/apache2/error.log
[Tue Sep 02 15:01:30.386845 2014] [cgi:error] [pid 2057] [client
myip:65403] AH01215: GDAL: GDALOpen(/pathto/sample.tif, this=0x819310)
succeeds as GTiff.
[Tue Sep 02 15:01:30.396083 2014] [cgi:error] [pid 2057] [client
myip:65403] AH01215: GDAL: GDALClose(/pathto/sample.tif,, this=0x819310)
ms_error_standard.log:
[Tue Sep 2 15:04:45 2014].609914 CGI Request 1 on process 5909
[Tue Sep 2 15:04:45 2014].610243 msWMSLoadGetMapParams(): enabling
non-square pixels.
[Tue Sep 2 15:04:45 2014].614988 msDrawMap(): kicking into non-square
pixel preserving mode.
[Tue Sep 2 15:04:45 2014].615034 msDrawMap(): rendering using
outputformat named AGG_JPEG (AGG/JPEG).
[Tue Sep 2 15:04:45 2014].615064 msDrawMap(): WMS/WFS set-up and query,
0.000s
[Tue Sep 2 15:04:45 2014].617587 msDrawRasterLayerLow(oneRaster): entering.
[Tue Sep 2 15:04:45 2014].619764 msDrawMap(): Layer 1 (oneRaster), 0.005s
[Tue Sep 2 15:04:45 2014].619805 msDrawMap(): Drawing Label Cache, 0.000s
[Tue Sep 2 15:04:45 2014].619816 msDrawMap() total time: 0.009s
[Tue Sep 2 15:04:45 2014].627898 msSaveImage(stdout) total time: 0.008s
[Tue Sep 2 15:04:45 2014].628129 mapserv request processing time
(msLoadMap not incl.): 0.018s
[Tue Sep 2 15:04:45 2014].628152 msFreeMap(): freeing map at 0xd0c570.
The requested image is white/empty
The proj4 epsg file does include my projection:
more /usr/share/proj/epsg | grep 31255
#<31255> +proj=tmerc +lat_0=0 +lon_0=13.33333333333333 +k=1 +x_0=0
+y_0=-5000000 +datum=hermannskogel +units=m +no_defs <>
<31255> +proj=tmerc +lat_0=0 +lon_0=13.33333333333333 +k=1 +x_0=0
+y_0=-5000000 +ellps=bessel
+towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m
+no_defs <>
And pcs.csv as well:
more /usr/share/gdal/1.10/pcs.csv | grep 31255
31255,"MGI / Austria GK
Central",9001,4312,18005,9807,1,0,4530,8801,0,9110,8802,13.2,9110,8805,1,9201,8806,0,9001,8807,-5000000,9001,,,,,,
When I convert the rasterfile to epsg:3857 using gdalwarp and request
Layer in the same crs&CRS=EPSG:31255& I get the correct getMap request.
If I switch to &CRS=EPSG:31255& to force mapserver to reproject I got
the same white/empty image.
Could somebody help me?
I can send you a sample of raster on email address.
Bartek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20140902/d8f2bfc8/attachment.htm>
More information about the MapServer-users
mailing list