Search in sources :

Example 16 with IOReport

use of eu.esdihumboldt.hale.common.core.io.report.IOReport in project hale by halestudio.

the class StreamGmlWriterTest method testGeometryPrimitive_32_MultiLineString_Curve2.

/**
 * Test writing a {@link MultiLineString} to a GML 3.2 geometry primitive
 * type
 *
 * @throws Exception if an error occurs
 */
@Test
public void testGeometryPrimitive_32_MultiLineString_Curve2() throws Exception {
    // create the geometry
    MultiLineString mls = createCurve();
    Map<List<QName>, Object> values = new HashMap<List<QName>, Object>();
    // $NON-NLS-1$
    values.put(GEOMETRY_PROPERTY, mls);
    IOReport report = fillFeatureTest(// $NON-NLS-1$
    "PrimitiveTest", // $NON-NLS-1$
    getClass().getResource("/data/geom_schema/geom-gml32.xsd").toURI(), // $NON-NLS-1$
    values, // $NON-NLS-1$
    "geometryPrimitive_32_MultiLineString", // $NON-NLS-1$
    DEF_SRS_NAME, true, false);
    // $NON-NLS-1$
    assertTrue("Expected GML output to be valid", report.isSuccess());
}
Also used : MultiLineString(com.vividsolutions.jts.geom.MultiLineString) HashMap(java.util.HashMap) QName(javax.xml.namespace.QName) IOReport(eu.esdihumboldt.hale.common.core.io.report.IOReport) List(java.util.List) Test(org.junit.Test)

Example 17 with IOReport

use of eu.esdihumboldt.hale.common.core.io.report.IOReport in project hale by halestudio.

the class StreamGmlWriterTest method testGeometryAggregate_32_MultiPolygon.

/**
 * Test writing a {@link MultiPolygon} to a GML 3.2 geometry aggregate type
 *
 * @throws Exception if an error occurs
 */
@Test
public void testGeometryAggregate_32_MultiPolygon() throws Exception {
    // create the geometry
    MultiPolygon mp = geomFactory.createMultiPolygon(new Polygon[] { createPolygon(0.0), createPolygon(1.0), createPolygon(-1.0) });
    Map<List<QName>, Object> values = new HashMap<List<QName>, Object>();
    // $NON-NLS-1$
    values.put(GEOMETRY_PROPERTY, mp);
    IOReport report = fillFeatureTest(// $NON-NLS-1$
    "AggregateTest", // $NON-NLS-1$
    getClass().getResource("/data/geom_schema/geom-gml32.xsd").toURI(), // $NON-NLS-1$
    values, // $NON-NLS-1$
    "geometryAggregate_32_MultiPolygon", // $NON-NLS-1$
    DEF_SRS_NAME, true, false);
    // $NON-NLS-1$
    assertTrue("Expected GML output to be valid", report.isSuccess());
}
Also used : MultiPolygon(com.vividsolutions.jts.geom.MultiPolygon) HashMap(java.util.HashMap) QName(javax.xml.namespace.QName) IOReport(eu.esdihumboldt.hale.common.core.io.report.IOReport) List(java.util.List) Test(org.junit.Test)

Example 18 with IOReport

use of eu.esdihumboldt.hale.common.core.io.report.IOReport in project hale by halestudio.

the class StreamGmlWriterTest method testGeometryPrimitive_32_MultiPolygon_WindingOrder.

/**
 * Test writing a {@link MultiPolygon} to a GML 3.2 geometry primitive type
 * with Winding Order in ClockWise
 *
 * @throws Exception if an error occurs
 */
@Test
public void testGeometryPrimitive_32_MultiPolygon_WindingOrder() throws Exception {
    // create the geometry
    MultiPolygon mp = geomFactory.createMultiPolygon(new Polygon[] { createPolygon(0.0), createPolygon(1.0), createPolygon(-1.0) });
    Map<List<QName>, Object> values = new HashMap<List<QName>, Object>();
    // $NON-NLS-1$
    values.put(GEOMETRY_PROPERTY, mp);
    IOReport report = fillFeatureTest(// $NON-NLS-1$
    "AggregateTest", // $NON-NLS-1$
    getClass().getResource("/data/geom_schema/geom-gml32.xsd").toURI(), // $NON-NLS-1$
    values, // $NON-NLS-1$
    "geometryPrimitive_32_MultiPolygon", // $NON-NLS-1$
    DEF_SRS_NAME, false, false, EnumWindingOrderTypes.noChanges);
    // $NON-NLS-1$
    assertTrue("Expected GML output to be valid", report.isSuccess());
}
Also used : MultiPolygon(com.vividsolutions.jts.geom.MultiPolygon) HashMap(java.util.HashMap) QName(javax.xml.namespace.QName) IOReport(eu.esdihumboldt.hale.common.core.io.report.IOReport) List(java.util.List) Test(org.junit.Test)

Example 19 with IOReport

use of eu.esdihumboldt.hale.common.core.io.report.IOReport in project hale by halestudio.

the class StreamGmlWriterTest method testGeometryPrimitive_32_LineString.

/**
 * Test writing a {@link LineString} to a GML 3.2 geometry primitive type
 *
 * @throws Exception if an error occurs
 */
@Test
public void testGeometryPrimitive_32_LineString() throws Exception {
    // create the geometry
    LineString lineString = createLineString(0.0);
    Map<List<QName>, Object> values = new HashMap<List<QName>, Object>();
    // $NON-NLS-1$
    values.put(GEOMETRY_PROPERTY, lineString);
    IOReport report = fillFeatureTest(// $NON-NLS-1$
    "PrimitiveTest", // $NON-NLS-1$
    getClass().getResource("/data/geom_schema/geom-gml32.xsd").toURI(), // $NON-NLS-1$
    values, // $NON-NLS-1$
    "geometryPrimitive_32_LineString", // $NON-NLS-1$
    DEF_SRS_NAME, true, false);
    // $NON-NLS-1$
    assertTrue("Expected GML output to be valid", report.isSuccess());
}
Also used : LineString(com.vividsolutions.jts.geom.LineString) MultiLineString(com.vividsolutions.jts.geom.MultiLineString) HashMap(java.util.HashMap) QName(javax.xml.namespace.QName) IOReport(eu.esdihumboldt.hale.common.core.io.report.IOReport) List(java.util.List) Test(org.junit.Test)

Example 20 with IOReport

use of eu.esdihumboldt.hale.common.core.io.report.IOReport in project hale by halestudio.

the class StreamGmlWriterTest method testGeometry_2_MultiPoint.

/**
 * Test writing a {@link MultiPoint} to a GML 2 geometry type
 *
 * @throws Exception if an error occurs
 */
@Ignore
// GML 2 stuff currently not working (because of unrelated schemas)
@Test
public void testGeometry_2_MultiPoint() throws Exception {
    // create the geometry
    MultiPoint mp = geomFactory.createMultiPoint(new Point[] { createPoint(0.0), createPoint(1.0), createPoint(2.0) });
    Map<List<QName>, Object> values = new HashMap<List<QName>, Object>();
    // $NON-NLS-1$
    values.put(GEOMETRY_PROPERTY, mp);
    IOReport report = fillFeatureTest(// $NON-NLS-1$
    "Test", // $NON-NLS-1$
    getClass().getResource("/data/geom_schema/geom-gml2.xsd").toURI(), values, "geometry_2_MultiPoint", // $NON-NLS-1$
    DEF_SRS_NAME);
    // $NON-NLS-1$
    assertTrue("Expected GML output to be valid", report.isSuccess());
}
Also used : MultiPoint(com.vividsolutions.jts.geom.MultiPoint) HashMap(java.util.HashMap) QName(javax.xml.namespace.QName) IOReport(eu.esdihumboldt.hale.common.core.io.report.IOReport) List(java.util.List) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

IOReport (eu.esdihumboldt.hale.common.core.io.report.IOReport)102 DefaultInputSupplier (eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier)34 Test (org.junit.Test)33 LogProgressIndicator (eu.esdihumboldt.hale.common.core.io.impl.LogProgressIndicator)25 List (java.util.List)23 QName (javax.xml.namespace.QName)23 FileIOSupplier (eu.esdihumboldt.hale.common.core.io.supplier.FileIOSupplier)22 Schema (eu.esdihumboldt.hale.common.schema.model.Schema)22 HashMap (java.util.HashMap)22 File (java.io.File)14 MultiPolygon (com.vividsolutions.jts.geom.MultiPolygon)11 XmlSchemaReader (eu.esdihumboldt.hale.io.xsd.reader.XmlSchemaReader)11 SchemaReader (eu.esdihumboldt.hale.common.schema.io.SchemaReader)10 IOProviderConfigurationException (eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException)8 IOProviderDescriptor (eu.esdihumboldt.hale.common.core.io.extension.IOProviderDescriptor)8 IOMessageImpl (eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl)8 IOException (java.io.IOException)8 Ignore (org.junit.Ignore)8 MultiLineString (com.vividsolutions.jts.geom.MultiLineString)7 IOReporter (eu.esdihumboldt.hale.common.core.io.report.IOReporter)7