• Blog posts

    Bio

    By David Crowther

    MapThat___Can_I_Edit_MultiType_Geometry_Tables_-_1..PNG

    Question:

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

    Answer:

    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.

    MapThat___Can_I_Edit_MultiType_Geometry_Tables_-_2.PNG

    Or MultiLineString.

    MapThat___Can_I_Edit_MultiType_Geometry_Tables_-_3.PNG

    Or MultiPoint.

    MapThat___Can_I_Edit_MultiType_Geometry_Tables_-_4.PNG

    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.

    MapThat___Can_I_Edit_MultiType_Geometry_Tables_-_5.PNG

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

    MapThat___Can_I_Edit_MultiType_Geometry_Tables_-_6.PNG

    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.

    MapThat___Can_I_Edit_MultiType_Geometry_Tables_-_7.PNG

    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.

    MapThat___Can_I_Edit_MultiType_Geometry_Tables_-_8.PNG

    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.

    MapThat___Can_I_Edit_MultiType_Geometry_Tables_-_9.PNG

    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.

    MapThat___Can_I_Edit_MultiType_Geometry_Tables_-_10.PNG

    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….

    MapThat___Can_I_Edit_MultiType_Geometry_Tables_-_11.PNG

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

    MapThat___Can_I_Edit_MultiType_Geometry_Tables_-_12.PNG

    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!