use of eu.esdihumboldt.hale.common.instance.model.Instance in project hale by halestudio.
the class SurfaceGeometryTest method testSurfaceGml3.
/**
* Test surface geometries read from a GML 3 file
*
* @throws Exception if an error occurs
*/
@Test
public void testSurfaceGml3() throws Exception {
InstanceCollection instances = AbstractHandlerTest.loadXMLInstances(getClass().getResource("/data/gml/geom-gml3.xsd").toURI(), getClass().getResource("/data/surface/sample-surface-gml3.xml").toURI());
// one instance expected
ResourceIterator<Instance> it = instances.iterator();
try {
// PolygonPatch with LinearRings defined through coordinates
assertTrue("First sample feature missing", it.hasNext());
Instance instance = it.next();
checkSingleGeometry(instance, checker);
} finally {
it.close();
}
}
use of eu.esdihumboldt.hale.common.instance.model.Instance in project hale by halestudio.
the class SurfaceGeometryTest method testSurfaceGml32_patches.
/**
* Test surface geometry consisting of multiple patches read from a GML 3.2
* file.
*
* @throws Exception if an error occurs
*/
@Test
public void testSurfaceGml32_patches() throws Exception {
InstanceCollection instances = AbstractHandlerTest.loadXMLInstances(getClass().getResource("/data/gml/geom-gml32.xsd").toURI(), getClass().getResource("/data/surface/sample-surface-gml32_patches.xml").toURI());
LinearRing shell = geomFactory.createLinearRing(new Coordinate[] { new Coordinate(-4.5, 3), new Coordinate(0.5, 4.5), new Coordinate(5, 3), new Coordinate(8.5, 2), new Coordinate(3, -4.5), new Coordinate(1, 1), new Coordinate(-3, -1), new Coordinate(-4.5, 3) });
Polygon composedPolygon = geomFactory.createPolygon(shell);
// one instance expected
ResourceIterator<Instance> it = instances.iterator();
try {
// PolygonPatch with LinearRings defined through coordinates
assertTrue("First sample feature missing", it.hasNext());
Instance instance = it.next();
checkSingleGeometry(instance, referenceChecker(composedPolygon));
} finally {
it.close();
}
}
use of eu.esdihumboldt.hale.common.instance.model.Instance in project hale by halestudio.
the class SurfaceGeometryTest method testSurfaceGml32_Grid.
/**
* Test surface geometries read from a GML 3.2 file. Geometry coordinates
* will be moved to the universal grid
*
* @throws Exception if an error occurs
*/
@Test
public void testSurfaceGml32_Grid() throws Exception {
InstanceCollection instances = AbstractHandlerTest.loadXMLInstances(getClass().getResource("/data/gml/geom-gml32.xsd").toURI(), getClass().getResource("/data/surface/sample-surface-gml32.xml").toURI(), gridConfig);
// one instance expected
ResourceIterator<Instance> it = instances.iterator();
try {
// PolygonPatch with LinearRings defined through coordinates
assertTrue("First sample feature missing", it.hasNext());
Instance instance = it.next();
checkSingleGeometry(instance, gridChecker);
} finally {
it.close();
}
}
use of eu.esdihumboldt.hale.common.instance.model.Instance in project hale by halestudio.
the class SurfaceGeometryTest method testSurfaceGml3_Grid.
/**
* Test surface geometries read from a GML 3 file. Geometry coordinates will
* be moved to the universal grid
*
* @throws Exception if an error occurs
*/
@Test
public void testSurfaceGml3_Grid() throws Exception {
InstanceCollection instances = AbstractHandlerTest.loadXMLInstances(getClass().getResource("/data/gml/geom-gml3.xsd").toURI(), getClass().getResource("/data/surface/sample-surface-gml3.xml").toURI(), gridConfig);
// one instance expected
ResourceIterator<Instance> it = instances.iterator();
try {
// PolygonPatch with LinearRings defined through coordinates
assertTrue("First sample feature missing", it.hasNext());
Instance instance = it.next();
checkSingleGeometry(instance, gridChecker);
} finally {
it.close();
}
}
use of eu.esdihumboldt.hale.common.instance.model.Instance in project hale by halestudio.
the class SurfaceGeometryTest method testSurfaceGml32.
/**
* Test surface geometries read from a GML 3.2 file
*
* @throws Exception if an error occurs
*/
@Test
public void testSurfaceGml32() throws Exception {
InstanceCollection instances = AbstractHandlerTest.loadXMLInstances(getClass().getResource("/data/gml/geom-gml32.xsd").toURI(), getClass().getResource("/data/surface/sample-surface-gml32.xml").toURI());
// one instance expected
ResourceIterator<Instance> it = instances.iterator();
try {
// PolygonPatch with LinearRings defined through coordinates
assertTrue("First sample feature missing", it.hasNext());
Instance instance = it.next();
checkSingleGeometry(instance, checker);
} finally {
it.close();
}
}
Aggregations