← Back to team overview

maria-developers team mailing list archive

Additions to GIS in 10.1.

 

Hi all.

What's new about GIS in 10.1. Related tasks in JIRA are:

MDEV-4045 Missing OGC Spatial functions.
MDEV-60 Support for Spatial Reference systems for the GIS data.
MDEV-12 OpenGIS: create required tables: GeometryColumns, related views.


Speaking shortly, the MariaDB GIS part is now OpenGIS compliant, and passes all the OpenGIS conformance tests


To get that the next things were done:

Missing functions were added:
    IsRing(ln)
        The return type is Integer, with a return value of 1 for
        TRUE, 0 for FALSE, and –1 for UNKNOWN
        corresponding to a function invocation on NULL

        arguments;
            return TRUE if c is a ring, i.e., if c is closed and simple. A
simple Curve does not pass through the same Point more than once.

    PointOnSurface(s)
The return type is POINT, returns a Point guaranteed to lie on the Surface.

        arguments: POLYGON or MYLTIPOLYGON.

    NumInteriorRing(p)
        The return type is Integer, returns the number of interiorRings

        arguments: POLYGON.

    Relate(g1 Geometry, g2 Geometry, patternMatrix String)
The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and –1 for UNKNOWN corresponding to a function invocation on NULL arguments; returns TRUE if the spatial relationship specified by the pattern Matrix holds.

    ConvexHull(g1 Geometry)
The return is Geometry, returna a geometric object that is the convex hull of g1

        arguments: GEOMETRY.


The information about the GEOMETRY column's reference system (SRID) is now stored in the field's metadata. Syntax of the CREATE and ALTER was modified to specify the SRID
for the geometry columns.

With this information some views required by OpenGIS, were added:

GEOMETRY_COLUMNS, SPATIAL_REF_SYS:
    These are links to the INFORMATION_SCHEMA.GEOMETRY_COLUMNS and
    INFORMATION_SCHEMA.SPATIAL_REF_SYS respectively.

INFORMATION_SCHEMA.GEOMETRY_COLUMNS:
    describes the available feature tables and their Geometry properties.
    Fields:
        F_TABLE_CATALOG CHARACTER VARYING(256) NOT NULL,
        F_TABLE_SCHEMA CHARACTER VARYING(256) NOT NULL,
        F_TABLE_NAME CHARACTER VARYING(256) NOT NULL,
the above 3 fields are the fully qualified name of the feature table
            containing the geometry column;
        F_GEOMETRY_COLUMN CHARACTER VARYING(256) NOT NULL,
the name of the column in the feature table that is the Geometry Column.
        G_TABLE_CATALOG CHARACTER VARYING(256) NOT NULL,
        G_TABLE_SCHEMA CHARACTER VARYING(256) NOT NULL,
        G_TABLE_NAME CHARACTER VARYING(256) NOT NULL,
the above 3 fields are the name of the geometry table and its schema
            and catalog. The geometry table implements the geometry column;
        STORAGE_TYPE INTEGER,
            always 1 in MariaDB (means binary geometry implementation)
        GEOMETRY_TYPE INTEGER,
            the type of geometry values stored in this column.
            0 = GEOMETRY
            1 = POINT
            3 = LINESTRING
            5 = POLYGON
            7 = MULTIPOINT
            9 = MULTILINESTRING
            11 = MULTIPOLYGON

        COORD_DIMENSION INTEGER,
            the number of dimensions in the spatial reference system.
            Always 2 in MariaDB.

        MAX_PPR INTEGER,
            Always 0 in MariaDB.

        SRID INTEGER
the ID of the Spatial Reference System used for the coordinate geometry in this table. It is a foreign key reference to the SPATIAL_REF_SYS table.


INFORMATION_SCHEMA.SPATIAL_REF_SYS:
stores information on each spatial reference system used in the database.
    Fields:
        SRID INTEGER NOT NULL PRIMARY KEY,
an integer value that uniquely identifies each Spatial Reference System within a database.
        AUTH_NAME CHARACTER VARYING(256),
the name of the standard or standards body that is being cited for this reference system.
            In most cases the value is "EPSG".
        AUTH_SRID INTEGER TEXT
the Well-known Text Representation of the Spatial Reference System.


Required stored procedures added:
    AddGeometryColumn(FEATURE_TABLE_CATALOG, FEATURE_TABLE_SCHEMA,
            FEATURE_TABLE_NAME, GEOMETRY_COLUMN_NAME, SRID)
        adds new column of spatial type to the specified table

    DropGeometryColumn(FEATURE_TABLE_CATALOG, FEATURE_TABLE_SCHEMA,
            FEATURE_TABLE_NAME, GEOMETRY_COLUMN_NAME)
        removes the spatial column from the table.


That's it for now.
Best regards.
HF