Virtual layer for validate overlay in
shapefile
Luiz.motta@ibama.gov.br
http://www.ibama.gov.br
Luiz Motta
MMA - Ministry of the Environment – Brazil
IBAMA - Brazilian Institute of Environment and
Renewable Natural Resources
DIPRO - Directorship of Environmental Protection
CGMAM – General Coordination of Monitoring
COTIG – Coordination of Geospatial Technology *
Luiz Motta:
● Environment Analyst of IBAMA since 2003
● Expert in FOSS4G (contributor of QGIS)
● Database example.
● Definition of virtual layer (VRT) for check overlay.
● QGIS project configuration.
● Python script for automatic update.
● Checking overlay
Presentation plan
● Dowload:
https://www.dropbox.com/s/8efs5e8x054kiru/overlay_vrt.zip?dl=0
● overlay_vrt.zip:
├── overlay_vrt.qgs
├── validate overlay_inside.vrt.xml
├── py
│ └── update_vrt_by_edit.py
├── shp
├── test_overlay.dbf
├── test_overlay.prj
├── test_overlay.qml
├── test_overlay.qpj
├── test_overlay.shp
└── test_overlay.shx
Database example
● validate overlay_inside.vrt.xml:
● OGRVRTDataSource: Define dataset (set of layers)
● OGRVRTLayer: Define a layer
● SrcDataSource: Source of data
● SrcSQL: Define SQL for check overlay using 'SrcDataSource'
● GeometryField: Geometry's field of layer
● GeometryType: Geometry's type
● LayerSRS: Spatial Reference System
Definition of VRT for check overlay
Sources:
● VRT format: http://www.gdal.org/drv_vrt.html
● Spatialite: http://www.gaia-gis.it/spatialite-2.4.0/spatialite-sql-2.4.html
QGIS project: overlay_vrt.qgs
● test_overlay properties:
Suppress attribute form pop-up after creation → On
QGIS project configuration
Script: update_vrt_by_edit.py
● Enable automatic update:
● test_overlay: Populate 'id' field
● overlay_area: Reload layer (remove and add again)
● Happening when save edition
Python script for automatic update.
Run 'update_vrt_by_edit.py' by console
Python script for automatic update.
Checking overlay
● Start edition of 'test_overlay'
● Create geometry with overlay
● Save edition
● Youtube: https://youtu.be/L78aOUwicBo

Virtual layer for validate overlay in shapefile

  • 1.
    Virtual layer forvalidate overlay in shapefile Luiz.motta@ibama.gov.br http://www.ibama.gov.br Luiz Motta
  • 2.
    MMA - Ministryof the Environment – Brazil IBAMA - Brazilian Institute of Environment and Renewable Natural Resources DIPRO - Directorship of Environmental Protection CGMAM – General Coordination of Monitoring COTIG – Coordination of Geospatial Technology * Luiz Motta: ● Environment Analyst of IBAMA since 2003 ● Expert in FOSS4G (contributor of QGIS)
  • 3.
    ● Database example. ●Definition of virtual layer (VRT) for check overlay. ● QGIS project configuration. ● Python script for automatic update. ● Checking overlay Presentation plan
  • 4.
    ● Dowload: https://www.dropbox.com/s/8efs5e8x054kiru/overlay_vrt.zip?dl=0 ● overlay_vrt.zip: ├──overlay_vrt.qgs ├── validate overlay_inside.vrt.xml ├── py │ └── update_vrt_by_edit.py ├── shp ├── test_overlay.dbf ├── test_overlay.prj ├── test_overlay.qml ├── test_overlay.qpj ├── test_overlay.shp └── test_overlay.shx Database example
  • 5.
    ● validate overlay_inside.vrt.xml: ●OGRVRTDataSource: Define dataset (set of layers) ● OGRVRTLayer: Define a layer ● SrcDataSource: Source of data ● SrcSQL: Define SQL for check overlay using 'SrcDataSource' ● GeometryField: Geometry's field of layer ● GeometryType: Geometry's type ● LayerSRS: Spatial Reference System Definition of VRT for check overlay Sources: ● VRT format: http://www.gdal.org/drv_vrt.html ● Spatialite: http://www.gaia-gis.it/spatialite-2.4.0/spatialite-sql-2.4.html
  • 6.
    QGIS project: overlay_vrt.qgs ●test_overlay properties: Suppress attribute form pop-up after creation → On QGIS project configuration
  • 7.
    Script: update_vrt_by_edit.py ● Enableautomatic update: ● test_overlay: Populate 'id' field ● overlay_area: Reload layer (remove and add again) ● Happening when save edition Python script for automatic update.
  • 8.
    Run 'update_vrt_by_edit.py' byconsole Python script for automatic update.
  • 9.
    Checking overlay ● Startedition of 'test_overlay' ● Create geometry with overlay ● Save edition ● Youtube: https://youtu.be/L78aOUwicBo