[mapserver-users] How to dynamically change MapServer's GRID MININTERVAL?

Lime, Steve D (MNIT) steve.lime at state.mn.us
Thu Sep 3 20:00:09 PDT 2020


Hi David: That functionality was geared towards common use cases so I’d bet money it’s not supported but I’ll check the code to be sure. If you’re really just after 5 vs. 10 then using multiple layers would be an easy work around (e.g. grid5 vs grid10). Note that we’re always interested in 500 errors so if you are able to pass along how you triggered one that would be helpful. --Steve

From: mapserver-users <mapserver-users-bounces at lists.osgeo.org> On Behalf Of David Miller
Sent: Thursday, September 3, 2020 8:08 AM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] How to dynamically change MapServer's GRID MININTERVAL?

I started looking into using something similar to this example of the GRID layer definition in a MapServer mapfile that will draw lat/lon line grid at least every 5 degrees:

LAYER

  NAME "grid"

  METADATA

    "DESCRIPTION" "Grid"

  END

  TYPE LINE

  STATUS ON

  CLASS

    NAME "Graticule"

    COLOR 0 0 0

    LABEL

      COLOR  255 0 0

      FONT "sans"

      TYPE truetype

      SIZE 8

      POSITION AUTO

      PARTIALS FALSE

      BUFFER 2

      OUTLINECOLOR 255 255 255

    END

  END

  PROJECTION

    "init=epsg:4326"

  END

  GRID

    LABELFORMAT '%g°'

    MININTERVAL 5

  END

END # Layer

However, I don't want the MININTERVAL value to be hardcoded and would like to be able to vary that value by entering a different value in the URL call from a web page using the map_object notation. But, I've been unsuccessful. I have tried this in the URL call to MapServer:

&map_layer[grid].grid[0]=MININTERVAL+10 #changing to 10 degrees instead of 5

using the second example at this link: https://mapserver.org/cgi/controls.html#cgi-mapfile-change-parameters<https://gcc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmapserver.org%2Fcgi%2Fcontrols.html%23cgi-mapfile-change-parameters&data=02%7C01%7Csteve.lime%40state.mn.us%7C5984bf3afbad48fb8ff308d8500a6a1c%7Ceb14b04624c445198f26b89c2159828c%7C0%7C1%7C637347352949305145&sdata=Aac2ppXYBzD4bYyq0Zt7wUDxdi9y4jh%2FRgGKaP0c0gY%3D&reserved=0>. But, I either get a parsing error or an Internal Server error. I've tried turning debug level to 5 and looking at logs but they don't offer any help. Perhaps I'm just not using the correct map_object notation, but I'm not sure what else to use given the examples in the link. I also attempted to look at the MapServer code to no avail.

Perhaps I just can't change this parameter via the URL?

I'm using MapServer v 7.2.2 but it seems like the GRID layer has been available for a while now.

Thanks for any help/suggestions/thoughts!

Dave M
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20200904/5b81d82a/attachment.html>


More information about the mapserver-users mailing list