Search in sources :

Example 11 with GeometryJSON

use of org.geotools.geojson.geom.GeometryJSON in project dhis2-core by dhis2.

the class OrganisationUnitPolygonCoveringCoordinateFilterTest method verifyFilterExcludesOrgUnitFallingOutsidePolygon.

@Test
void verifyFilterExcludesOrgUnitFallingOutsidePolygon() throws IOException {
    filter = new OrganisationUnitPolygonCoveringCoordinateFilter(10.758833885192871, 59.91530028312405);
    Geometry ouGeometry = new GeometryJSON().read(DOWNTOWN_OSLO);
    organisationUnit.setGeometry(ouGeometry);
    assertFalse(filter.retain(organisationUnit));
}
Also used : Geometry(org.locationtech.jts.geom.Geometry) GeometryJSON(org.geotools.geojson.geom.GeometryJSON) Test(org.junit.jupiter.api.Test)

Example 12 with GeometryJSON

use of org.geotools.geojson.geom.GeometryJSON in project dhis2-core by dhis2.

the class GeoFeatureServiceMockTest method createOrgUnitWithCoordinates.

private OrganisationUnit createOrgUnitWithCoordinates() throws IOException {
    OrganisationUnit ou = createOrgUnitWithoutCoordinates();
    ou.setGeometry(new GeometryJSON().read(POINT));
    return ou;
}
Also used : OrganisationUnit(org.hisp.dhis.organisationunit.OrganisationUnit) GeometryJSON(org.geotools.geojson.geom.GeometryJSON)

Aggregations

GeometryJSON (org.geotools.geojson.geom.GeometryJSON)12 Geometry (org.locationtech.jts.geom.Geometry)6 Test (org.junit.jupiter.api.Test)4 Instance (eu.esdihumboldt.hale.common.instance.model.Instance)2 BufferedWriter (java.io.BufferedWriter)2 IOException (java.io.IOException)2 OutputStreamWriter (java.io.OutputStreamWriter)2 StringReader (java.io.StringReader)2 JsonFactory (org.codehaus.jackson.JsonFactory)2 MultiPolygon (com.vividsolutions.jts.geom.MultiPolygon)1 Point (com.vividsolutions.jts.geom.Point)1 Polygon (com.vividsolutions.jts.geom.Polygon)1 StringWriter (java.io.StringWriter)1 OrganisationUnit (org.hisp.dhis.organisationunit.OrganisationUnit)1 Point (org.locationtech.jts.geom.Point)1 ConcaveHull (org.opensphere.geometry.algorithm.ConcaveHull)1 ReversibleLineStringWrapper (org.opentripplanner.common.geometry.ReversibleLineStringWrapper)1 AStar (org.opentripplanner.routing.algorithm.AStar)1 RoutingRequest (org.opentripplanner.routing.core.RoutingRequest)1 State (org.opentripplanner.routing.core.State)1