use of eu.esdihumboldt.hale.common.instance.model.Instance in project hale by halestudio.
the class CompositeCurveGeometryTest method testCompositeCurveGml32.
/**
* Test composite curve geometries read from a GML 3.2 file
*
* @throws Exception if an error occurs
*/
@Test
public void testCompositeCurveGml32() throws Exception {
InstanceCollection instances = AbstractHandlerTest.loadXMLInstances(getClass().getResource("/data/gml/geom-gml32.xsd").toURI(), getClass().getResource("/data/curve/sample-compositecurve-gml32.xml").toURI());
// one instances expected
ResourceIterator<Instance> it = instances.iterator();
try {
// segments with LineStringSegment 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 CompositeCurveGeometryTest method testCompositeCurveGml32_Grid.
/**
* Test composite curve geometries read from a GML 3.2 file. Geometry
* coordinates will be moved to universal grid
*
* @throws Exception if an error occurs
*/
@Test
public void testCompositeCurveGml32_Grid() throws Exception {
InstanceCollection instances = AbstractHandlerTest.loadXMLInstances(getClass().getResource("/data/gml/geom-gml32.xsd").toURI(), getClass().getResource("/data/curve/sample-compositecurve-gml32.xml").toURI(), gridConfig);
// one instances expected
ResourceIterator<Instance> it = instances.iterator();
try {
// segments with LineStringSegment 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 CompositeCurveGeometryTest method testCompositeCurveGml32_combined.
/**
* Test composite curve geometries read from a GML 3.2 file
*
* @throws Exception if an error occurs
*/
@Test
public void testCompositeCurveGml32_combined() throws Exception {
InstanceCollection instances = AbstractHandlerTest.loadXMLInstances(getClass().getResource("/data/gml/geom-gml32.xsd").toURI(), getClass().getResource("/data/curve/sample-compositecurve-gml32_combined.xml").toURI());
LineString combined = geomFactory.createLineString(new Coordinate[] { new Coordinate(0, 0), new Coordinate(1, 1), new Coordinate(2, 2), new Coordinate(3, 1), new Coordinate(4, 0), new Coordinate(5, -1), new Coordinate(6, 0), new Coordinate(7, 2), new Coordinate(8, 4) });
// one instances expected
ResourceIterator<Instance> it = instances.iterator();
try {
// segments with LineStringSegment defined through coordinates
assertTrue("First sample feature missing", it.hasNext());
Instance instance = it.next();
checkSingleGeometry(instance, referenceChecker(combined));
} finally {
it.close();
}
}
use of eu.esdihumboldt.hale.common.instance.model.Instance in project hale by halestudio.
the class CompositeSurfaceGeometryTest method testCompositeSurfaceGml31_Grid.
/**
* Test composite surface geometries read from a GML 3.2 file Geometry
* coordinates will be moved to universal grid
*
* @throws Exception if an error occurs
*/
@Test
@Ignore("Test case does not represent a valid composite surface")
public void testCompositeSurfaceGml31_Grid() throws Exception {
InstanceCollection instances = AbstractHandlerTest.loadXMLInstances(getClass().getResource("/data/gml/geom-gml32.xsd").toURI(), getClass().getResource("/data/surface/sample-compositesurface-gml32.xml").toURI(), gridConfig);
// one instance expected
ResourceIterator<Instance> it = instances.iterator();
try {
// CompositeCurveProperty with surfaceMembers defined through
// PolygonPatch and Polygon
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 CurveGeometryTest method testCurveGml32.
/**
* Test curve geometries read from a GML 3.2 file
*
* @throws Exception if an error occurs
*/
@Test
public void testCurveGml32() throws Exception {
InstanceCollection instances = AbstractHandlerTest.loadXMLInstances(getClass().getResource("/data/gml/geom-gml32.xsd").toURI(), getClass().getResource("/data/curve/sample-curve-gml32.xml").toURI());
// twelve instances expected
ResourceIterator<Instance> it = instances.iterator();
try {
// 1. segments with LineStringSegment defined through coordinates
assertTrue("First sample feature missing", it.hasNext());
Instance instance = it.next();
checkSingleGeometry(instance, lineStringChecker);
// 2. segments with LineStringSegment defined through posList
assertTrue("Second sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, lineStringChecker);
// 3. segments with Arc defined through coordinates
assertTrue("Third sample feature missing", it.hasNext());
instance = it.next();
// Arc handler added
checkSingleGeometry(instance, arcChecker(arcByPoints, maxPositionalError));
// 4. segments with ArcByBulge defined through coordinates
assertTrue("Fourth sample feature missing", it.hasNext());
instance = it.next();
// FIXME this is not an accurate representation
checkSingleGeometry(instance, lineStringChecker);
// 5. segments with ArcByCenterPoint defined through coordinates
assertTrue("Fifth sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, arcChecker(arcByCenter, maxPositionalError));
// 6. segments with ArcString defined through coordinates
assertTrue("Sixth sample feature missing", it.hasNext());
instance = it.next();
// TODO more extensive check?
checkSingleGeometry(instance, noCoordinatePairs());
// 7. segments with ArcStringByBulge defined through coordinates
assertTrue("Seventh sample feature missing", it.hasNext());
instance = it.next();
// FIXME this is not an accurate representation
checkSingleGeometry(instance, lineStringChecker);
// 8. segments with Bezier defined through coordinates
assertTrue("Eigth sample feature missing", it.hasNext());
instance = it.next();
// FIXME this is not an accurate representation
checkSingleGeometry(instance, lineStringChecker);
// 9. segments with BSpline defined through coordinates
assertTrue("Nineth sample feature missing", it.hasNext());
instance = it.next();
// FIXME this is not an accurate representation
checkSingleGeometry(instance, lineStringChecker);
// 10. segments with Circle defined through coordinates
assertTrue("Tenth sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, arcChecker(circleByPoints, maxPositionalError));
// 11. segments with CircleByCenterPoint defined through coordinates
assertTrue("Eleventh sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, arcChecker(circleByCenter, maxPositionalError));
// 12. segments with CubicSpline defined through coordinates
assertTrue("Twelveth sample feature missing", it.hasNext());
instance = it.next();
// FIXME this is not an accurate representation
checkSingleGeometry(instance, lineStringChecker);
// 13. segments with Geodesic defined through posList
assertTrue("Thirteenth sample feature missing", it.hasNext());
instance = it.next();
// FIXME this is not an accurate representation
checkSingleGeometry(instance, lineStringChecker);
// 14. segments with GeodesicString defined through posList
assertTrue("Fourteenth sample feature missing", it.hasNext());
instance = it.next();
// FIXME this is not an accurate representation
checkSingleGeometry(instance, lineStringChecker);
} finally {
it.close();
}
}
Aggregations