use of org.n52.series.db.beans.ProcedureEntity in project SOS by 52North.
the class AbstractHibernateProcedureDescriptionGeneratorSml method createPosition.
/**
* Create SensorML Position from Hibernate procedure entity
*
* @param procedure
* Hibernate procedure entity
* @param vector
* Flag to indicate that the geometry should be defined as a
* vector
*
* @return SensorML Position
*/
protected SmlPosition createPosition(ProcedureEntity procedure, boolean vector) {
SmlPosition position = new SmlPosition();
position.setName(POSITION_NAME);
position.setFixed(true);
int srid = geometryHandler.getDefaultResponseEPSG();
if (procedure.isSetGeometry()) {
if (procedure.getGeometry().getSRID() > 0) {
srid = procedure.getGeometry().getSRID();
}
final Coordinate c = procedure.getGeometry().getCoordinate();
if (vector) {
position.setVector(createVectorForPosition(createCoordinatesForPosition(c.getY(), c.getX(), c.getZ()), srsNamePrefixUrl + srid));
} else {
position.setPosition(createCoordinatesForPosition(c.getY(), c.getX(), c.getZ()));
}
}
if (procedure.getGeometry().getSRID() > 0) {
srid = procedure.getGeometry().getSRID();
}
position.setReferenceFrame(srsNamePrefixUrl + srid);
return position;
}
use of org.n52.series.db.beans.ProcedureEntity in project SOS by 52North.
the class HibernateProcedureDescriptionGeneratorInspireOmpr30 method generateProcedureDescription.
/**
* Generate procedure description from Hibernate procedure entity if no
* description (file, XML text) is available
*
* @param p
* Hibernate procedure entity
* @param session
* the session
*
* @return Generated procedure description
*
* @throws OwsExceptionReport
* If an error occurs
*/
public SosProcedureDescription<AbstractFeature> generateProcedureDescription(ProcedureEntity p, Locale i18n, Session session) throws OwsExceptionReport {
setLocale(i18n);
final Process process = new Process();
setCommonData(p, process, session);
// process.setType();
addResponsibleParty(process);
return new SosProcedureDescription<AbstractFeature>(process);
}
use of org.n52.series.db.beans.ProcedureEntity in project SOS by 52North.
the class HibernateProcedureDescriptionGeneratorSml101 method createRulesDefinition.
/**
* Create the rules definition for ProcessMethod
*
* @param procedure
* Hibernate procedure entity
* @param observableProperties
* Properties observed by the procedure
*
* @return SensorML RulesDefinition
*/
private RulesDefinition createRulesDefinition(ProcedureEntity procedure, String[] observableProperties) {
RulesDefinition rD = new RulesDefinition();
String template = processMethodRulesDefinitionDescriptionTemplate;
String description = String.format(template, procedure.getIdentifier(), String.join(",", observableProperties));
rD.setDescription(description);
return rD;
}
use of org.n52.series.db.beans.ProcedureEntity in project SOS by 52North.
the class HibernateProcedureDescriptionGeneratorSml101 method createSmlProcessModel.
/**
* Create a SensorML ProcessModel from Hibernate procedure entity
*
* @param procedure
* Hibernate procedure entity
* @param session
* the session
*
* @return SensorML ProcessModel
*
* @throws OwsExceptionReport
* If an error occurs
*/
private ProcessModel createSmlProcessModel(ProcedureEntity procedure, Session session) throws OwsExceptionReport {
final ProcessModel processModel = new ProcessModel();
setCommonValues(procedure, processModel, session);
processModel.setMethod(createMethod(procedure, getObservablePropertiesForProcedure(procedure.getIdentifier())));
// processModel.setNames(createNames(procedure));
return processModel;
}
use of org.n52.series.db.beans.ProcedureEntity in project SOS by 52North.
the class HibernateProcedureDescriptionGeneratorWml20 method generateProcedureDescription.
/**
* Generate procedure description from Hibernate procedure entity if no description (file, XML text) is
* available
*
* @param procedure Hibernate procedure entity
* @param i18n the locale
* @param session the session
*
* @return Generated procedure description
*
* @throws OwsExceptionReport If an error occurs
*/
@Override
public SosProcedureDescription<AbstractFeature> generateProcedureDescription(ProcedureEntity procedure, Locale i18n, Session session) throws OwsExceptionReport {
setLocale(i18n);
final ObservationProcess op = new ObservationProcess();
setCommonData(procedure, op, session);
addName(procedure, op);
op.setProcessType(new ReferenceType(WaterMLConstants.PROCESS_TYPE_ALGORITHM));
return new SosProcedureDescription<>(op);
}
Aggregations