FilterToMongoTest.java (geotools-24.0-project) | : | FilterToMongoTest.java (geotools-24.1-project) | ||
---|---|---|---|---|
skipping to change at line 41 | skipping to change at line 41 | |||
import org.geotools.feature.simple.SimpleFeatureTypeBuilder; | import org.geotools.feature.simple.SimpleFeatureTypeBuilder; | |||
import org.geotools.referencing.crs.DefaultGeographicCRS; | import org.geotools.referencing.crs.DefaultGeographicCRS; | |||
import org.junit.Test; | import org.junit.Test; | |||
import org.locationtech.jts.algorithm.Orientation; | import org.locationtech.jts.algorithm.Orientation; | |||
import org.locationtech.jts.geom.Coordinate; | import org.locationtech.jts.geom.Coordinate; | |||
import org.locationtech.jts.geom.Geometry; | import org.locationtech.jts.geom.Geometry; | |||
import org.locationtech.jts.geom.GeometryFactory; | import org.locationtech.jts.geom.GeometryFactory; | |||
import org.locationtech.jts.geom.Point; | import org.locationtech.jts.geom.Point; | |||
import org.opengis.filter.And; | import org.opengis.filter.And; | |||
import org.opengis.filter.FilterFactory2; | import org.opengis.filter.FilterFactory2; | |||
import org.opengis.filter.Not; | ||||
import org.opengis.filter.Or; | import org.opengis.filter.Or; | |||
import org.opengis.filter.PropertyIsBetween; | import org.opengis.filter.PropertyIsBetween; | |||
import org.opengis.filter.PropertyIsEqualTo; | import org.opengis.filter.PropertyIsEqualTo; | |||
import org.opengis.filter.PropertyIsGreaterThan; | import org.opengis.filter.PropertyIsGreaterThan; | |||
import org.opengis.filter.PropertyIsLessThan; | import org.opengis.filter.PropertyIsLessThan; | |||
import org.opengis.filter.PropertyIsLike; | import org.opengis.filter.PropertyIsLike; | |||
import org.opengis.filter.expression.Literal; | import org.opengis.filter.expression.Literal; | |||
import org.opengis.filter.spatial.BBOX; | import org.opengis.filter.spatial.BBOX; | |||
import org.opengis.filter.spatial.Intersects; | import org.opengis.filter.spatial.Intersects; | |||
import org.opengis.filter.spatial.Within; | import org.opengis.filter.spatial.Within; | |||
skipping to change at line 360 | skipping to change at line 361 | |||
public void testIntersectsWithJsonSelectAll() { | public void testIntersectsWithJsonSelectAll() { | |||
Intersects intersects = | Intersects intersects = | |||
ff.intersects( | ff.intersects( | |||
ff.function("jsonSelectAll", ff.literal("geom")), getGeo metryParameter()); | ff.function("jsonSelectAll", ff.literal("geom")), getGeo metryParameter()); | |||
BasicDBObject mongoQuery = (BasicDBObject) intersects.accept(filterToMon go, null); | BasicDBObject mongoQuery = (BasicDBObject) intersects.accept(filterToMon go, null); | |||
testIntersectMongoQuery(mongoQuery); | testIntersectMongoQuery(mongoQuery); | |||
} | } | |||
public void testNot() { | ||||
Not not = ff.not(ff.isNull(ff.property("foo"))); | ||||
BasicDBObject obj = (BasicDBObject) not.accept(filterToMongo, null); | ||||
assertNotNull(obj); | ||||
assertEquals(1, obj.keySet().size()); | ||||
BasicDBObject operator = (BasicDBObject) obj.get("properties.foo"); | ||||
assertEquals(null, operator.get("$eq")); | ||||
} | ||||
private Literal getGeometryParameter() { | private Literal getGeometryParameter() { | |||
Coordinate[] coordinates = | Coordinate[] coordinates = | |||
new Coordinate[] { | new Coordinate[] { | |||
new Coordinate(10.0, 10.0), | new Coordinate(10.0, 10.0), | |||
new Coordinate(20.0, 10.0), | new Coordinate(20.0, 10.0), | |||
new Coordinate(20.0, 20.0), | new Coordinate(20.0, 20.0), | |||
new Coordinate(10.0, 20.0), | new Coordinate(10.0, 20.0), | |||
new Coordinate(10.0, 10.0), | new Coordinate(10.0, 10.0), | |||
}; | }; | |||
return ff.literal(new GeometryFactory().createPolygon(coordinates)); | return ff.literal(new GeometryFactory().createPolygon(coordinates)); | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 11 lines changed or added |