Class WFSProvider
WFS dataprovider This provider can be used to obtain data from an OGC Web Feature Service. It performs the following requests: 'GetCapabilities', 'DescribeFeatureType' and 'GetFeature'. This class is optimized for performing requests to GeoServer (http://geoserver.org). Supported geometries are:
- PointPropertyType
- LineStringPropertyType
- PolygonPropertyType
- CurvePropertyType
- SurfacePropertyType
- MultiPointPropertyType
- MultiLineStringPropertyType
- MultiPolygonPropertyType
- MultiCurvePropertyType
- MultiSurfacePropertyType
Inherited Members
Namespace: Mapsui.Providers.Wfs
Assembly: Mapsui.Nts.dll
Syntax
public class WFSProvider : IProvider, IDisposable
Constructors
| Edit this page View SourceWFSProvider(WfsFeatureTypeInfo, WFSVersionEnum, IUrlPersistentCache?)
Use this constructor for initializing this dataprovider with a WfsFeatureTypeInfo object, so that 'GetCapabilities' and 'DescribeFeatureType' can be bypassed.
Declaration
public WFSProvider(WfsFeatureTypeInfo featureTypeInfo, WFSProvider.WFSVersionEnum wfsVersion, IUrlPersistentCache? persistentCache = null)
Parameters
Type | Name | Description |
---|---|---|
WfsFeatureTypeInfo | featureTypeInfo | The featureTypeInfo Instance |
WFSProvider.WFSVersionEnum | wfsVersion | The desired WFS Server version. |
IUrlPersistentCache | persistentCache | Persistent Cache |
WFSProvider(IXPathQueryManager, string, string, GeometryTypeEnum, WFSVersionEnum, IUrlPersistentCache?)
Use this constructor for initializing this dataprovider with all necessary parameters to gather metadata from 'GetCapabilities' contract.
Declaration
public WFSProvider(IXPathQueryManager getCapabilitiesCache, string nsPrefix, string featureType, GeometryTypeEnum geometryType, WFSProvider.WFSVersionEnum wfsVersion, IUrlPersistentCache? persistentCache = null)
Parameters
Type | Name | Description |
---|---|---|
IXPathQueryManager | getCapabilitiesCache | This cache (obtained from an already instantiated dataprovider that retrieves a featuretype hosted by the same service) helps to speed up gathering metadata. It caches the 'GetCapabilities' response. |
string | nsPrefix | Use an empty string or 'null', if there is no prefix for the featuretype. |
string | featureType | The name of the feature type |
GeometryTypeEnum | geometryType | Specifying the geometry type helps to accelerate the rendering process, if the geometry type in 'DescribeFeatureType is unprecise. |
WFSProvider.WFSVersionEnum | wfsVersion | The desired WFS Server version. |
IUrlPersistentCache | persistentCache | persistent Cache |
WFSProvider(IXPathQueryManager, string, string, WFSVersionEnum, IUrlPersistentCache?)
Use this constructor for initializing this dataprovider with all necessary parameters to gather metadata from 'GetCapabilities' contract.
Declaration
public WFSProvider(IXPathQueryManager getCapabilitiesCache, string nsPrefix, string featureType, WFSProvider.WFSVersionEnum wfsVersion, IUrlPersistentCache? persistentCache = null)
Parameters
Type | Name | Description |
---|---|---|
IXPathQueryManager | getCapabilitiesCache | This cache (obtained from an already instantiated dataprovider that retrieves a featuretype hosted by the same service) helps to speed up gathering metadata. It caches the 'GetCapabilities' response. |
string | nsPrefix | Use an empty string or 'null', if there is no prefix for the featuretype. |
string | featureType | The name of the feature type |
WFSProvider.WFSVersionEnum | wfsVersion | The desired WFS Server version. |
IUrlPersistentCache | persistentCache | persistent Cache |
WFSProvider(string, string, string, string, string, GeometryTypeEnum, WFSVersionEnum, IUrlPersistentCache?)
Use this constructor for initializing this dataprovider with all mandatory metadata for retrieving a featuretype, so that 'GetCapabilities' and 'DescribeFeatureType' can be bypassed.
Declaration
public WFSProvider(string serviceUri, string nsPrefix, string featureTypeNamespace, string featureType, string geometryName, GeometryTypeEnum geometryType, WFSProvider.WFSVersionEnum wfsVersion, IUrlPersistentCache? persistentCache = null)
Parameters
Type | Name | Description |
---|---|---|
string | serviceUri | The service URL |
string | nsPrefix | Use an empty string or 'null', if there is no prefix for the featuretype. |
string | featureTypeNamespace | Use an empty string or 'null', if there is no namespace for the featuretype. You don't need to know the namespace of the feature type, if you use the quick geometries option. |
string | featureType | The name of the feature type |
string | geometryName | The name of the geometry. |
GeometryTypeEnum | geometryType | Specifying the geometry type helps to accelerate the rendering process. |
WFSProvider.WFSVersionEnum | wfsVersion | The desired WFS Server version. |
IUrlPersistentCache | persistentCache | Persistent Cache |
WFSProvider(string, string, string, string, string, WFSVersionEnum, IUrlPersistentCache?)
Use this constructor for initializing this dataprovider with all mandatory metadata for retrieving a featuretype, so that 'GetCapabilities' and 'DescribeFeatureType' can be bypassed.
Declaration
public WFSProvider(string serviceUri, string nsPrefix, string featureTypeNamespace, string featureType, string geometryName, WFSProvider.WFSVersionEnum wfsVersion, IUrlPersistentCache? persistentCache = null)
Parameters
Type | Name | Description |
---|---|---|
string | serviceUri | The service URL |
string | nsPrefix | Use an empty string or 'null', if there is no prefix for the featuretype. |
string | featureTypeNamespace | Use an empty string or 'null', if there is no namespace for the featuretype. You don't need to know the namespace of the feature type, if you use the quick geometries option. |
string | featureType | The name of the feature type |
string | geometryName | The name of the geometry |
WFSProvider.WFSVersionEnum | wfsVersion | The desired WFS Server version. |
IUrlPersistentCache | persistentCache | Persistent Cache |
Properties
| Edit this page View SourceAxisOrder
Gets or sets a value indicating the axis order
Declaration
public int[] AxisOrder { get; set; }
Property Value
Type | Description |
---|---|
int[] |
Remarks
The axis order is an array of array offsets. It can be either {0, 1} or {1, 0}.
If not set explictly, CrsAxisOrderRegistry is asked for a value based on SRID.CRS
The spatial reference ID (CRS)
Declaration
public string? CRS { get; set; }
Property Value
Type | Description |
---|---|
string |
Credentials
Gets or sets the network credentials used for authenticating the request with the Internet resource
Declaration
public ICredentials? Credentials { get; set; }
Property Value
Type | Description |
---|---|
ICredentials |
DefaultCache
Default Cache
Declaration
public static IUrlPersistentCache? DefaultCache { get; set; }
Property Value
Type | Description |
---|---|
IUrlPersistentCache |
FeatureTypeInfo
Gets feature metadata
Declaration
public WfsFeatureTypeInfo? FeatureTypeInfo { get; }
Property Value
Type | Description |
---|---|
WfsFeatureTypeInfo |
GetCapabilitiesCache
This cache (obtained from an already instantiated dataprovider that retrieves a featuretype hosted by the same service) helps to speed up gathering metadata. It caches the 'GetCapabilities' response.
Declaration
public IXPathQueryManager? GetCapabilitiesCache { get; set; }
Property Value
Type | Description |
---|---|
IXPathQueryManager |
GetFeatureGetRequest
Gets or sets a value indicating whether the 'GetFeature' request should be done with HTTP GET. This option can be important when obtaining data from a WFS provided by an UMN MapServer.
Declaration
public bool GetFeatureGetRequest { get; set; }
Property Value
Type | Description |
---|---|
bool |
Labels
Gets or sets the property of the featuretype responsible for labels
Declaration
public List<string> Labels { get; set; }
Property Value
Type | Description |
---|---|
List<string> |
MultiGeometries
Gets or sets a value indicating whether the 'GetFeature' parser should ignore multi-geometries (MultiPoint, MultiLineString, MultiCurve, MultiPolygon, MultiSurface). By default it does not. Ignoring multi-geometries can lead to a better performance.
Declaration
public bool MultiGeometries { get; set; }
Property Value
Type | Description |
---|---|
bool |
OgcFilter
Gets or sets an OGC Filter.
Declaration
public IFilter? OgcFilter { get; set; }
Property Value
Type | Description |
---|---|
IFilter |
ProxyUrl
Gets and sets the proxy Url of the request.
Declaration
public string? ProxyUrl { get; set; }
Property Value
Type | Description |
---|---|
string |
QuickGeometries
Gets or sets a value indicating whether extracting geometry information from 'GetFeature' response shall be done quickly without paying attention to context validation, polygon boundaries and multi-geometries. This option accelerates the geometry parsing process, but in scarce cases can lead to errors.
Declaration
public bool QuickGeometries { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
| Edit this page View SourceCreateAsync(string, string, string, GeometryTypeEnum, WFSVersionEnum, IUrlPersistentCache?, string?, ICredentials?)
Initializes a new layer, and downloads and parses the service description
Declaration
public static Task<WFSProvider> CreateAsync(string getCapabilitiesUri, string nsPrefix, string featureType, GeometryTypeEnum geometryType, WFSProvider.WFSVersionEnum wfsVersion, IUrlPersistentCache? persistentCache = null, string? proxyUrl = null, ICredentials? credentials = null)
Parameters
Type | Name | Description |
---|---|---|
string | getCapabilitiesUri | Url of WMS server |
string | nsPrefix | ns Prefix |
string | featureType | feature Type |
GeometryTypeEnum | geometryType | geometry Type |
WFSProvider.WFSVersionEnum | wfsVersion | Version number of wms leave null to get the default service version |
IUrlPersistentCache | persistentCache | persistent Cache |
string | proxyUrl | proxy url |
ICredentials | credentials | credentials |
Returns
Type | Description |
---|---|
Task<WFSProvider> |
CreateAsync(string, string, string, WFSVersionEnum, IUrlPersistentCache?, string?, ICredentials?)
Use this Method for initializing this dataprovider with all necessary parameters to gather metadata from 'GetCapabilities' contract.
Declaration
public static Task<WFSProvider> CreateAsync(string getCapabilitiesUri, string nsPrefix, string featureType, WFSProvider.WFSVersionEnum wfsVersion, IUrlPersistentCache? persistentCache = null, string? proxyUrl = null, ICredentials? credentials = null)
Parameters
Type | Name | Description |
---|---|---|
string | getCapabilitiesUri | The URL for the 'GetCapabilities' request. |
string | nsPrefix | Use an empty string or 'null', if there is no prefix for the featuretype. |
string | featureType | The name of the feature type |
WFSProvider.WFSVersionEnum | wfsVersion | The desired WFS Server version. |
IUrlPersistentCache | persistentCache | persistent Cache Interface |
string | proxyUrl | proxy url |
ICredentials | credentials | credentials |
Returns
Type | Description |
---|---|
Task<WFSProvider> |
Dispose()
Declaration
public void Dispose()
ExecuteIntersectionQueryAsync(MRect?)
Returns all features whose WfsFeatureTypeInfo.BoundingBox intersects 'bbox'.
Declaration
public Task<IEnumerable<IFeature>> ExecuteIntersectionQueryAsync(MRect? bbox)
Parameters
Type | Name | Description |
---|---|---|
MRect | bbox |
Returns
Type | Description |
---|---|
Task<IEnumerable<IFeature>> | Features within the specified WfsFeatureTypeInfo.BoundingBox |
GetExtent()
MRect of data set
Declaration
public MRect? GetExtent()
Returns
Type | Description |
---|---|
MRect | BoundingBox |
GetFeaturesAsync(FetchInfo)
Gets the features within the specified FetchInfo."/>
Declaration
public Task<IEnumerable<IFeature>> GetFeaturesAsync(FetchInfo fetchInfo)
Parameters
Type | Name | Description |
---|---|---|
FetchInfo | fetchInfo |
Returns
Type | Description |
---|---|
Task<IEnumerable<IFeature>> |
InitAsync()
Init Async
Declaration
public Task InitAsync()
Returns
Type | Description |
---|---|
Task |