[MS4W-Users] Geotif - WMS using MS4W Zoo

Morten Aronsen mortenaron at gmail.com
Tue Jun 2 08:42:35 EDT 2020


I’m strugling…

With GeoTif output from a Zoo-service using useMapserver = true



My python-service is reading a NETCDF-file, calculating climatology data
and returning a geotif file made by gdal (in code python). My zcfg-file
output is:



<DataOutputs>

                [Result]

                Title = Impact map climatology

                Abstract = Geotif file containing the values from 1.25
Green to 3.75 Red through yellow. image/png will give wms output.

                <MetaData>

                               title = ImpactClimatology

                </MetaData>

                <ComplexData>

                               <Default>

                                               mimeType = image/tiff

                                               useMapserver = true

                               </Default>

                               <Supported>

                                               mimeType = image/png

                                               useMapserver = true

                                               asReference = true

                                               msInclude =
/ms4w/impact/impact.map

                                               msLayer = imp

                               </Supported>

                               <Supported>

                                               mimeType = image/tiff

                               </Supported>

                </ComplexData>

</DataOutputs>



My impact map is (this is just test style expressions):

MAP
LAYER
NAME "imp" # Corresponding to the msLayer defined
TYPE RASTER
CONNECTION "Result"
STATUS on
CLASSITEM "[pixel]"
 # class using an EXPRESSION using only [pixel].
CLASS
EXPRESSION ([pixel] = 1.25)
STYLE
 COLOR 0 255 0
END
END
CLASS
EXPRESSION ([pixel] = 1.5)
STYLE
 COLOR 64 255 0
END
END
CLASS
EXPRESSION ([pixel] = 1.75)
STYLE
 COLOR 128 255 0
END
END
CLASS
EXPRESSION ([pixel] = 2.25)
STYLE
 COLOR 192 255 0
END
END
CLASS
EXPRESSION ([pixel] = 2.5)
STYLE
 COLOR 255 255 0
END
END
CLASS
EXPRESSION ([pixel] = 2.75)
STYLE
 COLOR 255 192 0
END
END
CLASS
EXPRESSION ([pixel] = 3.25)
STYLE
 COLOR 255 128 0
END
END
CLASS
EXPRESSION ([pixel] = 3.5)
STYLE
 COLOR 255 64 0
END
END
CLASS
EXPRESSION ([pixel] = 3.75)
STYLE
 COLOR 255 0 0
END
END
END # LAYER
END



First of all, not using the impact.map-file and include a msStyle in the
zcfg is not working. It is not picked up in the map-file created by zoo.

With the impact.map included the style is picked up but image is blank. The
map-file is attached.
[image: image.jpeg]



Not using any style what so ever presents the wanted image output from:



http://localhost/cgi-bin/zoo_loader.cgi?SERVICE=WPS&VERSION=1.0.0&REQUEST=Execute&Identifier=Impact_M_ASW&ResponseDocument=Result@asReference=true@mimeType=image/png


[image: image.jpeg]



But I want to style the pixel values (a step gradient of 0.25 where 1.25 =
green, 2.5 = yellow and 3.75 = red)





(PS using RawDataOutput does not work as a direkt link to mapserver for
some reason.)



Is the problem connected to the fact that the output from the service is a
geotif 1-band with pixel values and not vector data?

Geotif attached. (similar to the netcdf output problem, which do not work
for useMapserver output).





Here is an example made in QGIS with the same tif-file:
[image: image.jpeg]



Regards

*Morten*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ms4w.com/pipermail/ms4w-users/attachments/20200602/d03baf29/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.jpeg
Type: image/jpeg
Size: 2529 bytes
Desc: not available
URL: <https://lists.ms4w.com/pipermail/ms4w-users/attachments/20200602/d03baf29/attachment-0003.jpeg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.jpeg
Type: image/jpeg
Size: 16432 bytes
Desc: not available
URL: <https://lists.ms4w.com/pipermail/ms4w-users/attachments/20200602/d03baf29/attachment-0004.jpeg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.jpeg
Type: image/jpeg
Size: 7057 bytes
Desc: not available
URL: <https://lists.ms4w.com/pipermail/ms4w-users/attachments/20200602/d03baf29/attachment-0005.jpeg>
-------------- next part --------------
MAP
  EXTENT -19.75 40.25 54.75 74.75
  IMAGETYPE "png"
  NAME "ZOO-Project_WXS_Server"
  SIZE 299 139
  STATUS ON
  SYMBOLSET "/ms4w/apps/zoo-project/data/symbols.sym"
  TRANSPARENT TRUE
  UNITS METERS

  OUTPUTFORMAT
    NAME "png"
    MIMETYPE "image/png"
    DRIVER "AGG/PNG"
    EXTENSION "png"
    IMAGEMODE RGB
    TRANSPARENT FALSE
  END # OUTPUTFORMAT

  OUTPUTFORMAT
    NAME "kml"
    MIMETYPE "application/vnd.google-earth.kml+xml"
    DRIVER "KML"
    EXTENSION "kml"
    IMAGEMODE RGB
    TRANSPARENT FALSE
    FORMATOPTION "ATTACHMENT=mapserver.kml"
  END # OUTPUTFORMAT

  OUTPUTFORMAT
    NAME "tiff"
    MIMETYPE "image/tiff"
    DRIVER "GDAL/GTiff"
    EXTENSION "tif"
    IMAGEMODE FLOAT32
    TRANSPARENT FALSE
  END # OUTPUTFORMAT

  OUTPUTFORMAT
    NAME "grd"
    DRIVER "GDAL/AAIGRID"
    EXTENSION "asc"
    IMAGEMODE BYTE
    TRANSPARENT FALSE
  END # OUTPUTFORMAT

  OUTPUTFORMAT
    NAME "cairopng"
    MIMETYPE "image/png; mode=24bit"
    DRIVER "CAIRO/PNG"
    EXTENSION "png"
    IMAGEMODE RGBA
    TRANSPARENT TRUE
  END # OUTPUTFORMAT

  OUTPUTFORMAT
    NAME "geotiff"
    MIMETYPE "image/geotiff"
    DRIVER "GDAL/GTiff"
    EXTENSION "tif"
    IMAGEMODE FLOAT32
    TRANSPARENT FALSE
  END # OUTPUTFORMAT

  PROJECTION
    "init=epsg:4326"
    "+epsgaxis=ne"
  END # PROJECTION
  LEGEND
    KEYSIZE 20 10
    KEYSPACING 5 5
    LABEL
      SIZE 10
      OFFSET 0 0
      SHADOWSIZE 1 1
    END # LABEL
    STATUS OFF
  END # LEGEND

  QUERYMAP
    SIZE -1 -1
    STATUS OFF
    STYLE HILITE
  END # QUERYMAP

  SCALEBAR
    INTERVALS 4
    LABEL
      SIZE 10
      OFFSET 0 0
      SHADOWSIZE 1 1
    END # LABEL
    SIZE 200 3
    STATUS OFF
    UNITS MILES
  END # SCALEBAR

  WEB
    IMAGEPATH "/ms4w/tmp/ms_tmp"
    IMAGEURL "http://127.0.0.1/ms_tmp/"
    METADATA
      "ows_country"	"ca"
      "ows_contactfacsimiletelephone"	"False"
      "ows_contactvoicetelephone"	"False"
      "ows_keywordlist"	"WPS,service,MapServer,PHP,Python,Java,CSharp,GDAL,OGR,GIS,buffer"
      "ows_encoding"	"utf-8"
      "ows_city"	"Lunenburg"
      "ows_contactperson"	"Jeff McKenna"
      "ows_abstract"	"Web Processing Service served through MS4W (http://ms4w.com). For more information on ZOO-Project WPS software see http://www.zoo-project.org"
      "ows_contactposition"	"Director"
      "ows_rootlayer_title"	"ZOO_Project_Layer"
      "ows_onlineresource"	"http://127.0.0.1/cgi-bin/mapserv.exe?map=/ms4w/apps/zoo-project/data/Result_0_d03eb9ff-adeb-4f08-9e67-e132e12ff82a.map"
      "ows_role"	"Dev"
      "ows_enable_request"	"*"
      "ows_stateorprovince"	"False"
      "ows_contactorganization"	"Gateway Geomatics"
      "ows_service_onlineresource"	"http://gatewaygeomatics.com"
      "ows_accessconstraints"	"none"
      "ows_srs"	"EPSG:4326 EPSG:900913 EPSG:3857 EPSG:4326"
      "ows_rootlayer_name"	"ZOO_Project_Layer"
      "ows_title"	"Web Processing Service through MS4W"
      "ows_fees"	"None"
      "ows_contactelectronicmailaddress"	"info at gatewaygeomatics.com"
      "ows_postcode"	"B0J 2C0"
    END # METADATA
  END # WEB

  LAYER
    CLASSITEM "[pixel]"
    CONNECTION "Result"
    NAME "imp"
    STATUS ON
    TILEITEM "location"
    TYPE RASTER
    UNITS METERS
    CLASS
      EXPRESSION "0"
      STYLE
        COLOR 0 0 0
      END # STYLE
    END # CLASS
    CLASS
      EXPRESSION ([pixel] >= 1 AND [pixel] < 3)
      STYLE
        COLOR 255 0 0
      END # STYLE
    END # CLASS
  END # LAYER

  LAYER
    DATA "/ms4w/apps/zoo-project/data/ZOO_DATA_0_Result_d03eb9ff-adeb-4f08-9e67-e132e12ff82a.data"
    METADATA
      "ows_rangeset_label"	"Impact map climatology"
      "ows_rangeset_name"	"Result"
      "ows_abstract"	"Geotif file containing the values from 1.25 Green to 3.75 Red through yellow. image/png will give wms output."
      "Band1_interval"	"1.250 3.500"
      "ows_bandcount"	"1"
      "ows_extent"	"-19.750000000000000 40.250000000000000 54.750000000000000 74.750000000000000"
      "ows_label"	"Impact map climatology"
      "ows_bandnames"	"Band1"
      "ows_srs"	"EPSG:4326 EPSG:900913 EPSG:3857 EPSG:4326"
      "ows_title"	"Impact map climatology"
    END # METADATA
    NAME "Result"
    OFFSITE 0 0 0
    PROCESSING "BANDS=1"
    PROCESSING "SCALE_1=0.348,3.423"
    PROCESSING "RESAMPLE=BILINEAR"
    PROJECTION
      "init=epsg:4326"
      "+epsgaxis=ne"
    END # PROJECTION
    STATUS ON
    TYPE RASTER
    UNITS METERS
  END # LAYER

END # MAP
-------------- next part --------------
A non-text attachment was scrubbed...
Name: impact_m_asw_jan.tif
Type: image/tiff
Size: 333230 bytes
Desc: not available
URL: <https://lists.ms4w.com/pipermail/ms4w-users/attachments/20200602/d03baf29/attachment-0001.tif>


More information about the MS4W-Users mailing list