use of org.geotools.gml3.ApplicationSchemaConfiguration in project coastal-hazards by USGS-CIDA.
the class GMLUtil method generateGMLConfiguration.
public static Configuration generateGMLConfiguration(InputStream inputStream) {
QName featureTypeSchema = GMLUtil.extractFeatureTypeSchema(inputStream);
if (featureTypeSchema == null) {
throw new RuntimeException("featureTypeSchema null for inputStream");
}
String schemaLocation = featureTypeSchema.getLocalPart();
Configuration configuration = null;
if (schemaLocation != null && featureTypeSchema.getNamespaceURI() != null) {
SchemaRepository.registerSchemaLocation(featureTypeSchema.getNamespaceURI(), schemaLocation);
configuration = new ApplicationSchemaConfiguration(featureTypeSchema.getNamespaceURI(), schemaLocation);
} else {
configuration = new GMLConfiguration();
configuration.getProperties().add(Parser.Properties.IGNORE_SCHEMA_LOCATION);
configuration.getProperties().add(Parser.Properties.PARSE_UNKNOWN_ELEMENTS);
}
return configuration;
}
use of org.geotools.gml3.ApplicationSchemaConfiguration in project coastal-hazards by USGS-CIDA.
the class GMLUtil method generateGMLConfiguration.
public static Configuration generateGMLConfiguration(InputStream inputStream) {
QName featureTypeSchema = GMLUtil.extractFeatureTypeSchema(inputStream);
if (featureTypeSchema == null) {
throw new RuntimeException("featureTypeSchema null for inputStream");
}
String schemaLocation = featureTypeSchema.getLocalPart();
Configuration configuration = null;
if (schemaLocation != null && featureTypeSchema.getNamespaceURI() != null) {
configuration = new ApplicationSchemaConfiguration(featureTypeSchema.getNamespaceURI(), schemaLocation);
} else {
configuration = new GMLConfiguration();
configuration.getProperties().add(Parser.Properties.IGNORE_SCHEMA_LOCATION);
configuration.getProperties().add(Parser.Properties.PARSE_UNKNOWN_ELEMENTS);
}
return configuration;
}
Aggregations