public void TestRegionGeometry() { // Test geometry for all regions in database. List <Int32> regionIds; List <WebRegion> regions; List <WebRegionCategory> regionCategories, categories; List <WebRegionGeography> regionsGeography; WebCoordinateSystem coordinateSystem; coordinateSystem = new WebCoordinateSystem(); coordinateSystem.Id = CoordinateSystemId.GoogleMercator; regionCategories = RegionManager.GetRegionCategories(GetContext(), false, 0); foreach (WebRegionCategory regionCategory in regionCategories) { categories = new List <WebRegionCategory>(); categories.Add(regionCategory); regions = RegionManager.GetRegionsByCategories(GetContext(), categories); if (regions.IsNotEmpty()) { regionIds = new List <Int32>(); foreach (WebRegion region in regions) { regionIds.Add(region.Id); } regionsGeography = RegionManager.GetRegionsGeographyByIds(GetContext(), regionIds, coordinateSystem); Assert.IsTrue(regionsGeography.IsNotEmpty()); Assert.AreEqual(regions.Count, regionsGeography.Count); } } }
public void GetRegionsGeographyByIdsAccessRightsError() { List <Int32> regionIds; List <WebRegionGeography> regionsGeography; WebCoordinateSystem coordinateSystem; coordinateSystem = new WebCoordinateSystem(); coordinateSystem.Id = CoordinateSystemId.GoogleMercator; regionIds = new List <Int32>(); regionIds.Add(1); regionsGeography = RegionManager.GetRegionsGeographyByIds(GetContext(ApplicationIdentifier.UserAdmin), regionIds, coordinateSystem); Assert.IsTrue(regionsGeography.IsNotEmpty()); }
public void GetRegionsGeographyByIds() { List <Int32> regionIds; List <String> regionGuids; List <WebRegionGeography> regionsGeography; WebCoordinateSystem coordinateSystem; regionGuids = new List <String>(); regionGuids.Add("URN:LSID:artportalen.se:area:DataSet16Feature1"); regionGuids.Add("URN:LSID:artportalen.se:area:DataSet16Feature2"); coordinateSystem = new WebCoordinateSystem(); coordinateSystem.Id = CoordinateSystemId.GoogleMercator; regionsGeography = RegionManager.GetRegionsGeographyByGuids(GetContext(ApplicationIdentifier.ArtDatabankenSOA), regionGuids, coordinateSystem); Assert.IsTrue(regionsGeography.IsNotEmpty()); Assert.AreEqual(regionGuids.Count, regionsGeography.Count); regionIds = new List <Int32>(); foreach (WebRegionGeography webRegionGeography in regionsGeography) { regionIds.Add(webRegionGeography.Id); } regionsGeography = RegionManager.GetRegionsGeographyByIds(GetContext(ApplicationIdentifier.ArtDatabankenSOA), regionIds, coordinateSystem); Assert.IsTrue(regionsGeography.IsNotEmpty()); Assert.AreEqual(regionIds.Count, regionsGeography.Count); }