![Page 1: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/1.jpg)
David BlasbyThe Open Planning ProjectNew York
![Page 2: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/2.jpg)
Goals
Explain what a WFS and WMS are, and when to use themBe able to create simple spatial web applicationsUnderstand a bit about Geoserver
![Page 3: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/3.jpg)
1. Introduction to Open Web Services2. WFS basics3. WMS basics4. Using WFS and WMS together5. Example Web Services
• Dynamic Features - <Inlinefeature>• Custom SLD & making a WFS request to construct a SLD• Dynamic adding of Features to the dataset
![Page 4: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/4.jpg)
User
Clientapplication
Request in known format
Response in known formatBase data
Any server that implements the Service specification
Known operation
Basic Open Web Services
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
![Page 5: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/5.jpg)
Open Web Services
Underlying Datasets - Databases, Shapefiles, Imagery
The WMS is concernedwith rendering maps
The WFS is concerned with accessing and updating the underlying datasets
WMS WFS
![Page 6: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/6.jpg)
Underlying Datasets - Databases, Shapefiles, Imagery
GetCapabilitiesGetFeatureGetFeatureWithLockDescribeFeatureTypeTransactionLockFeature
WFS Requests
GetCapabilitiesGetMapGetFeatureInfoDescribeLayerGetLegendGraphic
WMS Requests
Internet
User
The OGC Services - WFS and WMS
WFS WMS
![Page 7: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/7.jpg)
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
WFS and WMS: when to use
![Page 8: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/8.jpg)
WFS 1
WMS 1
User
Spatial Web Application
Base datasets 1 & 2
WFS 2
Base datasets 3 & 4
WMS 2
Using WFS and WMS together
![Page 9: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/9.jpg)
The WFS
Underlying Datasets - Databases, Shapefiles,
GetCapabilitiesGetFeatureGetFeatureWithLockDescribeFeatureTypeTransactionLockFeature
WFS Requests
Internet
User
WFS WMS
![Page 10: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/10.jpg)
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, areaFROM USAstatesWHERE 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
![Page 11: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/11.jpg)
GetFeature - <Filter>
Feature 1Feature 2Feature 3Feature 4Feature 5
Feature 2Feature 4
Feature
Filter Evaluator
XM
L F
ilter Expression
pass fail
Filter is the basis for most of the OGC specifications
![Page 12: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/12.jpg)
WHERE Geometry 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>
Constructing - <Filters>
![Page 13: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/13.jpg)
GetFeature requests
FROM ...
SELECT ...
WHERE ...
![Page 14: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/14.jpg)
Interpreting GetFeature Results
XML documentXML Schema
![Page 15: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/15.jpg)
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.
![Page 16: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/16.jpg)
Transaction
Transactions allow you to update, delete, and insert features in amanner very similar to a spatial database.
UPDATE USAstates SET population = 8000000WHERE stateName = ‘New York’;
DELETE FROM USAstatesWHERE stateName = ‘New York’;
INSERT INTO USAstates (stateName, population)VALUES (‘New York’,8000000);
![Page 17: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/17.jpg)
UPDATE ...
SET ...
WHERE...
Update
![Page 18: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/18.jpg)
Insert
GML Versionof Feature
![Page 19: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/19.jpg)
Delete
![Page 20: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/20.jpg)
ACID
A good WFS (like Geoserver) will execute the transactions in anACID manner. This means that your <Transaction> commandset will either completely succeed or completely fail - you do nothave 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.
![Page 21: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/21.jpg)
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
![Page 22: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/22.jpg)
Feature Versioning
Geoserver is currently adding support for automaticallyversioning features (and datasets) so changes can be rolled back or analyzed.
This is Geoserver specific
![Page 23: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/23.jpg)
The WMS
Underlying Datasets - Databases, Shapefiles, Imagery
GetCapabilitiesGetMapGetFeatureInfoDescribeLayerGetLegendGraphic
WMS Requests
Internet
User
WFS WMS
![Page 24: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/24.jpg)
GetMap
Features
RendererSLD Configuration User request (SLD?)
![Page 25: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/25.jpg)
Styled Layer Descriptor (SLD) Basics
In the most basic form (a SLD used to render a layer) will containa 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.
<Rule> <Filter> …. Deep water Lakes ... </Filter> <PolygonSymbolizer> …. Colour Dark Blue ... </ PolygonSymbolizer></Rule>
<Rule> <Filter> …. Shallow water Lakes ... </Filter> <PolygonSymbolizer> …. Colour Light Blue ... </ PolygonSymbolizer></Rule>
![Page 26: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/26.jpg)
SLD-POST
A user can also send an SLD file to the WMS server as part of theGetMap 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>
Equivalent of LAYER=USAlakes,STYLE=lakeStyle
<NamedLayer> <Name>USAlakes</Name> <UserStyle> ... <Rule> <Filter> …. Deep water Lakes ... </Filter> <PolygonSymbolizer> …. Colour Dark Blue ... </ PolygonSymbolizer> </Rule> ... </UserStyle></NamedLayer>
![Page 27: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/27.jpg)
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 alsosupply 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>
![Page 28: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/28.jpg)
Web Applications using WFS and WMS
WFS 1
WMS 1
User
Spatial Web Application
Base datasets 1 & 2
WFS 2
Base datasets 3 & 4
WMS 2
![Page 29: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/29.jpg)
Rendering Temporary Features in Maps using SLD InlineFeature
Its quite difficult to interpret these numbers - why don’t we show it on a map?
![Page 30: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/30.jpg)
![Page 31: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/31.jpg)
![Page 32: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/32.jpg)
Demonstration of BBOX application
![Page 33: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/33.jpg)
Highlighting features using user specified SLD and WFS queries
User Clicks on Map
![Page 34: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/34.jpg)
User Clicks
Query WFS
Find Street Name
Create SLD
Convert to world coordinates
XMLHttpRequest - GetFeature
WF
SGML
WM
SGetMap with SLD
![Page 35: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/35.jpg)
GetFeaturerequest
GetFeatureresponse
Extract road name
![Page 36: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/36.jpg)
SLD for GetMap request
Highlight all featurewith that name
![Page 37: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/37.jpg)
Demonstration of click-to-highlight app
![Page 38: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/38.jpg)
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
![Page 39: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/39.jpg)
User Hovers
Query WFS
Anything returned?
Convert to world coordinates
XMLHttpRequest - GetFeature
WF
SGML
noyes
Extract thumbnail URL
Execute Popup
![Page 40: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/40.jpg)
User Clicks
Query WFS
Anything returned?
Convert to world coordinates
XMLHttpRequest - GetFeature
WF
SGML
yesno
Get Info From User
Visit Site
XMLHttpRequest - Transaction
WF
S
Success/Fail
![Page 41: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/41.jpg)
Demonstration of Web Application
![Page 42: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/42.jpg)
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
![Page 43: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/43.jpg)
Geoserver Users
![Page 44: David Blasby The Open Planning Project New York](https://reader036.vdocuments.site/reader036/viewer/2022062322/56814f53550346895dbcfab9/html5/thumbnails/44.jpg)
Questions?
David BlasbyThe Open Planning ProjectNew York