| 65 | Some of these definitions hint at other features that will be detailed later. When we convert an expression string into a series of tokens we also store away the value associated with that token (if necessary). In many cases the token value is a litteral (string or number), in other cases its a reference to a feature attribute. In the latter case we use the attributeBindingObj already in use by MapServer to encapsulate the information necessary to quickly access the correct data (typically an item index value). |
| 66 | |
| 67 | '''Extending the Yacc grammar to support spatial operators''' |
| 68 | |
| 69 | The mapserver.h definitions above allow for using shapeObj's within the Yacc grammar. There are two types of shape-related tokens: 1) a shape binding, that is, a reference to the geometry being evaluated and 2) shape literals, shapes described as WKT within the expression string. For example: |
| 70 | |
| 71 | {{{ |
| 72 | In the expression: |
| 73 | EXPRESSION (fromText('POINT(500000 5000000)') Intersects [shape]) |
| 74 | |
| 75 | 1) fromText('POINT(500000 5000000)') defines a shape literal |
| 76 | 2) [shape] is a shape binding |
| 77 | }}} |
| 78 | |