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

fred p mapoubelle22 at gmail.com
Wed Aug 12 07:43:31 PDT 2015


Thanks to Jeff for the answer.

I simplified the mapfile to make it easier to read.

Below I give the mapfile with these additional elements. I do not have
warnings anymore with a GetCapabilities request but the image I get whith a
GetMap request is still incomplete.

Note that I get an error (*msProcessProjection(): Projection library error.
proj error "projection not named" for ""*) with a projection block in the
layer section if I declare the real projection definition (*"+proj=longlat
+a=6378160 +b=6356775 +no_defs "*). No error with *"+init=epsg:4326"* which
is closed to the real projection definition. As I have read somewhere that
if not present the projection is read in the data file, I have removed it
(the image I get is the same).



MAP
    STATUS       ON
    NAME         "foo"
    CONFIG       "MS_ERRORFILE" "stderr"
    IMAGETYPE    "agg"
    MAXSIZE      8192
    EXTENT       -180 -90 180 90
    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"
            "ows_onlineresource"            "http://127.0.0.1:8080/wms"
            "wms_title"                     "WMS"
            "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"
        METADATA
            "wms_title" "foo"
        END
        #PROJECTION
        #    "init=epsg:4326"
        #END
        #PROJECTION
        #    "+proj=longlat +a=6378160 +b=6356775 +no_defs"
        #END
    END
END



2015-08-12 13:37 GMT+00:00 Jeff McKenna <jmckenna at gatewaygeomatics.com>:

> 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/
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20150812/e3a8128c/attachment.html>


More information about the mapserver-users mailing list