OGC

# OGC (Open Geospatial Consortium)

OGC is the Open Geospatial Consortium, the standardization committee on Geospatial Interoperability and GIS (Geographical Information Systems). OGC geometries are used in many environments and databases.

The Generic Geometry Library uses OGC conventions for algorithms and for geometry type names. Note that though OGC is concentrating on GIS, the conventions followed here are 'geometry only', the so-called 'simple features' (simple in the sense that polygons are not allowed to have self-intersections).

OGC specifies a library based on inheritance, as opposed to this library, which is a generic template based library where data classes are separated from the algorithms. Therefore this library is not an OGC implementation in the strict sense.

# Classes

OGC defines the following geometry classes, which are implemented as concepts (and as geometries) in the Generic Geometry Library:

- point: a point. The point defined here is dimensionally agnostic. Library users does not have to use this point, they might also use their own points as long as it meets the concepts.

- linestring: Sequence of point values with linear interpolation between points. Note that library users does not have to use this type. Algorithms works on iterators, so all algorithms also accept iterators on a vector (or other container) of points.

- linear_ring: Sequence of point values with linear interpolation between points, which is closed and not self-intersecting

- polygon: Plane figure, consisting of an outer ring and zero or more inner rings. So basically a polygon which might have holes. Note that this definition is different from several other polygon definitions and libraries, where polygons are not allowed to have holes. These polygons are comparable to the linear_ring above

And multi-geometries:

- multi_point: collection of points

- multi_linestring: collection of linestrings

- multi_polygon: collection of polygons

The naming of these classes is used in:

- WKT (Well-Known Text)

- KML (Google Maps)

- GML

- many GIS/geometry libraries

and in many databases:

- Oracle Spatial

- SQL Server 2008

- PostGreSQL

- MySQL

- MonetDB

Besides this the Generic Geometry Library provides the following additional classes:

- box: Box, used for selections and for envelopes (bounding boxes)

- segment: Segment, helper class, used for e.g. intersections

Finally geometry types can be added as extensions. This is e.g. done with an "n-sphere" meaning "circle" and "sphere". Circle is convenient for selections.

# Differences

The Generic Geometry Library does not implement the OGC Simple Feature interface exactly and completely. There are many differences. Below the most important differences are listed.

- In OGC all operations are class methods. The Generic Geometry Library is a template library and defines the algorithms as generic functions.

- In OGC a point is defined by an x-coordinate value, a y-coordinate value and possibly a z-coordinate value and a measured value. In the Generic Geometry Library the basic point defines coordinates in a neutral way, so there is no x, no y.

- In OGC all geometries have additional members, such as SRID (spatial reference system id) or isMeasured. These properties are not defined in the Generic Geometry Library. Library users can implement them, if necessary, in derived classes.

- In OGC the envelope returns a geometry, in the Generic Geometry Library it returns a box

- The OGC algorithm asText is named "wkt"

- Union and intersection are currently named "X_inserter" to indicate that they insert there produced geometries (if any) as an OutputIterator

More information on OGC can be found on their website, http://www.opengeospatial.org and on Wikipedia http://en.wikipedia.org/wiki/Open_Geospatial_Consortium