@Test @Ignore("Requires HTTP connection to a WFS server serving specific FeatureType") public void testGeoServerWFSWorks() throws MismatchedDimensionException, FactoryException, TransformException, ServiceException, IOException, JSONException { String endPoint = "http: RegionSet kunnatWFS = new RegionSet(); kunnatWFS.setId(-1); kunnatWFS.setName("oskari:kunnat2013"); kunnatWFS.setSrs_name("EPSG:3067"); kunnatWFS.setAttributes(getAttributes("kuntakoodi", "kuntanimi", endPoint)); List<Region> regions = RegionSetHelper.getRegions(kunnatWFS, "EPSG:3067"); assertEquals(320, regions.size()); for (Region region : regions) { if ("082".equals(region.getCode())) { assertEquals("Hattula", region.getName()); } else if ("091".equals(region.getCode())) { assertEquals("Helsinki", region.getName()); } } }
public static List<Region> getRegions(RegionSet regionset, String requestedSRS) throws FactoryException, MismatchedDimensionException, TransformException, ServiceException, IOException { SimpleFeatureCollection fc = getFeatureCollection(regionset, requestedSRS); final String propId = regionset.getIdProperty(); final String propName = regionset.getNameProperty(); return parse(fc, propId, propName); }
RegionSetHelper { public static List<Region> getRegions(RegionSet regionset, String requestedSRS) throws FactoryException, MismatchedDimensionException, TransformException, ServiceException, IOException { SimpleFeatureCollection fc = getFeatureCollection(regionset, requestedSRS); final String propId = regionset.getIdProperty(); final String propName = regionset.getNameProperty(); return parse(fc, propId, propName); } }
RegionSetHelper { public static List<Region> getRegions(RegionSet regionset, String requestedSRS) throws FactoryException, MismatchedDimensionException, TransformException, ServiceException, IOException { SimpleFeatureCollection fc = getFeatureCollection(regionset, requestedSRS); final String propId = regionset.getIdProperty(); final String propName = regionset.getNameProperty(); return parse(fc, propId, propName); }  }
RegionSetHelper { public static List<Region> getRegions(RegionSet regionset, String requestedSRS) throws FactoryException, MismatchedDimensionException, TransformException, ServiceException, IOException { SimpleFeatureCollection fc = getFeatureCollection(regionset, requestedSRS); final String propId = regionset.getIdProperty(); final String propName = regionset.getNameProperty(); return parse(fc, propId, propName); }  static List<Region> getRegions(RegionSet regionset, String requestedSRS); }
RegionSetHelper { public static List<Region> getRegions(RegionSet regionset, String requestedSRS) throws FactoryException, MismatchedDimensionException, TransformException, ServiceException, IOException { SimpleFeatureCollection fc = getFeatureCollection(regionset, requestedSRS); final String propId = regionset.getIdProperty(); final String propName = regionset.getNameProperty(); return parse(fc, propId, propName); }  static List<Region> getRegions(RegionSet regionset, String requestedSRS);  }