[mapserver-users] not able to label a feature with concatenatedstrings (data field + string literal)

Lime, Steve D (DNR) steve.lime at state.mn.us
Tue Jun 28 14:58:47 EDT 2011


Cool. It's working as intended then. Thanks for the feedback...

Steve

-----Original Message-----
From: Ralf Trier [mailto:Ralf.Trier at logos-ib.de] 
Sent: Tuesday, June 28, 2011 2:05 AM
To: Lime, Steve D (DNR); mapserver-users at lists.osgeo.org
Subject: RE: [mapserver-users] not able to label a feature with concatenatedstrings (data field + string literal)

Hi Steve
thanks a lot 
this works: TEXT ('[area]' + ' acres')


An Overview of what I tried und the results

TEXT ([DB_FIELD]+'L')
	yyparse(): Expression parser error. syntax error
	msShapeGetAnnotation: Expression parser error. Failed to process text expression: [DB_FIELD]+'L'

TEXT ([DB_FIELD],'L')
	yyparse(): Expression parser error. syntax error
	msShapeGetAnnotation: Expression parser error. Failed to process text expression: [DB_FIELD],'L'

TEXT ('[DB_FIELD] L') 
	=> shows Label exact as between '' e.g. [DB_FIELD] L
	
TEXT ('[DB_FIELD]'+' L')
	=> ok
 
TEXT '[DB_FIELD] L'
	=> ok
	
TEXT 'L [DB_FIELD]'
	=> ok

TEXT '[DB_FIELD]'
	=> ok

TEXT [DB_FIELD]
	=>in PHP-Script catched Exception 
	'MapScriptException' with message 'Failed to open map file "a.map"'
	=>in MS_ERRORFILE
	getSymbol(): Symbol definition error. Parsing error near (DB_FIELD):(line 739)

Best regards,
Ralf


> -----Ursprüngliche Nachricht-----
> Von: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-
> bounces at lists.osgeo.org] Im Auftrag von Lime, Steve D (DNR)
> Gesendet: Montag, 27. Juni 2011 17:31
> An: Ralf Trier; mapserver-users at lists.osgeo.org
> Betreff: RE: [mapserver-users] not able to label a feature with
> concatenatedstrings (data field + string literal)
> 
> Hi Ralf: There looks to be an error in the migration guide with one of
> the examples. Specifically:
> 
>   TEXT ([area] + ' acres') should be TEXT ('[area]' + ' acres')
> 
> You have to explicitly cast the attribute area to a string. That said
> TEXT '[area] acres' should work. What output/error do you get with
> that?
> The new expression parsing isn't used at all in that case so I would
> expect something different that what's below.
> 
> Steve
> 
> -----Original Message-----
> From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-
> bounces at lists.osgeo.org] On Behalf Of Ralf Trier
> Sent: Monday, June 27, 2011 8:33 AM
> To: mapserver-users at lists.osgeo.org
> Subject: [mapserver-users] not able to label a feature with
> concatenated strings (data field + string literal)
> 
> I' am updated to PHP-Script Version 6.0.
> 
> I older version I labeled features with concatenated strings (data
> field
> + string literal).
> 
> The documentation of the class section says that Text can be set like:
> Text ([FIRSTNAME],[LASTNAME])
> According to the Migration Guide I can use
> TEXT ([area] + ' acres')
> TEXT '[area] acres'
> None of these 3 versions work.
> 
> Mostly I get an error like:
> yyparse(): Expression parser error. syntax error
> msShapeGetAnnotation: Expression parser error. Failed to process text
> expression:
> 
> Any idea, what I can do.
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
> 
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 





More information about the mapserver-users mailing list