Using the mapxtreme wfs client programmatically, Using filters in wfs queries, Et, see – Pitney Bowes MapXtreme User Manual

Page 399

Advertising
background image

Chapter 22: Web Feature Service

Using the MapXtreme WFS Client Programmatically

MapXtreme v7.1

406

Developer Guide

Using the MapXtreme WFS Client Programmatically

MapXtreme comes with a WFS Client that you can use programmatically to access data from OGC-
compliant Web Feature Services. The MapXtreme WfsClient provides the ability to interact with any
WFS 1.0.0 compliant Server at the API level. The WfsClient and related classes are located in the
MapInfo.Wfs.Client namespace and uses the WFS Basic portion of the OGC specification. Using the
WfsClient class, you can call the following methods on any WFS 1.0.0 compliant server:

GetCapabilities

,

DescribeFeatureType

, and

GetFeature

.

public void MapInfo_Wfs_Client_GetCapabilities1(string Url) {

WfsCapabilities capabilities =

WfsClient.GetCapabilities(RequestMethod.GET, Url);

FeatureTypeList featureTypeList = capabilities.FeatureTypeList;
IList featureTypes = featureTypeList.FeatureTypes;
foreach (FeatureType featureType in featureTypes) {

System.Console.WriteLine("FeatureType: " + featureType.Name);

}

}

Using Filters in WFS Queries

Filters can be applied to a GetFeature request using the IFilter interface. A filter may either be spatial
or non-spatial (scalar). Spatial queries such as Bbox and Within allow you to get features that exist in
a certain area. Scalar filters allow you to query against specific properties of a feature type.
Compound filters like AND and OR may also be used.

MapXtreme WFS supports the following filter operations.

Advertising