// override the describe feature type url so it loads from the test resource
URL describeUrl = TestData.getResource(this, "axisorder/DescribeFeatureType.xsd");
wfs.setDescribeFeatureTypeURLOverride(describeUrl);
WFSDataStore ds = new WFSDataStore(wfs);
// axis order used will be EAST / NORTH
wfs.setAxisOrderOverride(WFSDataStoreFactory.AXIS_ORDER_COMPLIANT, WFSDataStoreFactory.AXIS_ORDER_COMPLIANT);
FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
Set<FeatureId> fids = new HashSet<FeatureId>();
fids.add(new FeatureIdImpl("comuni11.2671"));
Query query = new Query(typeName, ff.id(fids));
SimpleFeatureSource source = ds.getFeatureSource(typeName);
SimpleFeature feature = iterate(source.getFeatures(query), 1, true);
Geometry geometry = (Geometry) feature.getDefaultGeometry();
double x = geometry.getCoordinate().x;
double y = geometry.getCoordinate().y;
assertEquals(4629462.0, x, 0);
assertEquals(819841.0, y, 0);
// specify axis order: results should be inverted
wfs.setAxisOrderOverride(WFSDataStoreFactory.AXIS_ORDER_EAST_NORTH, WFSDataStoreFactory.AXIS_ORDER_COMPLIANT);
source = ds.getFeatureSource(typeName);
feature = iterate(source.getFeatures(query), 1, true);
geometry = (Geometry) feature.getDefaultGeometry();
x = geometry.getCoordinate().x;
y = geometry.getCoordinate().y;
assertEquals(4629462.0, x, 0);