[mapserver-users] rendering a raster crossing the antimeridian through a WMS

Jeff McKenna jmckenna at gatewaygeomatics.com
Wed Aug 12 06:37:04 PDT 2015


On 2015-08-12 10:08 AM, fred p wrote:
> Hello,
>
> I do not manage do fully render in a Mapserver WMS a raster that crosses
> the antimeridian when I request a -180°/+180° longitude bbox.
>
> This is the request :
> mapserv -nh
> "QUERY_STRING=map=mapfile.map&layers=polar_orbiting_avhrr4&styles=&service=WMS&format=image%2Fpng&request=GetMap&height=400&width=800&version=1.1.1&bbox=-179.99%2C-89.99%2C179.99%2C89.99&exceptions=application%2Fvnd.ogc.se_inimage&srs=EPSG%3A4326&transparent=TRUE
>
> In the result image, I only get the western side of the raster, near the
> +180°. Nothing for the eastern part near the -180°.
>
> How to solve this problem ?
>
> This is a description of the raster :
> Driver: GTiff/GeoTIFF
> Files: /tmp/polar_orbiting_avhrr4.tiff
> Size is 7021, 4321
> Coordinate System is:
> GEOGCS["unnamed ellipse",
>      DATUM["unknown",
>          SPHEROID["unnamed",6378160,298.2539162964669]],
>      PRIMEM["Greenwich",0],
>      UNIT["degree",0.0174532925199433]]
> Origin = (135.000000000000000,0.000000000000000)
> Pixel Size = (0.009257940464321,-0.009257116408239)
> Metadata:
>    AREA_OR_POINT=Area
> Image Structure Metadata:
>    INTERLEAVE=BAND
> Corner Coordinates:
> Upper Left  ( 135.0000000,   0.0000000) (135d 0' 0.00"E,  0d 0' 0.01"N)
> Lower Left  ( 135.0000000, -40.0000000) (135d 0' 0.00"E, 40d 0' 0.00"S)
> Upper Right (     200.000,       0.000) (200d 0' 0.00"E,  0d 0' 0.01"N)
> Lower Right (     200.000,     -40.000) (200d 0' 0.00"E, 40d 0' 0.00"S)
> Center      ( 167.5000000, -20.0000000) (167d30' 0.00"E, 20d 0' 0.00"S)
> Band 1 Block=7021x1 Type=Byte, ColorInterp=Gray
>
>
> This is the mapfile contents :
> MAP
>      STATUS       ON
>      NAME         "foo"
>      CONFIG       "MS_ERRORFILE" "stderr"
>      IMAGETYPE    "agg"
>      MAXSIZE      8192
>      PROJECTION
>          "init=epsg:4326"
>      END
>      OUTPUTFORMAT
>          NAME            "agg"
>          DRIVER          "AGG/PNG"
>          MIMETYPE        "image/png8"
>          IMAGEMODE       "PC256"
>          EXTENSION       "png"
>      END
>      WEB
>          METADATA
>              "ows_enable_request"            "*"
>              "ows_sld_enabled"               "true"
>              "wms_feature_info_mime_type"    "text/html"
>              "wms_srs"                       "epsg:4326"
>          END
>      END
>      LAYER
>          STATUS        ON
>          TYPE          RASTER
>          NAME          "polar_orbiting_avhrr4"
>          DATA          "/tmp/polar_orbiting_avhrr4.tiff"
>          OFFSITE       0 0 0
>          PROCESSING    "RESAMPLE=NEAREST"
>      END
> END
>
>
>

By the looks of your layer, before tackling any problems, be sure to 
execute a GetCapabilities request to your service, and be sure to remove 
any "WARNING" messages returned.  For example, I bet that you have 
warnings for missing metadata of wms_title, wms_srs, as well as missing 
PROJECTION block for your layer.

It's good practice to first remove the warnings on any WMS service 
(because those warnings will cause problems for downstream users of your 
service).

-jeff

-- 
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/













More information about the MapServer-users mailing list