From 6cb77c6da9f135233e04f107b1178b48be20fafc Mon Sep 17 00:00:00 2001 From: Hartmut Goebel Date: Tue, 18 Nov 2025 00:35:27 +0100 Subject: [PATCH] Document gis fields --- trytond-gis/doc/fields.rst | 86 ++++++++++++++++++++++++++++++++++++++ trytond-gis/doc/index.rst | 15 ++++++- 2 files changed, 99 insertions(+), 2 deletions(-) create mode 100644 trytond-gis/doc/fields.rst diff --git a/trytond-gis/doc/fields.rst b/trytond-gis/doc/fields.rst new file mode 100644 index 0000000000..a9aeeb0b5c --- /dev/null +++ b/trytond-gis/doc/fields.rst @@ -0,0 +1,86 @@ +.. _ref-models-gis_fields: +.. module:: trytond_gis.fields + +====== +Fields +====== + +The Tryton GIS backend provides the Field types described below. +They be used in a ModelSQL like this:: + + from trytond.model import ModelSQL + from trytond_gis.fields import Point + + + class Point(ModelSQL): + __name__ = 'test.gis.point' + + point = Point("Point") + +.. contents:: + :local: + :backlinks: entry + :depth: 2 + +Geometry field types +==================== + +Geometry +-------- + +.. class:: Geometry([string[, dimension[, \**options]]]) + + The base class of all other geometry field types defined here. + +.. attribute:: Geometry.dimension + + The number of dimension of the geometry. + +Point +----- + +.. class:: Point(\**options) + + A subclass of :class:`Geometry` used to store a point. + +LineString +---------- + +.. class:: LineString(\**options) + + A subclass of :class:`Geometry` used to store a linestring. + +Polygon +------- + +.. class:: Polygon(\**options) + + A subclass of :class:`Geometry` used to store a polygon. + +MultiPoint +----------- + +.. class:: MultiPoint(\**options) + + A subclass of :class:`Geometry` used to store a collection of points. + +MultiLineString +--------------- + +.. class:: MultiLineString(\**options) + + A subclass of :class:`Geometry` used to store a collection of linestrings. + +MultiPolygon +------------ + +.. class:: MultiPolygon(\**options) + + A subclass of :class:`Geometry` used to store a collection of polygon. + +GeometryCollection +------------------ + +.. class:: GeometryCollection(\**options) + + A subclass of :class:`Geometry` used to store a collection of any geometry. diff --git a/trytond-gis/doc/index.rst b/trytond-gis/doc/index.rst index cc292f2694..4c09f6a1d7 100644 --- a/trytond-gis/doc/index.rst +++ b/trytond-gis/doc/index.rst @@ -1,11 +1,22 @@ +================== Tryton GIS backend ================== -It adds GIS__ support to Tryton. +Tryton GIS (`Geographic Information System +`_) adds support +for geospatial data to Tryton. +It adds new *Field types* like *Point*, *LineString* and *MultiPolygon*. -__ https://en.wikipedia.org/wiki/Geographic_information_system +The intended use is to write GIS data directly into the database with an +`existing GIS software `_. + +For using these Tryton GIS, the `PostGIS `_ extension +must be installed on the database and the database ``uri`` in the +``[database]`` sectionn of the configuration must start with: ``postgis://`` +instead of ``postgresql://``. .. toctree:: :maxdepth: 2 + fields releases