Search in sources :

Example 1 with GeoToolsCoordinateOperations

use of org.openforis.collect.geospatial.GeoToolsCoordinateOperations in project collect by openforis.

the class SamplingPointDataGeneratorTest method init.

@Before
public void init() {
    coordinateOperations = new GeoToolsCoordinateOperations();
    coordinateOperations.initialize();
}
Also used : GeoToolsCoordinateOperations(org.openforis.collect.geospatial.GeoToolsCoordinateOperations) Before(org.junit.Before)

Example 2 with GeoToolsCoordinateOperations

use of org.openforis.collect.geospatial.GeoToolsCoordinateOperations in project collect by openforis.

the class SpatialReferenceSystemsVM method getAvailablePredefinedSRSs.

public List<String> getAvailablePredefinedSRSs() {
    List<SpatialReferenceSystem> currentSRSs = survey.getSpatialReferenceSystems();
    List<String> insertedSRSCodes = new ArrayList<String>();
    for (SpatialReferenceSystem srs : currentSRSs) {
        insertedSRSCodes.add(srs.getId());
    }
    GeoToolsCoordinateOperations coordinateOperations = (GeoToolsCoordinateOperations) survey.getContext().getCoordinateOperations();
    Set<String> availableSRSs = coordinateOperations.getAvailableSRSs();
    List<String> result = new ArrayList<String>(availableSRSs);
    result.removeAll(insertedSRSCodes);
    Collections.sort(result);
    return result;
}
Also used : SpatialReferenceSystem(org.openforis.idm.metamodel.SpatialReferenceSystem) ArrayList(java.util.ArrayList) GeoToolsCoordinateOperations(org.openforis.collect.geospatial.GeoToolsCoordinateOperations)

Aggregations

GeoToolsCoordinateOperations (org.openforis.collect.geospatial.GeoToolsCoordinateOperations)2 ArrayList (java.util.ArrayList)1 Before (org.junit.Before)1 SpatialReferenceSystem (org.openforis.idm.metamodel.SpatialReferenceSystem)1