File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -265,6 +265,27 @@ $endPoint->pointN(-1); // throws exception as you cant ST_PointN on a point
265
265
Currently we only have expression subclasses for geometry, but we might have
266
266
other types (integer valued expression, area valued expression and so on) later.
267
267
268
+ ### Geometry class
269
+
270
+ In addition to base Expression tools, ` Geometry ` (and all the GIS subclass) has these helpers:
271
+
272
+ ``` php
273
+ // Wrap the expression in a function call
274
+ $myGeometry = new Geometry('col');
275
+ $myGeometry->wrap('COUNT'); // COUNT(col)
276
+
277
+ // Query the geometry against another geometry
278
+ $myGeometry = new Point('start');
279
+ $myGeometry->query('ST_Distance', new Point('end')); // Expression holding ST_Distance(start, end)
280
+ // This also autowraps the second arg as a geometry if you pass a string
281
+ $myGeometry->query('ST_Distance', 'end'); // Expression holding ST_Distance(start, end)
282
+
283
+ // Combine the geometry with another
284
+ $point = new Point('start');
285
+ $point->combine('ST_Union', 'end'); // Geometry holding ST_Union(start, end)
286
+ // The only difference is that ->query() returns a base Expression, but ->combine() returns a Geometry
287
+ ```
288
+
268
289
### Hierarchy and composition
269
290
270
291
The geometry class hierarchy as defined in the OGC spec along with the required
You can’t perform that action at this time.
0 commit comments