Application Domain Extension
FarmGML is an Application Domain Extension (ADE) of CityGML 3.0, designed to represent rural enterprises, agricultural activities, and agro-environmental data consistent with digital twin semantics.
It allows the integration of agricultural and environmental information into structures compatible with 3D models, spatial databases, WebGIS platforms (CesiumJS), and agroclimatic analytics systems.
It extends CityGML classes (such as LandUse, Vegetation, and Building) to model:
- Rural properties and agricultural enterprises
- Crop areas, production cycles, and harvest lots
- Risk and sustainability indicators
- Integration with geospatial and remote-sensing data
FarmGML enables integration between 3D city models, agricultural information systems, QGIS, 3DCityDB, and CesiumJS for digital twins of rural areas.
- About the Project
- Modeled Features
- Version Information
- Validation Results
- Workflow (MDA)
- References
- Contact
The FarmGML ADE extends CityGML 3.0 to represent agricultural holdings (farms), crop areas, rural enterprises (livestock, aquaculture), agricultural operations, risk assessments (ZARC NM), and sustainability metrics.
This project follows the Model-Driven UML-to-XSD methodology and complies with the OGC CityGML 3.0 ADE design rules.
FarmGML is divided into modules, including:
- Core (
farm-core.xsd): Defines the mainRuralPropertyfeature (based onluse:LandUse) and basic data types (Person, Household, Farm Profile). - Enterprise (
farm-enterprise.xsd): Models different enterprises such asLivestockEnterprise,AquacultureEnterprise, andForestryEnterprise. - Production (
farm-production.xsd): DefinesAnnualCropArea,PerennialCropArea(based onveg:PlantCover), andHarvestedLot. - Operations (
farm-operations.xsd): Models events over time (e.g., planting, harvesting) usingAgriculturalOperation(based ondyn:AbstractDynamizer). - Risk & Sustainability (
farm-risk.xsd,farm-sustainability.xsd): Adds generic attributes for Risk (ZARC) and sustainability metrics (carbon footprint, etc.) via thecore:genericAttributehook. - Temporal (
farm-temporal.xsd): Enables TimeSlices for features (based onvers:AbstractVersion).
| Field | Value |
|---|---|
| ADE Name | FarmGML |
| Version | 1.3 |
| Target Standard | OGC CityGML 3.0 |
| Namespace URI | https://igorquintao.github.io/FarmGML-ADE/schemas/1.3 |
| Schema Location | https://raw.githubusercontent.com/IgorQuintao/FarmGML-ADE/main/schemas/1.3/FarmGML.xsd |
| Prefix | farm |
| Last Updated | 2025-10-31 |
| License | Creative Commons Attribution 4.0 International (CC BY 4.0) |
FarmGML-ADE/
β
βββ xsd/ # FarmGML and modules (100% online)
β βββ FarmGML_ADE_v1-3.xsd
β β
β βββ modules/
β βββ farm-core.xsd
β βββ farm-hooks.xsd
β βββ farm-enterprise.xsd
β βββ farm-production.xsd
β βββ farm-operations.xsd
β βββ farm-risk.xsd
β βββ farm-sustainability.xsd
β βββ farm-temporal.xsd
β βββ farm-join.xsd
β
βββ test_data/ # Load the GML Test Data in QGIS
β βββ example_ruralproperty.gml
β βββ example_cropcycle.gml
β βββ example_enterprise.gml
β βββ examplo_macro_lod0_ruralproperty.gml
β βββ examplo_meso_lod1_ruralproperty.gml
β βββ v1_example_ruralproperty.gml
β βββ v2_example_ruralproperty.gml
β
βββ model/ # UML/XMI source (conceptual model)
β βββ 1.3/
β βββ FarmGML_v1.3.xmi
β βββ diagrams/
β
βββ schemas/ # Generated schemas and examples (distribution 100% offline)
β βββ 1.3/
β βββ FarmGML.xsd
β βββ farm-core.xsd
β βββ farm-hooks.xsd
β βββ farm-enterprise.xsd
β βββ farm-production.xsd
β βββ farm-operations.xsd
β βββ farm-risk.xsd
β βββ farm-sustainability.xsd
β βββ farm-temporal.xsd
β βββ farm-join.xsd
β β
β βββ codelists/
β β βββ BuildingType.xml
β β βββ CropGrowthStage.xml
β β βββ EducationLevel.xml
β β βββ FeedingPractice.xml
β β βββ ForestryProductType.xml
β β βββ InputType.xml
β β βββ LandTenureType.xml
β β βββ MainLocationType.xml
β β βββ OperationType.xml
β β βββ RelationshipToHead.xml
β β βββ SeedVarietyType.xml
β β βββ Sex.xml
β β βββ StorageType.xml
β β
β βββ examples/
β β βββ example_ruralproperty.gml
β β βββ example_simp-ruralproperty.gml
β β βββ example_cropcycle.gml
β β βββ example_enterprise.gml
β βββ metadata/
β β βββ farmgml-metadata.yaml
β β
β βββ ogc/
β βββ citygml/
β β βββ 3.0/
β β β βββ core.xsd
β β β βββ landUse.xsd
β β β βββ building.xsd
β β β βββ vegetation.xsd
β β β βββ generics.xsd
β β β βββ dynamizer.xsd
β β β βββ versioning.xsd
β β βββ xAL/
β β βββ xAL-types.xsd
β β βββ xAL.xsd
β β
β βββ gml/
β βββ 3.2.1/
β βββ gml.xsd
β βββ xlinks.xsd
β
βββ tools/ # Automation and validation tools
β βββ shapechange-config/
β β βββ farmgml_1.3_config.xml
β βββ scripts/
β β βββ generate-xsd-from-uml.bat
β β βββ validate-xsd.sh
β βββ validation/
β βββ validate_farmgml.py
β βββ validate_report.html
β β
β βββ schematron/
β βββ farmgml_rules.sch
β
βββ docs/ # Documentation and policies
β βββ specification/
β β βββ FarmGML_Conceptual_Model.pdf
β β βββ FarmGML_Encoding_Specification.pdf
β β βββ FarmGML_UseCases.pdf
β β
β βββ schema-reference/
β β βββ 1.3/
β β βββ farmgml_rules.sch
β β
β βββ policies/
β βββ namespace-policy.md
β
βββ .ogc/ # OGC submission metadata
β βββ submission-manifest.yaml
β βββ contact.json
β βββ ogc-registration.yaml
β
βββ CHANGELOG.md
βββ LICENSE.txt
βββ README.md| Module | Description |
|---|---|
| farm-core.xsd | Defines the FarmGML core model (RuralProperty, LandUnit, FarmProfile, etc.) |
| farm-enterprise.xsd | Models rural enterprises, their legal and structural attributes |
| farm-production.xsd | Defines productive areas (AnnualCropArea, PerennialCropArea, Pasture, etc.) |
| farm-operations.xsd | Describes agricultural operations and temporal dynamizers |
| farm-risk.xsd | Structures for insurance, risk indexes, and ZARC indicators |
| farm-sustainability.xsd | Environmental and sustainability indicators |
| farm-temporal.xsd | Temporal modeling based on core:AbstractTimeSliceType |
| farm-hooks.xsd | ADE integration hooks for CityGML generic linkage |
Validation was performed using xmlschema 2.5.1 and Python 3.11 via the script tools/validation/validate_farmgml.py below:
import xmlschema
from pathlib import Path
XSD_PATH = Path("schemas/1.3/FarmGML.xsd")
EXAMPLES_DIR = Path("schemas/1.3/examples")
schema = xmlschema.XMLSchema(XSD_PATH)
print(f"β
Loaded schema: {XSD_PATH}")
print("π Validating examples...\n")
for gml in EXAMPLES_DIR.glob("*.gml"):
try:
schema.validate(gml)
print(f"{gml} : OK β
")
except xmlschema.XMLSchemaException as e:
print(f"{gml} : Error β -> {e.reason}")tools/validation/validate_report.html
| GML File | Status |
|---|---|
| example_cropcycle.gml | β OK |
| example_enterprise.gml | β OK |
| example_ruralproperty.gml | β OK |
| example_simp-ruralproperty.gml | β OK |
All GML example files were successfully validated.
The FarmGML.xsd schema is fully compliant with OGC CityGML 3.0 ADE and GML 3.2.1 standards.
FarmGML adopts a Model-Driven Architecture approach.
All schemas and documentation are generated from the UML conceptual model.
Workflow summary:
- Model conceptual features in UML.
- Export UML β XMI (
model/1.3/FarmGML_v1.3.xmi). - Configure ShapeChange using
tools/shapechange-config/farmgml_1.3_config.xml. - Run ShapeChange to generate XSD modules under
schemas/1.3/. - Validate using the included
validate-xsd.shscript. - Test instances (
example_ruralproperty.gml) with 3DCityDB, CesiumJS, and QGIS.
To validate the FarmGML ADE:
-
3DCityDB
- Import the CityGML 3.0 core schema and FarmGML ADE modules.
- Load
schemas/1.3/examples/example_ruralproperty.gmlusing the Importer/Exporter. - Confirm ADE tables are created (e.g.,
farm_ruralproperty,farm_croparea). - Visualize using the 3DCityDB Web Map Client or CesiumJS.
-
CesiumJS
- Convert the database instance to 3D Tiles using 3DCityDB Exporter.
- Publish tiles on a CesiumJS viewer.
- Use the attributes from FarmGML (e.g., crop type, sustainability index) for pop-ups or layer styling.
-
QGIS
- Load the GML directly via Layer β Add Layer β Add Vector Layerβ¦
- Ensure the CityGML 3.0 + ADE plugin is active.
- Inspect feature attributes and geometry consistency.
Validation success criteria:
- All features are parsed without schema errors.
- The ADE-specific attributes (farm:) are recognized in each environment.
β’ 3DCityDB ADE Manager
β’ CesiumJS (https://cesium.com/platform/cesiumjs)
β’ Van den Brink, L., Stoter, J., Zlatanova, S. (2013) β UML-Based Approach to Developing a CityGML Application Domain Extension. Transactions in GIS, 17(6): 920β942.
β’ OGC (2021) β CityGML 3.0 Conceptual Model Standard (OGC 20-010).
β’ ISO 19136 β Geography Markup Language (GML).
β’ ShapeChange Tool β UML-to-GML encoder implementing ISO encoding rules.
| Name | Eng. Igor QuintΓ£o |
|---|---|
| Organization | UNIVERSIDADE FEDERAL DE VIΓOSA - UFV |
| ------- | ------- |
| [email protected] | |
| ------- | ------- |
| Version | FarmGML ADE v1.3 |
| ------- | ------- |
| Date | 2025-10-25 |
| ------- | ------- |
Developed using Model-Driven Architecture principles (UML β ShapeChange β XSD)
The official namespace URI for this ADE is:
https://igorquintao.github.io/FarmGML-ADE/schemas/1.3
It is maintained by Eng. Igor QuintΓ£o under GitHub Pages hosting.
This URI resolves to the authoritative location of the FarmGML ADE schemas and documentation.