Practical experiences with OGC services By Michal Sredl, Karel Charvat, Jachym Cepicky, Czech centre...

24
Practical experiences with OGC services By Michal Sredl, Karel Charvat, Jachym Cepicky, Czech centre for Science and Societ INSPIRE Conference, Istanbul, June 23. 2012

Transcript of Practical experiences with OGC services By Michal Sredl, Karel Charvat, Jachym Cepicky, Czech centre...

Page 1: Practical experiences with OGC services By Michal Sredl, Karel Charvat, Jachym Cepicky, Czech centre for Science and Society INSPIRE Conference, Istanbul,

Practical experiences with OGC services

By Michal Sredl, Karel Charvat, Jachym Cepicky, Czech centre for Science and Society

INSPIRE Conference, Istanbul, June 23. 2012

Page 2: Practical experiences with OGC services By Michal Sredl, Karel Charvat, Jachym Cepicky, Czech centre for Science and Society INSPIRE Conference, Istanbul,

CCSS role

• To build URM enviroGRIDS portal• To support partners with deployment of services

Page 3: Practical experiences with OGC services By Michal Sredl, Karel Charvat, Jachym Cepicky, Czech centre for Science and Society INSPIRE Conference, Istanbul,

CCSS role

Page 4: Practical experiences with OGC services By Michal Sredl, Karel Charvat, Jachym Cepicky, Czech centre for Science and Society INSPIRE Conference, Istanbul,

System overview

Web Client

HSLayers

(JavaScript)

- OpenLayers

- Ext

Server proxy

Proxy4ows(Python)

- Mapserver / MapScript- Gdal / Ogr- OwsLib

OWS Servers

MapServer GeoServer InterGraph ArcGis

WMS++

WMSWMS-TWFS, FES WCS...

Technology behind the CCSS Geoportal

Page 5: Practical experiences with OGC services By Michal Sredl, Karel Charvat, Jachym Cepicky, Czech centre for Science and Society INSPIRE Conference, Istanbul,

Mission

Challanges & Results

Display huge WFS data in web client → Proxy4ows Filter Encoding (FES) → OpenLayers, OwsLib, MapServer patches WFS Axis order issue → MapServer, OwsLib patches

→ some issues still remain

Page 6: Practical experiences with OGC services By Michal Sredl, Karel Charvat, Jachym Cepicky, Czech centre for Science and Society INSPIRE Conference, Istanbul,

Proxy4ows

Transforms WFS and WCS to WMS

For WMS, it transforms the coordinate systems

http://proxy4ows.org/

Is presented in a standalone presentation – Tuesday 14:20

Page 7: Practical experiences with OGC services By Michal Sredl, Karel Charvat, Jachym Cepicky, Czech centre for Science and Society INSPIRE Conference, Istanbul,

Filter Encoding

OpenLayers – <Filter_Capabilities> not parsed

Part of a WFS 1.1.0 GetCapabilities response

Page 8: Practical experiences with OGC services By Michal Sredl, Karel Charvat, Jachym Cepicky, Czech centre for Science and Society INSPIRE Conference, Istanbul,

Filter Encoding

OpenLayers – <Filter_Capabilities> not parsed

Desired result

Patch proposed- Comparison filters & related stuff- WFS 1.0.0 and 1.1.0

Page 9: Practical experiences with OGC services By Michal Sredl, Karel Charvat, Jachym Cepicky, Czech centre for Science and Society INSPIRE Conference, Istanbul,

• "wfs_filter" '<ogc:PropertyIsEqualTo xmlns:ogc="http://www.opengis.net/ogc"> <ogc:PropertyName>STUPEN</ogc:PropertyName> <ogc:Literal>3</ogc:Literal> </ogc:PropertyIsEqualTo>'

MapServer – Filter produced as invalid XML

Filter Encoding

FILTER=<ogc:Filter> <ogc:PropertyIsEqualTo+xmlns:ogc="http://www.opengis.net/ogc"> <ogc:PropertyName>STUPEN</ogc:PropertyName> <ogc:Literal>3</ogc:Literal> </ogc:PropertyIsEqualTo></ogc:Filter>

Mapfile

Mapserver code

Outgoing filter

Page 10: Practical experiences with OGC services By Michal Sredl, Karel Charvat, Jachym Cepicky, Czech centre for Science and Society INSPIRE Conference, Istanbul,

• "wfs_filter" '<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"> – <ogc:PropertyIsEqualTo>– <ogc:PropertyName>STUPEN</ogc:PropertyName> <ogc:Literal>3</ogc:Literal>

</ogc:PropertyIsEqualTo> </ogc:Filter>'

MapServer – Filter produced as invalid XML

Filter Encoding

FILTER=<ogc:Filter+xmlns:ogc="http://www.opengis.net/ogc"> <ogc:PropertyIsEqualTo> <ogc:PropertyName>STUPEN</ogc:PropertyName> <ogc:Literal>3</ogc:Literal> </ogc:PropertyIsEqualTo></ogc:Filter>

Mapfile

One-char patch

Outgoing filter

Page 11: Practical experiences with OGC services By Michal Sredl, Karel Charvat, Jachym Cepicky, Czech centre for Science and Society INSPIRE Conference, Istanbul,

WFS Axis Order

WFS 1.0.0 Axis order clearly defined in standard (East, North) <wfs:LatLongBoundingBox> causes confusion sometimes

WFS 1.1.0 As widely accepted, axis order should follow the definition of the particular CRS However, not a strict requirement in the standard Implementations of standards differ, heaps of confusion Axis order depends not only on the CRS, but also on the notation used

Page 12: Practical experiences with OGC services By Michal Sredl, Karel Charvat, Jachym Cepicky, Czech centre for Science and Society INSPIRE Conference, Istanbul,

WFS Axis Order

Axis order depends on the SRS used

Check http://www.epsg-registry.org/ for definitions

BBOX url parameter Sometimes you need to negotiate with the service providers to

follow the definition, as otherwise no data may be returned

Data themselves MapServer did not understand, that the axis order depends on the

SRS used, data was rotated by 90° MapServer patch provided

WFS 1.1.0

Page 13: Practical experiences with OGC services By Michal Sredl, Karel Charvat, Jachym Cepicky, Czech centre for Science and Society INSPIRE Conference, Istanbul,

WFS Axis Order

Axis order depends on the notation of the SRS as well:

EPSG:EPSG_code

→ WFS 1.0.0 style – fixed East, North

urn:EPSG:geographicCRC:epsg_code

→ Follow-up the definition

http://www.opengis.net/gml/srs/epsg.xml#EPSG_code

→ We don't know

WFS 1.1.0

Page 14: Practical experiences with OGC services By Michal Sredl, Karel Charvat, Jachym Cepicky, Czech centre for Science and Society INSPIRE Conference, Istanbul,

WFS Axis Order

More details here:

http://les-ejk.cz/2012/03/mapserver-as-wfs-1-1-0-client-not-suitable/

MapServer as WFS 1.1.0 Client

Page 15: Practical experiences with OGC services By Michal Sredl, Karel Charvat, Jachym Cepicky, Czech centre for Science and Society INSPIRE Conference, Istanbul,

Patches available

OpenLayers – <Filter_Capabilities> not parsed

http://trac.osgeo.org/openlayers/ticket/3652(Patch proposed)

MapServer – Filter produced as invalid XML

http://trac.osgeo.org/mapserver/ticket/4171 (Expected in 6.2)

MapServer – WFS Axis order

http://trac.osgeo.org/mapserver/ticket/4228(Expected in 6.2)

OwsLib patches already deployed

Page 16: Practical experiences with OGC services By Michal Sredl, Karel Charvat, Jachym Cepicky, Czech centre for Science and Society INSPIRE Conference, Istanbul,

FES - Filter Encoding SpecificationFiltering WFS Layers in enviroGRIDS Geoportal

Filter Encoding Standard enables you to create XML filter expressions and is incorporated in the WFS standard.

In Geoportal the FES is used with the help of Proxy4ows to filter the WFS layers.

Page 17: Practical experiences with OGC services By Michal Sredl, Karel Charvat, Jachym Cepicky, Czech centre for Science and Society INSPIRE Conference, Istanbul,

How to use it

- Add a WFS Layer

- In the layer switcher, right-click on the layer name and select “Filter”

Page 18: Practical experiences with OGC services By Michal Sredl, Karel Charvat, Jachym Cepicky, Czech centre for Science and Society INSPIRE Conference, Istanbul,

How to use it

Page 19: Practical experiences with OGC services By Michal Sredl, Karel Charvat, Jachym Cepicky, Czech centre for Science and Society INSPIRE Conference, Istanbul,

How to use it

- Filter window appears with comparison filter

- Select the property name, comparison operator and type in the desired value

- Apply the filter

Page 20: Practical experiences with OGC services By Michal Sredl, Karel Charvat, Jachym Cepicky, Czech centre for Science and Society INSPIRE Conference, Istanbul,

How to use it

Page 21: Practical experiences with OGC services By Michal Sredl, Karel Charvat, Jachym Cepicky, Czech centre for Science and Society INSPIRE Conference, Istanbul,

How does it work

Page 22: Practical experiences with OGC services By Michal Sredl, Karel Charvat, Jachym Cepicky, Czech centre for Science and Society INSPIRE Conference, Istanbul,

How does it work

WFS layers are displayed as WMS in the HSLayers Web Client (see Proxy4ows for details).

1. WFS GetCapabilities request is sent directly to the WFS server. Capabilities document is parsed and filter capabilities are saved.

2. WFS DescribeFeatureTypes request is sent directly to the WFS server. Reply is parsed and properties of the feature type are saved.

3. User creates the filter in the GUI, saved information from steps 1-2. is used.

Page 23: Practical experiences with OGC services By Michal Sredl, Karel Charvat, Jachym Cepicky, Czech centre for Science and Society INSPIRE Conference, Istanbul,

How does it work

4. User-created filter is written to FES and new WMS request is sent to Proxy4ows, accompanied with the filter in an additional parameter.

5. Proxy4ows takes the filter, creates new WFS request involving the filter, and sends it to the WFS server. Server replies with filtered layer.

6. Proxy4ows transforms the returned WFS layer to WMS and sends it to the client.

Page 24: Practical experiences with OGC services By Michal Sredl, Karel Charvat, Jachym Cepicky, Czech centre for Science and Society INSPIRE Conference, Istanbul,

Next Steps

In terms of standards, FES 1.0.0 and FES 1.1.0 is supported. In the future, FES 2.0.0 can be added.

In terms of filter types, only the Comparison filter is currently supported. In the future, more filters types can be added. That means the logical filter enabling to combine various expressions, spatial filter, expression editor, filtering based on feature ids, support for server-side functions.