beautypg.com

Creating a map layer from a wfs response – Pitney Bowes MapXtreme User Manual

Page 402

background image

Chapter 22: Web Feature Service

Creating a Map Layer from a WFS Response

MapXtreme v7.1

409

Developer Guide

From the filtered GetFeature call, only those rows of data that satisfy
PropertyIsGreaterThanOrEqualTo a population of 1,000,000 are returned. Notice Abu Dhabi is not
included in the results since its population is listed as 722,000.

Obj, Capital, Country, Cap_Pop, MI_Style,
Point,Abidjan,IVORY COAST,2700000,MapInfo.Styles.SimpleVectorPointStyle:
12 point,
Point,Addis Ababa,ETHIOPIA,1423111,MapInfo.Styles.SimpleVectorPointStyle:
12 point,
Point,Algiers,ALGERIA,1483000,MapInfo.Styles.SimpleVectorPointStyle: 12
point,
Point,Alma-ata,KAZAKHSTAN,1108000,MapInfo.Styles.SimpleVectorPointStyle:
12 point,
Point,Ankara,TURKEY,2553000,MapInfo.Styles.SimpleVectorPointStyle: 12
point,
Point,Baghdad,IRAQ,3400000,MapInfo.Styles.SimpleVectorPointStyle: 12
point,
Point,Baku,AZERBAIJAN,1115000,MapInfo.Styles.SimpleVectorPointStyle: 12
point,
...

Filtering with a Spatial Operator

The following example shows how to use a spatial query in a GetFeature request. In this case, it is
asking for all the rows in the Europe table that satisfy the specified minimum bounding rectangle.
This is accomplished using the spatial operator Bbox, a typical spatial operation that most WFS
servers support.

/// Now lets find rows in an MBR
///
// WGS84 - Europe
MapInfo.Geometry.DRect bbox = new MapInfo.Geometry.DRect(-
11.69, 35.36, 48.77, 65.05);
mfc = MapInfo.Wfs.Client.WfsClient.GetFeature(
wfsUrl,
new string[] { featureTypeName },
bbox,
null,
"GML3",
-1);
DisplayFeatureCollection(mfc[0]);

Creating a Map Layer from a WFS Response

If you wish to bring WFS feature data into MapXtreme as a map layer for further analysis, it is
necessary for you to run code that parses the GML and creates a MultiFeatureCollection.