GeoServer WFS Feature request

Topics: SharpMap Project, SharpMap v0.9 / v1.x, SharpMap v2.0
Aug 22, 2015 at 4:35 PM
Hi, could somebody assist me with the following problem please. I'm struggling to successfully execute a WFS feature query on the GeoServer sample data using WfsFeatureTypeInfo. I'd prefer not to have to perform an ExecuteIntersectionQuery() call as i'm trying to return all data regardless of the spatial intersection, but haven't found a way to do that.

As a test I simply want to return all topp:states STATE_NAME strings, however my query just doesn't seem to execute. All help would be much appreciated. Here's the code i've tried:

WfsFeatureTypeInfo featureTypeInfo = new WfsFeatureTypeInfo(
                                                            "http://localhost:8080/geoserver/wfs",
                                                            "topp",
                                                            null,
                                                            "states",
                                                            "STATE_NAME"
                                                            );
WFS prov = new WFS(featureTypeInfo, WFS.WFSVersionEnum.WFS1_0_0);
prov.QuickGeometries = true;
prov.Label = "STATE_NAME";
prov.Open();

SharpMap.Data.FeatureDataSet fDS = new SharpMap.Data.FeatureDataSet();
prov.ExecuteIntersectionQuery(
   provLinks.GetExtents(),
   fDS
 );
Aug 23, 2015 at 11:19 AM
If anyone's interested i've implemented a solution to this. Downloaded the CodePlex source-code and stepped through the WFSClient code. Had to fix the WFS 1.0.0 GetFeatureByOid uri's, should have been GetFeature. Anyway, determined the existing WFSClient query methods are really meant to be used with a layer. It was easy to extend the WFSClient class with a method which performs an on demand WFS query returning table data without using extents/bounds, was just a reworking of the label layer query code.
Developer
Aug 25, 2015 at 10:49 AM
Get this changeset: https://sharpmap.codeplex.com/SourceControl/changeset/107750

then try this code:
prov.UseCache = true;
prov.LabelColumn = "STATE_NAME";
[...]
Setting the UseCache property forces the provider to download all the geometries from server regardless the bounding box given to the ExecuteIntersectionQuery.
Marked as answer by jduncalf on 8/25/2015 at 6:10 AM
Aug 25, 2015 at 11:18 AM
Excellent, will try that, thanks.

Do you know how the trunk source on CodePlex relates to the NuGet SharpMap binaries? by which I mean the NuGet 1.1.0 - 11/02/2014 published binaries don't seem the same as the trunk source code, at least because of the GetFeatureOid change I made to my source which however works as-is with the NuGet binaries. The 1.1 branch in CodePlex looks to be labelled as experimental.

Thanks.
Coordinator
Aug 25, 2015 at 1:12 PM
The NuGet binaries were created from /Branches/1.0
You can find the code at that time if you use /Tags/v1.1

Trunk is not evolving due to lack of time ...
Marked as answer by jduncalf on 8/25/2015 at 6:10 AM
Aug 25, 2015 at 2:10 PM
Thanks. I was worried that by building my own binaries I wouldn't end up with functionality as good as that already present in the released NuGet binaries. Thanks again.