Re: [mapserver-users] Mapfile comment parsing issue

2019-03-20 Thread Lime, Steve D (MNIT)
Should be easy enough to replicate. Does this sum it up?


· Label TEXT w/expression followed with a comment containing ()’s - 
FAILS

· Same TEXT w/expression but with moving the comment containing ()’s 
onto its own line - WORKS

· Label TEXT w/expression followed with a comment without ()’s – WORKS

Seems like the regex in maplexer.l for expressions might be too greedy.

--Steve


From: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] On 
Behalf Of Julian Hollingbery
Sent: Wednesday, March 20, 2019 10:49 AM
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] Mapfile comment parsing issue

Hi list,

I have observed an obscure behavior in MapServer version 7.0.7, which I’d like 
to run by you before I submit an issue.

I have an issue where labels on contour line disappear when I write a 
particular type of comment after the TEXT directive.

Using this request:
http://host/fcgi-bin/mapserv.fcgi?map=ms_issue_report.map=WMS=1.3.0=GetMap=542400.00,6216800.00,542600.0,6217000.0=EPSG:25832=400=400=dhm_kote_0_5_m,dhm_kurve_0_5_m==image/png=FALSE
this piece of MAP file

   CLASS
 GROUP "default"
 NAME "dhm2015 kurver, 0,5 m"

 TEXT (tostring([hoejde],"%.2f")) #altid to decimal, også .00 (eng. always 
two decimals, including .00)
 STYLE
   OPACITY 80
   COLOR 100 50 0
   WIDTH 1
 END #STYLE
  LABEL
FONT "arial"
SIZE 9
COLOR 137 90 68
OFFSET 0 -6
SHADOWSIZE 1 1
TYPE TRUETYPE
REPEATDISTANCE 300
ANGLE auto
PARTIALS FALSE
  END # LABEL
   END #CLASS

Gives me 
https://pasteboard.co/I6jsBen.png
 (contour lines w/o labels), whereas

   CLASS
 GROUP "default"
 NAME "dhm2015 kurver, 0,5 m"
 #altid to decimal, også .00 (eng. always two decimals, including .00)
 TEXT (tostring([hoejde],"%.2f"))
 STYLE
   OPACITY 80
   COLOR 100 50 0
   WIDTH 1
 END #STYLE
  LABEL
FONT "arial"
SIZE 9
COLOR 137 90 68
OFFSET 0 -6
SHADOWSIZE 1 1
TYPE TRUETYPE
REPEATDISTANCE 300
ANGLE auto
PARTIALS FALSE
  END # LABEL
   END #CLASS

Results in https://pasteboard.co/I6js9YK.png (which is the desired result: 
Contour lines labelled with two decimal points).
I have narrowed it down a bit, and if I delete the “(eng. ..)”, i.e. just have
 TEXT (tostring([hoejde],"%.2f")) #altid to decimal, også .00
It still works nicely.

So I guess the parentheses are somehow parsed as something meaningful (related 
to the “tostring”-expression, perhaps?), invalidating the TEXT declaration.

Has anyone seen something similar?

Best Regards
/julian

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Mapfile comment parsing issue

2019-03-20 Thread Seth G
Hi Julian,

I have seen something similar when writing tests for mappyfil. I've tried to 
find my test case in https://github.com/geographika/mappyfile/tree/master/tests 
but can't seem to locate it at the moment. I'm fairly sure I had some notes 
somewhere and it related to parsing MapServer expressions. I'll take another 
look later. 
Did you try to dump the Mapfile out using MapScript to see how it is stored 
internally in MapServer after it has been loaded?

Seth

--
web:http://geographika.co.uk
twitter: @geographika


On Wed, Mar 20, 2019, at 4:49 PM, Julian Hollingbery wrote:
> Hi list,

> 

> I have observed an obscure behavior in MapServer version 7.0.7, which I’d 
> like to run by you before I submit an issue.

> 

> I have an issue where labels on contour line disappear when I write a 
> particular type of comment after the TEXT directive.

> 

> Using this request:

> http://host/fcgi-bin/mapserv.fcgi?map=ms_issue_report.map=WMS=1.3.0=GetMap=542400.00,6216800.00,542600.0,6217000.0=EPSG:25832=400=400=dhm_kote_0_5_m,dhm_kurve_0_5_m==image/png=FALSE

> this piece of MAP file

> 

>  CLASS

>  GROUP "default"

>  NAME "dhm2015 kurver, 0,5 m"

> 

>  TEXT (tostring([hoejde],"%.2f")) #altid to decimal, også .00 (eng. always 
> two decimals, including .00)

>  STYLE

>  OPACITY 80

>  COLOR 100 50 0

>  WIDTH 1

>  END #STYLE

>  LABEL

>  FONT "arial"

>  SIZE 9

>  COLOR 137 90 68

>  OFFSET 0 -6

>  SHADOWSIZE 1 1

>  TYPE TRUETYPE

>  REPEATDISTANCE 300

>  ANGLE auto

>  PARTIALS FALSE

>  END # LABEL

>  END #CLASS

> 

> Gives me  https://pasteboard.co/I6jsBen.png (contour lines w/o labels), 
> whereas

> 

>  CLASS

>  GROUP "default"

>  NAME "dhm2015 kurver, 0,5 m"

>  #altid to decimal, også .00 (eng. always two decimals, including .00)

>  TEXT (tostring([hoejde],"%.2f"))

>  STYLE

>  OPACITY 80

>  COLOR 100 50 0

>  WIDTH 1

>  END #STYLE

>  LABEL

>  FONT "arial"

>  SIZE 9

>  COLOR 137 90 68

>  OFFSET 0 -6

>  SHADOWSIZE 1 1

>  TYPE TRUETYPE

>  REPEATDISTANCE 300

>  ANGLE auto

>  PARTIALS FALSE

>  END # LABEL

>  END #CLASS

> 

> Results in https://pasteboard.co/I6js9YK.png (which is the desired result: 
> Contour lines labelled with two decimal points).

> I have narrowed it down a bit, and if I delete the “(eng. ..)”, i.e. just have

>  TEXT (tostring([hoejde],"%.2f")) #altid to decimal, også .00

> It still works nicely.

> 

> So I guess the parentheses are somehow parsed as something meaningful 
> (related to the “tostring”-expression, perhaps?), invalidating the TEXT 
> declaration.

> 

> Has anyone seen something similar?

> 

> Best Regards

> /julian

> 

> ___
> mapserver-users mailing list
> mapserver-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

[mapserver-users] Mapfile comment parsing issue

2019-03-20 Thread Julian Hollingbery
Hi list,

I have observed an obscure behavior in MapServer version 7.0.7, which I’d like 
to run by you before I submit an issue.

I have an issue where labels on contour line disappear when I write a 
particular type of comment after the TEXT directive.

Using this request:
http://host/fcgi-bin/mapserv.fcgi?map=ms_issue_report.map=WMS=1.3.0=GetMap=542400.00,6216800.00,542600.0,6217000.0=EPSG:25832=400=400=dhm_kote_0_5_m,dhm_kurve_0_5_m==image/png=FALSE
this piece of MAP file

   CLASS
 GROUP "default"
 NAME "dhm2015 kurver, 0,5 m"

 TEXT (tostring([hoejde],"%.2f")) #altid to decimal, også .00 (eng. always 
two decimals, including .00)
 STYLE
   OPACITY 80
   COLOR 100 50 0
   WIDTH 1
 END #STYLE
  LABEL
FONT "arial"
SIZE 9
COLOR 137 90 68
OFFSET 0 -6
SHADOWSIZE 1 1
TYPE TRUETYPE
REPEATDISTANCE 300
ANGLE auto
PARTIALS FALSE
  END # LABEL
   END #CLASS

Gives me https://pasteboard.co/I6jsBen.png (contour lines w/o labels), whereas

   CLASS
 GROUP "default"
 NAME "dhm2015 kurver, 0,5 m"
 #altid to decimal, også .00 (eng. always two decimals, including .00)
 TEXT (tostring([hoejde],"%.2f"))
 STYLE
   OPACITY 80
   COLOR 100 50 0
   WIDTH 1
 END #STYLE
  LABEL
FONT "arial"
SIZE 9
COLOR 137 90 68
OFFSET 0 -6
SHADOWSIZE 1 1
TYPE TRUETYPE
REPEATDISTANCE 300
ANGLE auto
PARTIALS FALSE
  END # LABEL
   END #CLASS

Results in https://pasteboard.co/I6js9YK.png (which is the desired result: 
Contour lines labelled with two decimal points).
I have narrowed it down a bit, and if I delete the “(eng. ..)”, i.e. just have
 TEXT (tostring([hoejde],"%.2f")) #altid to decimal, også .00
It still works nicely.

So I guess the parentheses are somehow parsed as something meaningful (related 
to the “tostring”-expression, perhaps?), invalidating the TEXT declaration.

Has anyone seen something similar?

Best Regards
/julian

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users