use of eu.esdihumboldt.hale.common.instance.model.InstanceCollection in project hale by halestudio.
the class EnvelopeHandlerTest method testEnvelopeGml3_Grid.
/**
* Test envelope geometries read from a GML 3 file
*
* @throws Exception if an error occurs
*/
@Test
public void testEnvelopeGml3_Grid() throws Exception {
ReaderConfiguration config = InterpolationConfigurations.ALL_TO_GRID_DEFAULT;
InstanceCollection instances = AbstractHandlerTest.loadXMLInstances(getClass().getResource("/data/gml/geom-gml3.xsd").toURI(), getClass().getResource("/data/envelope/sample-envelope-gml3.xml").toURI(), config);
// one instances expected
ResourceIterator<Instance> it = instances.iterator();
try {
// 1. EnvelopeProperty defined through pos
assertTrue("First sample feature missing", it.hasNext());
Instance instance = it.next();
checkSingleGeometry(instance, combine(referenceChecker(reference, InterpolationHelper.DEFAULT_MAX_POSITION_ERROR), config.geometryChecker()));
} finally {
it.close();
}
}
use of eu.esdihumboldt.hale.common.instance.model.InstanceCollection in project hale by halestudio.
the class EnvelopeHandlerTest method testEnvelopeGml3.
/**
* Test envelope geometries read from a GML 3 file
*
* @throws Exception if an error occurs
*/
@Test
public void testEnvelopeGml3() throws Exception {
InstanceCollection instances = AbstractHandlerTest.loadXMLInstances(getClass().getResource("/data/gml/geom-gml3.xsd").toURI(), getClass().getResource("/data/envelope/sample-envelope-gml3.xml").toURI());
// one instances expected
ResourceIterator<Instance> it = instances.iterator();
try {
// 1. EnvelopeProperty defined through pos
assertTrue("First sample feature missing", it.hasNext());
Instance instance = it.next();
checkSingleGeometry(instance, referenceChecker(reference));
} finally {
it.close();
}
}
use of eu.esdihumboldt.hale.common.instance.model.InstanceCollection in project hale by halestudio.
the class LineStringHandlerTest method testLineStringGml31.
/**
* Test linestring geometries read from a GML 3.1 file
*
* @throws Exception if an error occurs
*/
@Test
public void testLineStringGml31() throws Exception {
InstanceCollection instances = AbstractHandlerTest.loadXMLInstances(getClass().getResource("/data/gml/geom-gml31.xsd").toURI(), getClass().getResource("/data/linestring/sample-linestring-gml31.xml").toURI());
// five instances expected
ResourceIterator<Instance> it = instances.iterator();
try {
// 1. LineStringProperty with LineString defined through coordinates
assertTrue("First sample feature missing", it.hasNext());
Instance instance = it.next();
checkSingleGeometry(instance, checker);
// 2. LineStringProperty with LineString defined through coord
assertTrue("Second sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, checker);
// 3. LineStringProperty with LineString defined through pos
assertTrue("Third sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, checker);
// 4. LineStringProperty with LineString defined through pointRep
assertTrue("Fourth sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, checker);
// 5. LineStringProperty with LineString defined through
// pointProperty
assertTrue("Fifth sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, checker);
// 6. LineStringProperty with LineString defined through posList
assertTrue("Sixth sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, checker);
} finally {
it.close();
}
}
use of eu.esdihumboldt.hale.common.instance.model.InstanceCollection in project hale by halestudio.
the class LineStringHandlerTest method testLineStringGml3_Grid.
/**
* Test linestring geometries read from a GML 3 file
*
* @throws Exception if an error occurs
*/
@Test
public void testLineStringGml3_Grid() throws Exception {
InstanceCollection instances = AbstractHandlerTest.loadXMLInstances(getClass().getResource("/data/gml/geom-gml3.xsd").toURI(), getClass().getResource("/data/linestring/sample-linestring-gml3.xml").toURI(), gridConfig);
// five instances expected
ResourceIterator<Instance> it = instances.iterator();
try {
// 1. LineStringProperty with LineString defined through coordinates
assertTrue("First sample feature missing", it.hasNext());
Instance instance = it.next();
checkSingleGeometry(instance, gridChecker);
// 2. LineStringProperty with LineString defined through coord
assertTrue("Second sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, gridChecker);
// 3. GeometryProperty with LineString defined through coord
assertTrue("Third sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, gridChecker);
// 4. LineStringProperty with LineString defined through pos
assertTrue("Fourth sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, gridChecker);
// 5. LineStringProperty with LineString defined through pointRep
assertTrue("Fifth sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, gridChecker);
} finally {
it.close();
}
}
use of eu.esdihumboldt.hale.common.instance.model.InstanceCollection in project hale by halestudio.
the class LineStringHandlerTest method testLineStringGml32_Grid.
/**
* Test linestring geometries read from a GML 3.2 file
*
* @throws Exception if an error occurs
*/
@Test
public void testLineStringGml32_Grid() throws Exception {
InstanceCollection instances = AbstractHandlerTest.loadXMLInstances(getClass().getResource("/data/gml/geom-gml32.xsd").toURI(), getClass().getResource("/data/linestring/sample-linestring-gml32.xml").toURI(), gridConfig);
// five instances expected
ResourceIterator<Instance> it = instances.iterator();
try {
// 1. LineStringProperty with LineString defined through coordinates
assertTrue("First sample feature missing", it.hasNext());
Instance instance = it.next();
checkSingleGeometry(instance, gridChecker);
// 2. LineStringProperty with LineString defined through pos
assertTrue("Second sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, gridChecker);
// 3. LineStringProperty with LineString defined through pointRep
assertTrue("Third sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, gridChecker);
// 4. LineStringProperty with LineString defined through
// pointProperty
assertTrue("Fourth sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, gridChecker);
// 5. LineStringProperty with LineString defined through posList
assertTrue("Fifth sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, gridChecker);
} finally {
it.close();
}
}
Aggregations