[mapserver-users] Can Mapserver expressions contain parens?

Stephen Woodbridge woodbri at swoodbridge.com
Sun Nov 6 13:46:36 PST 2016


Thanks Steve for confirming this. I'm wondering why we don't support 
both attribute binding and expressions. It seems like a logical thing to 
support.

Here is the map I was working on:
http://imaptools.com:8080/demo/australia.html

If you zoom in to the 1:250,000 there is detailed topographic map which 
has about 90 layers in it.

The use case for expressions in the bindings is that getting the symbol 
scaling and styling to look good takes some playing around with the 
data. Since I was working with shapefiles, every time I needed to change 
something I loaded the file mucked with it and exported it. I suppose 
that I could have loaded all the data into postgis first and worked out 
the rendering issues from postgis but I like working with shapefiles. 
The way I typically work is to get the styling working the way I want it 
to be then work to optimize if for performance.

For example the above mapfile has 3522 lines and 750 lines in the 
symbols.txt, and only really has the styling correct for 1:250,000 in 
spite of  the fact that it starts rendering the topo maps at 1:2M and 
you can see that it it too crowded at that level and the symbol sizes 
and density need to be thinned out as you zoom out from 1:250K, which 
will eventually double or triple the mapfile size.

Anyway, this is based on nice data from the Australian government. Once 
I have my geocoder working the address bar will work also.

-Steve W

On 11/4/2016 10:57 AM, Lime, Steve D (MNIT) wrote:
> Steve: A width value can be a double or a reference to an attribute
> only (an attribute binding). It can't be an expression... You'd need
> to do that computation elsewhere, obviously easy with a database.
>
> Steve
>
> -----Original Message----- From: mapserver-users
> [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Stephen
> Woodbridge Sent: Friday, November 04, 2016 9:44 AM To:
> mapserver-users <mapserver-users at lists.osgeo.org> Subject:
> [mapserver-users] Can Mapserver expressions contain parens?
>
> I'm trying to use a style like:
>
> STYLE COLOR "#000000" WIDTH (([FEATWIDTH]+.4)*10) END
>
> but I'm getting:
>
> getSymbol(): Symbol definition error. Parsing error near
> (([FEATWIDTH]+.4)*10):(line 1620)
>
>
> MapServer version 6.4.1 OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ
> SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS
> SUPPORTS=SVGCAIRO SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER
>  SUPPORTS=WFS_SERVER SUPPORTS=WCS_SERVER SUPPORTS=FASTCGI
> SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL
> INPUT=SHAPEFILE
>
> -Steve W
>
> --- This email has been checked for viruses by Avast antivirus
> software. https://www.avast.com/antivirus
>
> _______________________________________________ mapserver-users
> mailing list mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus




More information about the MapServer-users mailing list