Document gis fields

This commit is contained in:
Hartmut Goebel
2025-11-18 00:35:27 +01:00
parent 2e03f6cf94
commit 6cb77c6da9
2 changed files with 99 additions and 2 deletions
+86
View File
@@ -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.
+13 -2
View File
@@ -1,11 +1,22 @@
==================
Tryton GIS backend
==================
It adds GIS__ support to Tryton.
Tryton GIS (`Geographic Information System
<https://en.wikipedia.org/wiki/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 <https://en.wikipedia.org/wiki/PostGIS#Users>`_.
For using these Tryton GIS, the `PostGIS <https://postgis.net/>`_ 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