# Geometry Subsystem Documentation

**Status**: alpha/requirements cluster (2009/07/03)

This page documents the requirements / design of the deegree 3 geometry subsystem.

## 1. Requirements

- Represent any GML 2, 3.1 or 3.2 geometry faithfully (including fancy stuff like non-linear curves, non-planar surfaces and solids).
- Support 2D as well as 3D coordinate space. Not constrained, so 4D should be possible as well.
- Support topological predicates using JTS. For not-natively supported geometries, a linearized version (curves) would be used for the predicate evaluation. For 3D geometries, this has it limitations, but it should be possible to support tests on the footprint and provide a full-3D bbox operator.
- Support ids for geometry parts, so they may be referenced from other geometries.
- Map supported geometries to spatial db types with lower complexity (PostGIS, Oracle) without loss of information. For natively unsupported types (e.g. curved lines, surface with multiple patches), this requires additional information which must be stored together with a (simplified) native geometry. Probably in a BLOB. Topological operations should be available as far as this is possible.

## 2. Hierachy of geometry objects

- Primitive
MultiGeometry: Aggregations of geometries without any topological constraints, i.e. members may or may not intersect

CompositeGeometry: Aggregations of geometries with the topological constraint that they have the same topological form as the members, e.g. a CompositeCurve must form a Curve itself

## 3. Example GML geometries with xlinked content

```
<MultiGeometry srsName="EPSG:4326" xmlns="http://www.opengis.net/gml"
xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/gml http://schemas.opengis.net/gml/3.1.1/base/gml.xsd">
<geometryMembers>
<Point gml:id="P1">
<coord>
<X>0.0</X>
<Y>0.0</Y>
</coord>
</Point>
<Point gml:id="P2">
<coord>
<X>1.0</X>
<Y>1.0</Y>
</coord>
</Point>
<LineString gml:id="L1">
<pointProperty xlink:href="#P1" />
<pointProperty>
<Point>
<pos>1.0 0.0</pos>
</Point>
</pointProperty>
<pointProperty xlink:href="#P2" />
<pointProperty>
<Point>
<pos>0.0 1.0</pos>
</Point>
</pointProperty>
</LineString>
</geometryMembers>
</MultiGeometry>
```