Search in sources :

Example 46 with Coordinate

use of org.openforis.idm.model.Coordinate in project collect by openforis.

the class GeoToolsCoordinateOperations method convertTo.

public Coordinate convertTo(Coordinate coordinate, String toSrsId) {
    if (toSrsId.equals(coordinate.getSrsId())) {
        return coordinate;
    } else {
        Position position = toPosition(coordinate.getX(), coordinate.getY(), coordinate.getSrsId(), toSrsId);
        DirectPosition directPosition = position.getDirectPosition();
        return new Coordinate(directPosition.getOrdinate(0), directPosition.getOrdinate(1), toSrsId);
    }
}
Also used : DirectPosition(org.opengis.geometry.DirectPosition) Position(org.opengis.geometry.coordinate.Position) DirectPosition(org.opengis.geometry.DirectPosition) Coordinate(org.openforis.idm.model.Coordinate)

Aggregations

Coordinate (org.openforis.idm.model.Coordinate)46 Code (org.openforis.idm.model.Code)14 Test (org.junit.Test)8 Date (org.openforis.idm.model.Date)8 Time (org.openforis.idm.model.Time)8 ArrayList (java.util.ArrayList)7 SamplingDesignItem (org.openforis.collect.model.SamplingDesignItem)7 CoordinateAttribute (org.openforis.idm.model.CoordinateAttribute)7 Entity (org.openforis.idm.model.Entity)7 CollectRecord (org.openforis.collect.model.CollectRecord)5 GregorianCalendar (java.util.GregorianCalendar)4 SamplingPointLevelGenerationSettings (org.openforis.collect.metamodel.samplingdesign.SamplingPointLevelGenerationSettings)4 CollectSurvey (org.openforis.collect.model.CollectSurvey)4 CoordinateOperations (org.openforis.idm.geospatial.CoordinateOperations)4 RealAttribute (org.openforis.idm.model.RealAttribute)4 CoordinateAttributeDefinition (org.openforis.idm.metamodel.CoordinateAttributeDefinition)3 ValidationResults (org.openforis.idm.metamodel.validation.ValidationResults)3 NumberAttribute (org.openforis.idm.model.NumberAttribute)3 RecordBuilder (org.openforis.idm.testfixture.RecordBuilder)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)2