1 / 44

David Blasby The Open Planning Project New York

David Blasby The Open Planning Project New York. Goals Explain what a WFS and WMS are, and when to use them Be able to create simple spatial web applications Understand a bit about Geoserver. 1. Introduction to Open Web Services 2. WFS basics 3. WMS basics 4. Using WFS and WMS together

rod
Download Presentation

David Blasby The Open Planning Project New York

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. David Blasby The Open Planning Project New York

  2. Goals Explain what a WFS and WMS are, and when to use them Be able to create simple spatial web applications Understand a bit about Geoserver

  3. 1. Introduction to Open Web Services • 2. WFS basics • 3. WMS basics • 4. Using WFS and WMS together • 5. Example Web Services • Dynamic Features - <Inlinefeature> • Custom SLD & making a WFS request to construct a SLD • Dynamic adding of Features to the dataset

  4. Basic Open Web Services Request in known format Any server that implements the Service specification Client application Response in known format Base data Known operation User • An Open Web Service is a Web Services that: • has a well known format for what the request looks like • has a well defined meaning for how to execute the request • has a well known format for the what the response looks like • the definition is codified in a Specification Document

  5. Underlying Datasets - Databases, Shapefiles, Imagery Open Web Services WMS WFS The WFS is concerned with accessing and updating the underlying datasets The WMS is concerned with rendering maps

  6. The OGC Services - WFS and WMS Underlying Datasets - Databases, Shapefiles, Imagery WFS WMS GetCapabilities GetMap GetFeatureInfo DescribeLayer GetLegendGraphic WMS Requests GetCapabilities GetFeature GetFeatureWithLock DescribeFeatureType Transaction LockFeature WFS Requests Internet User

  7. WFS and WMS: when to use • What to use the WFS services for • A WFS allows uniform direct access to the features stored on a server. Use a WFS when • you want to perform actions such as: • query a dataset and retrieve the features • find the feature definition (feature's property names and types) • add features to dataset • delete feature from a dataset • update feature in a dataset • lock features to prevent modification • What to use the WMS services for • A WMS allows for uniform rendering access to features stored on a server. Use a WMS when • you want to perform actions such as: • Producing Maps • Very simple Querying of data

  8. Using WFS and WMS together WFS 1 WFS 2 Base datasets 3 & 4 Base datasets 1 & 2 WMS 1 WMS 2 Spatial Web Application User

  9. The WFS Underlying Datasets - Databases, Shapefiles, WFS WMS GetCapabilities GetFeature GetFeatureWithLock DescribeFeatureType Transaction LockFeature WFS Requests Internet User

  10. The GetFeature Service The GetFeature service allows you to treat your datasets like a spatial database and run queries on it. SELECT polygon_outline, population, area FROM USAstates WHERE stateName = ‘New York’; • The request specifies three things: • What dataset to query (also called a “FeatureType”) • What columns to return • A filter to select a subset of features

  11. GetFeature - <Filter> XML Filter Expression Feature 1 Feature Feature 2 Feature 3 Filter Evaluator Feature 4 Feature 5 fail pass Feature 2 Feature 4 Filter is the basis for most of the OGC specifications

  12. Constructing - <Filters> WHEREGeometry Intersects BoundingBox <Filter> <Intersects> <PropertyName>Geometry</PropertyName> <gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#4326”> <gml:coordinates>13.0983,31.589935.5472,42.8143</gml:coordinates> </gml:Box> </ Intersects > </Filter> WHERE stateName = ‘New York’ <Filter> <PropertyIsEqualTo> <PropertyName>stateName</PropertyName> <Literal>New York</Literal> </PropertyIsEqualTo> </Filter>

  13. GetFeature requests FROM ... SELECT ... WHERE ...

  14. Interpreting GetFeature Results XML Schema XML document

  15. Adding Functionality to Filters <Filter> <PropertyIsEqualTo> <Function name=“substring”> <PropertyName>cfcc</PropertyName> <Literal>0</Literal> <Literal>1</Literal> </Function> <Literal>A<Literal> </ PropertyIsEqualTo> </Filter> These Function are also available for use in SLD. Geoserver allows you to easily add any Java function or class.

  16. Transaction Transactions allow you to update, delete, and insert features in a manner very similar to a spatial database. UPDATE USAstates SET population = 8000000 WHERE stateName = ‘New York’; INSERT INTO USAstates (stateName, population) VALUES(‘New York’,8000000); DELETE FROM USAstates WHERE stateName = ‘New York’;

  17. Update UPDATE ... SET ... WHERE...

  18. Insert GML Version of Feature

  19. Delete

  20. ACID A good WFS (like Geoserver) will execute the transactions in an ACID manner. This means that your <Transaction> command set will either completely succeed or completely fail - you do not have half-executed transactions. NOTE: A single <Transaction> can have any number of Inserts, Deletes, and Updates in it. Geoserver supports this for all the file and database formats.

  21. Transaction Validation • Check that the feature is internally consistent: • Geometry is valid • Properties are in the “accepted” range • Check that the feature is external consistent: • Topological rules • No houses in the Ocean This is Geoserver specific

  22. Feature Versioning Geoserver is currently adding support for automatically versioning features (and datasets) so changes can be rolled back or analyzed. This is Geoserver specific

  23. The WMS Underlying Datasets - Databases, Shapefiles, Imagery WFS WMS GetCapabilities GetMap GetFeatureInfo DescribeLayer GetLegendGraphic WMS Requests Internet User

  24. GetMap Features Renderer User request (SLD?) SLD Configuration

  25. Styled Layer Descriptor (SLD) Basics <Rule> <Filter> …. Deep water Lakes ... </Filter> <PolygonSymbolizer> …. Colour Dark Blue ... </ PolygonSymbolizer> </Rule> <Rule> <Filter> …. Shallow water Lakes ... </Filter> <PolygonSymbolizer> …. Colour Light Blue ... </ PolygonSymbolizer> </Rule> • In the most basic form (a SLD used to render a layer) will contain • a set of <Rule> elements. Each <Rule> element contains two things: • A <Filter> to specify what Features this Rule applies to • A set of Symbolizers that actually do the rendering.

  26. SLD-POST A user can also send an SLD file to the WMS server as part of the GetMap request. In this manner, the SLD file will specify what layers to render and also how to render them. <NamedLayer> <Name>USAlakes</Name> <NamedStyle> <Name>lakeStyle</Name> </NamedStyle> </NamedLayer> <NamedLayer> <Name>USAlakes</Name> <UserStyle> ... <Rule> <Filter> …. Deep water Lakes ... </Filter> <PolygonSymbolizer> …. Colour Dark Blue ... </ PolygonSymbolizer> </Rule> ... </UserStyle> </NamedLayer> Equivalent of LAYER=USAlakes,STYLE=lakeStyle

  27. SLD 1.1 InlineFeatures Normally, the SLD will refer to local (hosted inside the WMS) layers, but it can also communicate with remote WFS servers. The user can also supply small sets of features within the actual SLD GetMap Request. <UserLayer> <Name>Inline</Name> <InlineFeature> <BodyPart> <PartType>Face</ PartType > <polygonProperty> <gml:Polygon> ... </gml:Polygon> </polygonProperty> </BodyPart> </InlineFeature> … <Rule> … eyes ... </Rule> <Rule> … face ... </Rule> … </UserLayer>

  28. Web Applications using WFS and WMS WFS 1 WFS 2 Base datasets 3 & 4 Base datasets 1 & 2 WMS 1 WMS 2 Spatial Web Application User

  29. Rendering Temporary Features in Maps using SLD InlineFeature Its quite difficult to interpret these numbers - why don’t we show it on a map?

  30. Demonstration of BBOX application

  31. Highlighting features using user specified SLD and WFS queries User Clicks on Map

  32. WFS WMS User Clicks Convert to world coordinates Query WFS XMLHttpRequest - GetFeature GML Find Street Name Create SLD GetMap with SLD

  33. GetFeature request GetFeature response Extract road name

  34. Highlight all feature with that name SLD for GetMap request

  35. Demonstration of click-to-highlight app

  36. A simple web application using WFS and WMS • popup preview for a mouse “hover” • click on a feature; go to its website • click on map; add a new feature

  37. WFS User Hovers Convert to world coordinates Query WFS XMLHttpRequest - GetFeature GML Anything returned? yes no Extract thumbnail URL Execute Popup

  38. WFS WFS XMLHttpRequest - Transaction Success/Fail User Clicks Convert to world coordinates Query WFS XMLHttpRequest - GetFeature GML Anything returned? no yes Visit Site Get Info From User

  39. Demonstration of Web Application

  40. TOPP Geoserver RoadMap • Geotools improvements to handle more “advanced” data • Validation and Feature Versioning • GeoCollaborator - GeoWiki and tools for collaborative mapping • OpenSDI Re-architecture for plugable services and configuration • Hosting Data (i.e. TIGER) via WMS and WFS • Web Coverage Server (WCS) - initial release available on branch. • Improved performance • WFS 1.1

  41. Geoserver Users

  42. Questions? David Blasby The Open Planning Project New York

More Related