Klassenmodell für geradlinige geometrische Figuren, entwickelt vom OGC:
Simple Features is a set of standards that specify a common storage and access model of geographic feature made of mostly two-dimensional geometries (point, line, polygon, multi-point, multi-line, etc.).
The Simple-Features spec defines a lot of useful operations on geometries:
Example operations:
- Within (anotherGeometry: Geometry) — Returns TRUE if this geometric object is “spatially within” anotherGeometry
- Envelope() - Returns the minimum bounding box for the Geometry.
See OGC Simple Features or Shapely docs for more info
- GEOS is a C/C++ library for spatial computational geometry implementing the Simple-Feature-Model. Used by PostGIS, QGIS, GDAL, GeoDjango and Shapely.
- PostGIS is a spatial database extender for PostgreSQL object-relational database. It adds support for geographic objects allowing location queries to be run in SQL.
- PostGIS uses GEOS as geometry engine.
- Shapely is a Python package for set-theoretic analysis and manipulation of planar features. With Shapely, geometry operations can be performed outside of PostGIS.
- Shapely uses GEOS as geometry engine.
- GeoDjango is
- a high-level Python wrapper for the GEOS library.
- a high-level Python interface for some of the capabilities of GDALs OGR, including the reading and coordinate transformation of vector spatial data.
- django-rest-framework-gis provides DRF fields and serializers for GeoDjango’s Models.
- GDAL / OCR specializes in reading and writing vector geographic data.
GeoJSON is a standard for structuring JSON when encoding geometry and features. It also standardizes the transport of attribution.
The three key levels of GeoJSON are:
- Geometry, representation of Points, LineStrings, Polygons, etc.
- Feature, representation of an object that has a “geometry” and an arbitrary set of other non-geometric “properties”.
- FeatureCollection, representation of a list of Features.
Example:
{
"type": "Feature",
"properties": {
"area": "1",
"name": "Schöneberg",
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-5.625,
41.77131167976407
],
[
-6.6796875,
34.59704151614417
],
[
2.109375,
31.353636941500987
],
[
2.109375,
40.97989806962013
],
[
-5.625,
41.77131167976407
]
]
]
}
}
“Well-known text” is a scheme for writing a simple features geometry into a standard text string.
Example
POINT(0 0)
POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))
Since GEOS does not support GeoJSON, WKT must be used to write geospatial queries in PostGIS (?).
PostGIS
- Docker: https://registry.hub.docker.com/r/postgis/postgis/
- Google Cloud: https://cloud.google.com/sql/docs/postgres/extensions#postgis
GeoDjango: