OGC-Pharo

Based on GeoJSON & Simple Feature Access standards specifications

Model

Object model can be found in OGC-Core package, as subclasses of OGCObject.

OGCFeature & OGCFeatureCollection classes

GeoJSON deals with FeatureCollection, which contain a collection of Features. A Feature contains an element of geometry from OGCGeometry.

Information data can be attributed to both Feature and FeatureCollections, as Properties.

GeoJSON specification and format details can be found here: https://datatracker.ietf.org/doc/html/rfc7946 .

OGCGeometry class

We implemented the geometries formalized by the Simple Access Feature standards of Open Geospatial Consortium (OGC).

We limited ourselves to 2D geometry.

Implementation specification can be found here: https://www.ogc.org/standards/sfa .

Figure 1 - Geometry class hierarchy from specification

OGCGeometry is the abstract super-class of all geospatial elements.

OGCGeometry contains 2 arguments to define the associate reference system in which it is found:

  • a OGCSpatialReferenceSystem

  • a OGCMeasureReferenceSystem if needed.

Spacial reference system is necessary since it defines how space is described, according to projection type. It implements all methods for elements analysis and testing.

Thus, most common features are:

  • OGCPoint defined by (x,y) coordinates

  • OGCCurve

      • OGCLineString

          • OGCLine = a segment defined by 2 points

          • OGCLinearRing = a closed linestring without intersections

  • OGCSurface

      • OGCPolygon = an exterior linear ring to define border + interior linear ring(s) to define holes inside

  • OGCGeometryCollection = collections of elementary geometries

Various spatial reference systems

A planar system

Here, we consider that geometries are located in the same plane.

Consequently, we can use planar geometry to compute distances, areas and other geometrical measures.

A spherical system

Here, we consider that geometries are located on Earth as a perfect sphere with ray of 6372.795477598 km.