Search in sources :

Example 1 with GeometryType

use of au.gov.asd.tac.constellation.utilities.geospatial.Shape.GeometryType in project constellation by constellation-app.

the class ExportToShapefilePlugin method exportGeo.

@Override
protected void exportGeo(final PluginParameters parameters, final String uuid, final Map<String, String> shapes, final Map<String, Map<String, Object>> attributes, final File output) throws IOException {
    final ParameterValue geometryTypePV = parameters.getSingleChoice(GEOMETRY_TYPE_PARAMETER_ID);
    assert (geometryTypePV instanceof GeometryTypeParameterValue);
    final GeometryType geometryType = ((GeometryTypeParameterValue) geometryTypePV).getGeometryType();
    final ParameterValue spatialReferencePV = parameters.getSingleChoice(SPATIAL_REFERENCE_PARAMETER_ID);
    assert (spatialReferencePV instanceof SpatialReferenceParameterValue);
    final SpatialReference spatialReference = ((SpatialReferenceParameterValue) spatialReferencePV).getSpatialReference();
    Shape.generateShapefile(uuid, geometryType, shapes, attributes, output, spatialReference);
}
Also used : GeometryType(au.gov.asd.tac.constellation.utilities.geospatial.Shape.GeometryType) ParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.ParameterValue) SingleChoiceParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.SingleChoiceParameterType.SingleChoiceParameterValue) SpatialReference(au.gov.asd.tac.constellation.utilities.geospatial.Shape.SpatialReference)

Aggregations

ParameterValue (au.gov.asd.tac.constellation.plugins.parameters.types.ParameterValue)1 SingleChoiceParameterValue (au.gov.asd.tac.constellation.plugins.parameters.types.SingleChoiceParameterType.SingleChoiceParameterValue)1 GeometryType (au.gov.asd.tac.constellation.utilities.geospatial.Shape.GeometryType)1 SpatialReference (au.gov.asd.tac.constellation.utilities.geospatial.Shape.SpatialReference)1