[mapserver-users] getting the scale in a map file at runtime

Jörg Thomsen (WhereGroup) joerg.thomsen at wheregroup.com
Fri Jun 3 07:43:39 PDT 2022


Richard,
sorry, yes, sure...

Perhaps you can use scaletoken? It's not the same as you are searching 
for, but you could define a set of tolerance-values for different scales.

Jörg

Am 03.06.22 um 16:21 schrieb Richard Greenwood:
> 
> 
> On Fri, Jun 3, 2022 at 8:00 AM Jörg Thomsen (WhereGroup) 
> <joerg.thomsen at wheregroup.com <mailto:joerg.thomsen at wheregroup.com>> wrote:
> 
>     Hi,
> 
>     what about:
>     https://mapserver.org/mapfile/template.html#image-geometry
>     <https://mapserver.org/mapfile/template.html#image-geometry>
>     -> scaledenom
> 
>     Doesn't work?
> 
> 
> Thanks, but no, it does not work. I'm trying to access the scale in a 
> map file, not in a template. Using square brackets [variable] is 
> interpreted as a field name in the data, not as a runtime variable. For 
> example:
>    CLASS
>      STYLE
>        GEOMTRANSFORM (generalize([shape], [scaledenom]))
>        COLOR "#2AB1F7"
>      END
>    END
> returns the error:
> DBASE file error. Item 'scaledenom' not found.
> 
> 
>     Jörg
> 
> 
>     Am 03.06.22 um 15:45 schrieb Richard Greenwood:
>      > Can I get the current scale for use in a map file at runtime.
>      > Specifically, I'd like to use it in a geotransform something like:
>      >     GEOMTRANSFORM (generalize([shape], [scale]))
>      > or more likely for use in an expression:
>      >     GEOMTRANSFORM (generalize([shape], [scale] / 100))
>      > Thanks
>      > --
>      > Richard W. Greenwood
>      > www.greenwoodmap.com <http://www.greenwoodmap.com>
>     <http://www.greenwoodmap.com <http://www.greenwoodmap.com>>
>      >
>      > _______________________________________________
>      > MapServer-users mailing list
>      > MapServer-users at lists.osgeo.org
>     <mailto:MapServer-users at lists.osgeo.org>
>      > https://lists.osgeo.org/mailman/listinfo/mapserver-users
>     <https://lists.osgeo.org/mailman/listinfo/mapserver-users>
> 
> 
>     -- 
>     Viele Grüße,
>     Jörg Thomsen
> 
>     ---------------------------------------------
>     Aufwind durch Wissen!
>     Jetzt neu: Web-Seminare und Online-Schulungen
>     bei der www.foss-academy.com <http://www.foss-academy.com>
>     ---------------------------------------------
> 
>     Jörg Thomsen
>     WhereGroup GmbH
>     Bundesallee 23
>     10717 Berlin
>     Germany
> 
>     Tel: +49 (0)30 / 5130 278 74
>     Fax: +49 (0)30 / 5130 278 11
> 
>     joerg.thomsen at wheregroup.com <mailto:joerg.thomsen at wheregroup.com>
>     www.wheregroup.com <http://www.wheregroup.com>
> 
>     Geschäftsführer:
>     Olaf Knopp, Peter Stamm
>     Amtsgericht Bonn, HRB 9885
> 
>     -------------------------------
>     Folgen Sie der WhereGroup auf twitter:
>     http://twitter.com/WhereGroup_com <http://twitter.com/WhereGroup_com>
>     _______________________________________________
>     MapServer-users mailing list
>     MapServer-users at lists.osgeo.org <mailto:MapServer-users at lists.osgeo.org>
>     https://lists.osgeo.org/mailman/listinfo/mapserver-users
>     <https://lists.osgeo.org/mailman/listinfo/mapserver-users>
> 
> 
> 
> -- 
> Richard W. Greenwood
> www.greenwoodmap.com <http://www.greenwoodmap.com>


-- 
Viele Grüße,
Jörg Thomsen

---------------------------------------------
Aufwind durch Wissen!
Jetzt neu: Web-Seminare und Online-Schulungen
bei der www.foss-academy.com
---------------------------------------------

Jörg Thomsen
WhereGroup GmbH
Bundesallee 23
10717 Berlin
Germany

Tel: +49 (0)30 / 5130 278 74
Fax: +49 (0)30 / 5130 278 11	

joerg.thomsen at wheregroup.com
www.wheregroup.com

Geschäftsführer:
Olaf Knopp, Peter Stamm
Amtsgericht Bonn, HRB 9885

-------------------------------
Folgen Sie der WhereGroup auf twitter: http://twitter.com/WhereGroup_com



More information about the MapServer-users mailing list