Exporting Meteo Complex features using Data Loader Module

Create the PostGIS JDBC store for the meteo schema

Open GeoServer Admin UI and open the Stores page. Click on Add new store and select Postgis.

../../_images/loader_meteo01.png

Configure the PostGIS store with the connections to the local Postgres instance, name it meteo_jdbc and select the meteo schema, then save.

../../_images/loader_meteo02.png

Generate the complex features layer with Smart Data Loader

Open GeoServer Admin UI and open the Stores page. Click on Add new store and select Smart Data Loader.

../../_images/loader_meteo03.png

Configure the Smart Data Loader data source, name it meteo_complex, select meteo_jdbc on the internal Data store name, select meteo_stations as Root entity. Click on Save.

../../_images/loader_meteo04.png

This action will open the New Layer interface. Click on Publish action for MeteoStationsFeature layer.

../../_images/loader_meteo05.png

On the New Layer interface, click on the calculate bounds links and save button. Then go to the Preview Layers inteface and find the MeteoStationsFeature layer, expand the All Formats list and select GML 3.2. The exported GML from the generated complex features Application Schema store will be the following:

<wfs:FeatureCollection xmlns:wfs="http://www.opengis.net/wfs/2.0"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:geosolutions="http://www.geo-solutions.it/workshop"
    xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xlink="http://www.w3.org/1999/xlink"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" numberMatched="unknown" numberReturned="3"
    timeStamp="2024-01-15T17:42:55.583Z"
    xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://localhost:8083/geoserver/schemas/wfs/2.0/wfs.xsd
                        http://www.geo-solutions.it/workshop file:/C:/Users/fmino/Documents/GeoSolutions/training/Training-Geoserver-2.18.x-20231106/geoserver_data/workspaces/geosolutions/meteo_complex/appschema-mappings/meteo_stations-gml.xsd
                        http://www.opengis.net/gml/3.2 http://localhost:8083/geoserver/schemas/gml/3.2.1/gml.xsd">
    <wfs:member>
        <geosolutions:MeteoStationsFeature gml:id="MeteoStationsFeature.7">
            <geosolutions:id>7</geosolutions:id>
            <geosolutions:code>BOL</geosolutions:code>
            <geosolutions:common_name>Bologna</geosolutions:common_name>
            <geosolutions:position>
                <gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
                    <gml:pos>11.34 44.5</gml:pos>
                </gml:Point>
            </geosolutions:position>
            <geosolutions:meteoObservations>
                <geosolutions:MeteoObservationsFeature gml:id="MeteoObservationsFeature.3">
                    <geosolutions:id>3</geosolutions:id>
                    <geosolutions:time>2016-12-19T12:28:31Z</geosolutions:time>
                    <geosolutions:value>35.0</geosolutions:value>
                    <geosolutions:meteoParameters>
                        <geosolutions:MeteoParametersFeature gml:id="MeteoParametersFeature.1">
                            <geosolutions:id>1</geosolutions:id>
                            <geosolutions:param_name>temperature</geosolutions:param_name>
                            <geosolutions:param_unit>C</geosolutions:param_unit>
                        </geosolutions:MeteoParametersFeature>
                    </geosolutions:meteoParameters>
                </geosolutions:MeteoObservationsFeature>
            </geosolutions:meteoObservations>
            <geosolutions:meteoObservations>
                <geosolutions:MeteoObservationsFeature gml:id="MeteoObservationsFeature.4">
                    <geosolutions:id>4</geosolutions:id>
                    <geosolutions:time>2016-12-19T12:28:55Z</geosolutions:time>
                    <geosolutions:value>25.0</geosolutions:value>
                    <geosolutions:meteoParameters xlink:href="#MeteoParametersFeature.1" />
                </geosolutions:MeteoObservationsFeature>
            </geosolutions:meteoObservations>
            <geosolutions:meteoObservations>
                <geosolutions:MeteoObservationsFeature gml:id="MeteoObservationsFeature.5">
                    <geosolutions:id>5</geosolutions:id>
                    <geosolutions:time>2016-12-19T12:29:24Z</geosolutions:time>
                    <geosolutions:value>80.0</geosolutions:value>
                    <geosolutions:meteoParameters>
                        <geosolutions:MeteoParametersFeature gml:id="MeteoParametersFeature.2">
                            <geosolutions:id>2</geosolutions:id>
                            <geosolutions:param_name>wind speed</geosolutions:param_name>
                            <geosolutions:param_unit>Km/h</geosolutions:param_unit>
                        </geosolutions:MeteoParametersFeature>
                    </geosolutions:meteoParameters>
                </geosolutions:MeteoObservationsFeature>
            </geosolutions:meteoObservations>
            <geosolutions:meteoObservations>
                <geosolutions:MeteoObservationsFeature gml:id="MeteoObservationsFeature.6">
                    <geosolutions:id>6</geosolutions:id>
                    <geosolutions:time>2016-12-19T12:30:26Z</geosolutions:time>
                    <geosolutions:value>1019.0</geosolutions:value>
                    <geosolutions:meteoParameters>
                        <geosolutions:MeteoParametersFeature gml:id="MeteoParametersFeature.3">
                            <geosolutions:id>3</geosolutions:id>
                            <geosolutions:param_name>pressure</geosolutions:param_name>
                            <geosolutions:param_unit>hPa</geosolutions:param_unit>
                        </geosolutions:MeteoParametersFeature>
                    </geosolutions:meteoParameters>
                </geosolutions:MeteoObservationsFeature>
            </geosolutions:meteoObservations>
            <geosolutions:meteoObservations>
                <geosolutions:MeteoObservationsFeature gml:id="MeteoObservationsFeature.7">
                    <geosolutions:id>7</geosolutions:id>
                    <geosolutions:time>2016-12-19T12:30:51Z</geosolutions:time>
                    <geosolutions:value>1015.0</geosolutions:value>
                    <geosolutions:meteoParameters xlink:href="#MeteoParametersFeature.3" />
                </geosolutions:MeteoObservationsFeature>
            </geosolutions:meteoObservations>
        </geosolutions:MeteoStationsFeature>
    </wfs:member>
    <wfs:member>
        <geosolutions:MeteoStationsFeature gml:id="MeteoStationsFeature.13">
            <geosolutions:id>13</geosolutions:id>
            <geosolutions:code>ALS</geosolutions:code>
            <geosolutions:common_name>Alessandria</geosolutions:common_name>
            <geosolutions:position>
                <gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
                    <gml:pos>8.63 44.92</gml:pos>
                </gml:Point>
            </geosolutions:position>
            <geosolutions:meteoObservations>
                <geosolutions:MeteoObservationsFeature gml:id="MeteoObservationsFeature.1">
                    <geosolutions:id>1</geosolutions:id>
                    <geosolutions:time>2016-12-19T12:26:40Z</geosolutions:time>
                    <geosolutions:value>20.0</geosolutions:value>
                    <geosolutions:meteoParameters xlink:href="#MeteoParametersFeature.1" />
                </geosolutions:MeteoObservationsFeature>
            </geosolutions:meteoObservations>
            <geosolutions:meteoObservations>
                <geosolutions:MeteoObservationsFeature gml:id="MeteoObservationsFeature.2">
                    <geosolutions:id>2</geosolutions:id>
                    <geosolutions:time>2016-12-19T12:27:13Z</geosolutions:time>
                    <geosolutions:value>155.0</geosolutions:value>
                    <geosolutions:meteoParameters xlink:href="#MeteoParametersFeature.2" />
                </geosolutions:MeteoObservationsFeature>
            </geosolutions:meteoObservations>
        </geosolutions:MeteoStationsFeature>
    </wfs:member>
    <wfs:member>
        <geosolutions:MeteoStationsFeature gml:id="MeteoStationsFeature.21">
            <geosolutions:id>21</geosolutions:id>
            <geosolutions:code>ROV</geosolutions:code>
            <geosolutions:common_name>Rovereto</geosolutions:common_name>
            <geosolutions:position>
                <gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
                    <gml:pos>11.05 45.89</gml:pos>
                </gml:Point>
            </geosolutions:position>
        </geosolutions:MeteoStationsFeature>
    </wfs:member>
</wfs:FeatureCollection>