use of eu.esdihumboldt.hale.common.instance.model.InstanceCollection in project hale by halestudio.
the class LinearRingHandlerTest method testLinearRingGml31.
/**
* Test linear ring geometries read from a GML 3.1 file
*
* @throws Exception if an error occurs
*/
@Test
public void testLinearRingGml31() throws Exception {
InstanceCollection instances = AbstractHandlerTest.loadXMLInstances(getClass().getResource("/data/gml/geom-gml31.xsd").toURI(), getClass().getResource("/data/linearring/sample-linearring-gml31.xml").toURI());
// six instances expected
ResourceIterator<Instance> it = instances.iterator();
try {
// 1. LinearRingProperty with LinearRing defined through coordinates
assertTrue("First sample feature missing", it.hasNext());
Instance instance = it.next();
checkSingleGeometry(instance, checker);
// 2. LinearRingProperty with LinearRing defined through coord
assertTrue("Second sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, checker);
// 3. LinearRingProperty with LinearRing defined through pointRep
assertTrue("Third sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, checker);
// 4. LinearRingProperty with LinearRing defined through pos
assertTrue("Fourth sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, checker);
// 5. LinearRingProperty with LinearRing defined through
// pointProperty
assertTrue("Fifth sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, checker);
// 6. LinearRingProperty with LinearRing 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 PointHandlerTest method testPointGml3.
/**
* Test point geometries read from a GML 3 file.
*
* @throws Exception if an error occurs
*/
@Test
public void testPointGml3() throws Exception {
InstanceCollection instances = loadXMLInstances(getClass().getResource("/data/gml/geom-gml3.xsd").toURI(), getClass().getResource("/data/point/sample-point-gml3.xml").toURI());
Consumer<Geometry> checker = referenceChecker(reference);
// three instances expected
ResourceIterator<Instance> it = instances.iterator();
try {
// 1. PointProperty with Point defined through coordinates
assertTrue("First sample feature missing", it.hasNext());
Instance instance = it.next();
checkSingleGeometry(instance, checker);
// 2. PointProperty with Point defined through coord
assertTrue("Second sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, checker);
// 3. GeometryProperty with Point defined through coord
assertTrue("Third sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, checker);
// 4. PointProperty with Point defined through pos
assertTrue("Fourth sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, checker);
// 5. GeometryProperty with Point defined through pos
assertTrue("Fifth 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 PointHandlerTest method testPointGml31.
/**
* Test point geometries read from a GML 3.1 file.
*
* @throws Exception if an error occurs
*/
@Test
public void testPointGml31() throws Exception {
InstanceCollection instances = loadXMLInstances(getClass().getResource("/data/gml/geom-gml31.xsd").toURI(), getClass().getResource("/data/point/sample-point-gml31.xml").toURI());
Consumer<Geometry> checker = referenceChecker(reference);
// three instances expected
ResourceIterator<Instance> it = instances.iterator();
try {
// 1. PointProperty with Point defined through coordinates
assertTrue("First sample feature missing", it.hasNext());
Instance instance = it.next();
checkSingleGeometry(instance, checker);
// 2. PointProperty with Point defined through coord
assertTrue("Second sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, checker);
// 3. GeometryProperty with Point defined through coord
assertTrue("Third sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, checker);
// 4. PointProperty with Point defined through pos
assertTrue("Fourth sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, checker);
// 5. GeometryProperty with Point defined through pos
assertTrue("Fifth 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 PointHandlerTest method testPointGml32.
/**
* Test point geometries read from a GML 3.2 file.
*
* @throws Exception if an error occurs
*/
@Test
public void testPointGml32() throws Exception {
InstanceCollection instances = loadXMLInstances(getClass().getResource("/data/gml/geom-gml32.xsd").toURI(), getClass().getResource("/data/point/sample-point-gml32.xml").toURI());
Consumer<Geometry> checker = referenceChecker(reference);
// three instances expected
ResourceIterator<Instance> it = instances.iterator();
try {
// 1. PointProperty with Point defined through coordinates
assertTrue("First sample feature missing", it.hasNext());
Instance instance = it.next();
checkSingleGeometry(instance, checker);
// 2. GeometryProperty with Point defined through coordinates
assertTrue("Second sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, checker);
// 3. PointProperty with Point defined through pos
assertTrue("Third sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, checker);
// 4. GeometryProperty with Point defined through pos
assertTrue("Fourth 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 PointHandlerTest method testPointGml2.
/**
* Test point geometries read from a GML 2 file.
*
* @throws Exception if an error occurs
*/
@Test
public void testPointGml2() throws Exception {
InstanceCollection instances = AbstractHandlerTest.loadXMLInstances(getClass().getResource("/data/gml/geom-gml2.xsd").toURI(), getClass().getResource("/data/point/sample-point-gml2.xml").toURI());
Consumer<Geometry> checker = referenceChecker(reference);
// three instances expected
ResourceIterator<Instance> it = instances.iterator();
try {
// 1. PointProperty with Point defined through coordinates
assertTrue("First sample feature missing", it.hasNext());
Instance instance = it.next();
checkSingleGeometry(instance, checker);
// 2. PointProperty with Point defined through coord
assertTrue("Second sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, checker);
// 3. GeometryProperty with Point defined through coordinates
assertTrue("Third sample feature missing", it.hasNext());
instance = it.next();
checkSingleGeometry(instance, checker);
} finally {
it.close();
}
}
Aggregations