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

David Miller teknocreator at gmail.com
Thu Sep 10 16:23:46 PDT 2020


Forwarding Steve L's response in case anyone's looking for a workable
solution to this topic.

---------- Forwarded message ---------
From: David Miller <teknocreator at gmail.com>
Date: Tue, Sep 8, 2020 at 12:31 PM
Subject: Re: [mapserver-users] How to dynamically change MapServer's GRID
MININTERVAL?
To: Lime, Steve D (MNIT) <steve.lime at state.mn.us>


Steve,

Thanks much for checking on this!  Will discuss options with my dev team.

Just to note that this came about because we added an option to our display
which would allow our customers to select the lat/lon line intervals.  An
Openlayers plugin will then take that interval value and display the
lat/lon lines accordingly.  However, there are issues with that plugin for
areas spanning the dateline (which one of our regions does) where the
plugin will only draw correctly if one is completely on one side of the
dateline or another but not straddling it.  Having lat/lon lines on the
display is very helpful in the Pacific region since of course there aren't
many land references.  In any case, will work with the options we have.

Thanks again!

Dave M

On Fri, Sep 4, 2020 at 1:15 PM Lime, Steve D (MNIT) <steve.lime at state.mn.us>
wrote:

> I checked and none of the relevant grid keywords (GRID, MINTERVAL,
> LABELFORMAT) are recognized when in URL context. The latter form you
> mentioned would be correct if supported since there is only one grid per
> layer. You could enable by editing maplexer.l if you absolutely needed it
> but I think multiple layers might be the cleaner approach regardless.
>
>
>
> --Steve
>
>
>
> *From:* David Miller <teknocreator at gmail.com>
> *Sent:* Friday, September 4, 2020 9:11 AM
> *To:* Lime, Steve D (MNIT) <steve.lime at state.mn.us>
> *Subject:* Re: [mapserver-users] How to dynamically change MapServer's
> GRID MININTERVAL?
>
>
>
> *This message may be from an external email source.*
>
> Do not select links or open attachments unless verified. Report all
> suspicious emails to Minnesota IT Services Security Operations Center.
>
>
> ------------------------------
>
> Steve,
>
>
>
> Thanks much!  Okay, I could propose having multiple grid layer options
> (i.e. grid1, grid2, grid5, grid10) as you suggested to my dev app group.
> Like you said, common use cases.  At present, we're allowing the user to
> select a grid interval via an Openlayers plugin which unfortunately has
> issues extending past the dateline. Our Pacific region users, who would
> probably use this functionality most, pointed this issue out to us and
> hence why I looked into MS GRID functionality.  The example I gave would
> either return a parsing error or an ISE.  It wasn't a consistent error that
> was returned from MS even though I was trying a complete refresh in the
> browser.  I also tried map.layer[grid].grid=MININTERVAL+10 (or 5).  In
> addition, in case I could just rewrite the GRID section via the URL -
> map.layer[grid]=GRID+LABELFORMAT+DD+MININTERVAL+5+END.
>
>
>
> Thanks again for replying and will adjust based on your feedback.
>
>
>
> Dave M
>
>
>
> On Thu, Sep 3, 2020 at 11:00 PM Lime, Steve D (MNIT) <
> steve.lime at state.mn.us> wrote:
>
> 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%7C5ad89fbe879e4906888a08d850dc4f36%7Ceb14b04624c445198f26b89c2159828c%7C0%7C1%7C637348254437461427&sdata=ewamejYAki238oP8%2Be5yIYOp62SR069PWsTn9USDo58%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/20200910/ecba23c7/attachment.html>


More information about the mapserver-users mailing list