...
The goal is to enable a geoserver WFS request with a 3D bounding box so that we receive only geometries not disjoint with one or more points in that 3D bounding box.
In other words, there is a min and max for the third coordinate as well as the first two.
In 2D we have in KVP:
BBOX=x0,y0,x1,y1
However, in 3D we get:
BBOX=x0,y0,z0,x1,y1,z1
Only 3d geometries that qualify for the min and max pairs for all three axes are returned.
In order to accomplish this, Geotools must support
- 3D Envelopes: a 3D envelope geometry class and a 3D referenced envelope geometry class.
- 3D Bounding Boxes: a 3D Bounding Box has two additional attributes (min z and max z) and filters geometries using all three dimensions.
...
- BBOX3D bbox(String propertyName, double minx, double miny, double minz, double maxx, double maxy, double maxz, String srsReferencedEnvelope3D bbox);
- BBOX3D bbox( Expression geometry, double minx, double miny, double minz, double maxx, double maxy, double maxz, String srsReferencedEnvelope3D bbox);
- BBOX3D bbox( Expression geometry, double minx, double miny, double minz, double maxx, double maxy, double maxz, String srs, ReferencedEnvelope3D bbox, MatchAction matchAction);
Corresponding with their 2D equivalents.
Because ReferencedEnvelope3D must be derived from Evelope3D, it cannot be derived from ReferencedEvelope. Both have a joint parent (Envelope), but ReferencedEvelope3D is not a ReferencedEnvelope.
To solve this issue an additional proposal is made to change the API (optional, after discussion):
- Create a ReferencedEvelope interface
- Let ReferencedEnvelope class be derived from ReferencedEvelope interface
- Switch all code that uses ReferencedEnvelope class to using ReferencedEvelope interface (Possibly little changes?)
- Let ReferencedEvelope3D class implement ReferencedEnvelope interface
Filter
BEFORE:
| Code Block |
|---|
Envelope env = new ReferencedEnvelope(x1minx, x2maxx, y1miny, y2maxy, crs) BBOX filter = filterfac.bbox(propertyName, minx, miny, minz, maxx, maxy, maxz, srs); boolean result = filter.eval(geom); |
...
| Code Block |
|---|
Envelope env = public ReferencedEnvelope3D(x1, x2, y1, y2, z1, z2, crs) BBOX filter = filterfac.bbox(propertyName, minx, miny, minz, maxx, maxy, maxz, srsenv); boolean result = filter.eval(geom); |
...