public void GetWfsFeaturesWithBoundingBox() { WfsTypeName typeName = new WfsTypeName(); WFSVersion version = WFSVersion.Ver110; string serverUrl = "http://slwgeo.artdata.slu.se:8080/geoserver/wfs"; string parameter = string.Empty; string parameterValue = string.Empty; string bbox = "6400000,1400000, 6500000,1500000"; typeName.Namespace = "SLW:Sverigekarta_med_lan"; string srsName = string.Empty; FeatureCollection featureCollection; featureCollection = WFSManager.GetWfsFeatures(serverUrl, version, bbox, typeName, srsName, parameter, parameterValue); Assert.IsNotNull(featureCollection); Assert.IsTrue(featureCollection.Features.Count == 5); }
public void GetWfsFeatures() { WfsTypeName typeName = new WfsTypeName(); WFSVersion version = WFSVersion.Ver110; string serverUrl = "http://slwgeo.artdata.slu.se:8080/geoserver/SLW/wfs"; string parameter = string.Empty; string parameterValue = string.Empty; string bbox = string.Empty;//&BBOX=133499, 628499, 154501, 635501;//&BBOX=628499,133499,635501,154501"; typeName.Namespace = "SLW:Sverigekarta_med_lan"; string srsName = string.Empty; FeatureCollection featureCollection; featureCollection = WFSManager.GetWfsFeatures(serverUrl, version, bbox, typeName, srsName, parameter, parameterValue); Assert.IsNotNull(featureCollection); Assert.IsTrue(featureCollection.Features.Count == 22); }
public void GetWfsFeaturesWithFilter() { WfsTypeName typeName = new WfsTypeName(); WFSVersion version = WFSVersion.Ver110; string serverUrl = "http://slwgeo.artdata.slu.se:8080/geoserver/wfs"; string bbox = string.Empty; string parameter = "SLW:LänSKOD"; string parameterValue = "17"; //Todo: vilken är det:? typeName.Namespace = "SLW:Sverigekarta_med_lan"; //typeName.Name = "SLW:Sverigekarta_med_lan"; string srsName = string.Empty; FeatureCollection featureCollection; featureCollection = WFSManager.GetWfsFeatures(serverUrl, version, bbox, typeName, srsName, parameter, parameterValue); Assert.IsNotNull(featureCollection); Assert.IsTrue(featureCollection.Features.Count == 1); }
public void GetWfsFeaturesWithBoundingBoxUsingMsFakes() { using (ShimsContext.Create()) { ShimWebClient.AllInstances.DownloadStringString = (client, url) => File.ReadAllText(@"Sample files\SLW_Sverigekarta_med_lan - BBox Filter.json"); WfsTypeName typeName = new WfsTypeName(); WFSVersion version = WFSVersion.Ver110; string serverUrl = "http://slwgeo.artdata.slu.se:8080/geoserver/wfs"; string parameter = string.Empty; string parameterValue = string.Empty; string bbox = "6400000,1400000, 6500000,1500000"; typeName.Namespace = "SLW:Sverigekarta_med_lan"; string srsName = string.Empty; FeatureCollection featureCollection; featureCollection = WFSManager.GetWfsFeatures(serverUrl, version, bbox, typeName, srsName, parameter, parameterValue); Assert.IsNotNull(featureCollection); Assert.AreEqual(5, featureCollection.Features.Count); } }
public void GetWfsFeaturesUsingMsFakes() { using (ShimsContext.Create()) { ShimWebClient.AllInstances.DownloadStringString = (client, url) => File.ReadAllText(@"Sample files\SLW_Sverigekarta_med_lan - All Features.json"); WfsTypeName typeName = new WfsTypeName(); WFSVersion version = WFSVersion.Ver110; string serverUrl = "http://slwgeo.artdata.slu.se:8080/geoserver/SLW/wfs"; string parameter = string.Empty; string parameterValue = string.Empty; string bbox = string.Empty; // &BBOX=133499, 628499, 154501, 635501;//&BBOX=628499,133499,635501,154501"; typeName.Namespace = "SLW:Sverigekarta_med_lan"; string srsName = string.Empty; FeatureCollection featureCollection; featureCollection = WFSManager.GetWfsFeatures(serverUrl, version, bbox, typeName, srsName, parameter, parameterValue); Assert.IsNotNull(featureCollection); Assert.IsTrue(featureCollection.Features.Count == 22); } }