use of org.openforis.collect.model.RecordCoordinatesKmlGeneratorJob in project collect by openforis.
the class GeoDataController method createCoordinateValuesKML.
@RequestMapping(value = "survey/{surveyId}/data/coordinatesvalues.kml", method = GET, produces = KML_CONTENT_TYPE)
public void createCoordinateValuesKML(@PathVariable("surveyId") int surveyId, @RequestParam int stepNum, @RequestParam int coordinateAttributeId, HttpServletResponse response) throws Exception {
CollectSurvey survey = surveyManager.getById(surveyId);
CoordinateAttributeDefinition nodeDef = (CoordinateAttributeDefinition) survey.getSchema().getDefinitionById(coordinateAttributeId);
RecordCoordinatesKmlGeneratorJob job = new RecordCoordinatesKmlGeneratorJob();
job.setRecordManager(recordManager);
RecordFilter filter = new RecordFilter(survey);
job.setRecordFilter(filter);
job.setNodeDefinition(nodeDef);
job.setOutput(response.getOutputStream());
CoordinateOperations coordinateOperations = survey.getContext().getCoordinateOperations();
coordinateOperations.registerSRS(survey.getSpatialReferenceSystems());
job.setCoordinateOperations(coordinateOperations);
jobManager.start(job, false);
}
Aggregations