• Blog posts


    By David Crowther



    Is it possible to edit Multi Geometry Type PostGIS Tables using MapThat?


    Yes – in MapThat v4 and onwards you can now edit simple geometry e.g. Polygon, Point, LineString as well as Multi Geometry Types.

    For example if your PostGIS Table contains multi geometry features the Geometry will be set as such e.g. MultiPolygon.


    Or MultiLineString.


    Or MultiPoint.


    Previously these PostGIS tables could only be viewed and queried within MapThat. However in MapThat V4 and onwards we now support editing Multi Geometry tables via the MapThat Drawing Tools.


    To do this, in the MapThat Layer Settings simply choose the appropriate Edit Geometry Type.


    Values that can be set for the Edit Geometry Type are now as per the below:

    • Any
    • Point
    • LineString
    • Polygon
    • MultiPoint
    • MultiLineString
    • MultiPolygon
    • GeometryCollection

    Tip! Set your PostGIS Geometry Type to be GEOMETRY.


    This means that when you open the Layer in QGIS, you have the choice of whether to open as Point, Line, Polygon, MultiPoint, MultiLineString, MultiPolygon etc. This choice then determines which Drawing Tools are available in QGIS.


    For the same Layer in MapThat, if you set the Edit Geometry Type to be GeometryCollection you can now edit the PostGIS Layer adding adding Points, Lines and Polygon features.


    Note – When creating new records in MapThat, these features will always be added into your source PostGIS table as simple geometry e.g. Point, LineString, Polygon.

    Using the syntax below in PGAdmin we can return the Geometry Type for any feature e.g. this query returns the geometry (POLYGON) type for a Polygon feature drawn within MapThat.


    However, if you have MULTI geom types e.g. those added via QGIS, when you update that feature in MapThat e.g. Reshape it and/or edit the attributes and then re-save the record….


    the feature will remain as a Multi Geom type e.g. MULTIPOLYGON.


    So you will now have a Layer in PostGIS that can have simple and multi geometry types and which can also be updated by MapThat!