use of org.geotoolkit.sld.xml.v100.ParameterValueType in project geotoolkit by Geomatys.
the class GTtoSE100Transformer method visitExpression.
/**
* Transform a GT Expression in a jaxb parameter value type.
*/
public ParameterValueType visitExpression(final Expression exp) {
final JAXBElement<?> ele = extract(exp);
if (ele == null) {
return null;
} else {
final ParameterValueType param = sld_factory_v100.createParameterValueType();
param.getContent().add(extract(exp));
return param;
}
}
use of org.geotoolkit.sld.xml.v100.ParameterValueType in project geotoolkit by Geomatys.
the class SLD110Test method testUnitTranscription.
@Test
public void testUnitTranscription() {
final SE110toGTTransformer se2gt = new SE110toGTTransformer(FILTER_FACTORY, STYLE_FACTORY);
final GTtoSE110Transformer gt2se = new GTtoSE110Transformer();
final TextSymbolizerType textSymbol = new TextSymbolizerType();
final ParameterValueType labelType = new ParameterValueType();
labelType.getContent().add("label");
textSymbol.setLabel(labelType);
textSymbol.setUom("km");
TextSymbolizer transcriptedText = se2gt.visit(textSymbol);
assertEquals("Converted unit of measure", Units.KILOMETRE, transcriptedText.getUnitOfMeasure());
TextSymbolizerType revertedSymbol = gt2se.visit(transcriptedText, null).getValue();
assertEquals("Reverted unit of measure", "km", revertedSymbol.getUom());
textSymbol.setUom(null);
transcriptedText = se2gt.visit(textSymbol);
assertEquals("Converted unit of measure", Units.POINT, transcriptedText.getUnitOfMeasure());
revertedSymbol = gt2se.visit(transcriptedText, null).getValue();
assertEquals("Reverted unit of measure", "http://www.opengeospatial.org/se/units/pixel", revertedSymbol.getUom());
textSymbol.setUom("px");
transcriptedText = se2gt.visit(textSymbol);
assertEquals("Converted unit of measure", Units.POINT, transcriptedText.getUnitOfMeasure());
revertedSymbol = gt2se.visit(transcriptedText, null).getValue();
assertEquals("Reverted unit of measure", "http://www.opengeospatial.org/se/units/pixel", revertedSymbol.getUom());
textSymbol.setUom("meter");
transcriptedText = se2gt.visit(textSymbol);
assertEquals("Converted unit of measure", Units.METRE, transcriptedText.getUnitOfMeasure());
revertedSymbol = gt2se.visit(transcriptedText, null).getValue();
assertEquals("Reverted unit of measure", "http://www.opengeospatial.org/se/units/metre", revertedSymbol.getUom());
}
use of org.geotoolkit.sld.xml.v100.ParameterValueType in project geotoolkit by Geomatys.
the class GTtoSE110Transformer method visitExpression.
/**
* Transform a GT Expression in a jaxb parameter value type.
*/
public ParameterValueType visitExpression(final Expression exp) {
if (exp == null)
return null;
final JAXBElement<?> ele = extract(exp);
if (ele == null) {
return null;
} else {
final ParameterValueType param = se_factory.createParameterValueType();
param.getContent().add(extract(exp));
return param;
}
}
Aggregations