Search in sources :

Example 6 with Expression

use of io.arlas.server.core.model.request.Expression in project ARLAS-server by gisaia.

the class AbstractFilteredTest method testGintersectFilter.

@Test
public void testGintersectFilter() throws Exception {
    /**
     * west < east bbox
     */
    request.filter.f = Arrays.asList(new MultiValueFilter<>(new Expression("geo_params.geometry", OperatorEnum.intersects, "-2,-2,2,2")));
    handleMatchingGeometryFilter(post(request), 1, everyItem(equalTo("0,0")));
    handleMatchingGeometryFilter(get("f", request.filter.f.get(0).get(0).toString()), 1, everyItem(equalTo("0,0")));
    handleMatchingGeometryFilter(header(request.filter), 1, everyItem(equalTo("0,0")));
    /**
     * west < east bbox
     */
    request.filter.f = Arrays.asList(new MultiValueFilter<>(new Expression("geo_params.geometry", OperatorEnum.intersects, "-170,-2,170,2")));
    handleMatchingGeometryFilter(post(request), 35, everyItem(startsWith("0,")));
    handleMatchingGeometryFilter(get("f", request.filter.f.get(0).get(0).toString()), 35, everyItem(startsWith("0,")));
    handleMatchingGeometryFilter(header(request.filter), 35, everyItem(startsWith("0,")));
    /**
     * west > east bbox
     */
    request.filter.f = Arrays.asList(new MultiValueFilter<>(new Expression("geo_params.geometry", OperatorEnum.intersects, "2,-2,-2,2")));
    handleMatchingGeometryFilter(post(request), 34, everyItem(startsWith("0,")));
    handleMatchingGeometryFilter(get("f", request.filter.f.get(0).get(0).toString()), 34, everyItem(startsWith("0,")));
    handleMatchingGeometryFilter(header(request.filter), 34, everyItem(startsWith("0,")));
    /**
     * west > east bbox
     */
    request.filter.f = Arrays.asList(new MultiValueFilter<>(new Expression("geo_params.geometry", OperatorEnum.intersects, "170,-2,-170,2")));
    handleMatchingGeometryFilter(post(request), 2, everyItem(startsWith("0,")));
    handleMatchingGeometryFilter(get("f", request.filter.f.get(0).get(0).toString()), 2, everyItem(startsWith("0,")));
    handleMatchingGeometryFilter(header(request.filter), 2, everyItem(startsWith("0,")));
    /**
     * clock-wise WKT
     */
    request.filter.f = Arrays.asList(new MultiValueFilter<>(new Expression("geo_params.geometry", OperatorEnum.intersects, "POLYGON((-2 -2, -2 2, 2 2, 2 -2, -2 -2))")));
    handleMatchingGeometryFilter(post(request), 1, everyItem(equalTo("0,0")));
    handleMatchingGeometryFilter(get("f", request.filter.f.get(0).get(0).toString()), 1, everyItem(equalTo("0,0")));
    handleMatchingGeometryFilter(header(request.filter), 1, everyItem(equalTo("0,0")));
    /**
     * clock-wise WKT
     */
    request.filter.f = Arrays.asList(new MultiValueFilter<>(new Expression("geo_params.geometry", OperatorEnum.intersects, "POLYGON((-170 -2, -170 2, 170 2, 170 -2, -170 -2))")));
    handleMatchingGeometryFilter(post(request), 35, everyItem(startsWith("0,")));
    handleMatchingGeometryFilter(get("f", request.filter.f.get(0).get(0).toString()), 35, everyItem(startsWith("0,")));
    handleMatchingGeometryFilter(header(request.filter), 35, everyItem(startsWith("0,")));
    /**
     * counter clock-wise WKT
     */
    request.filter.f = Arrays.asList(new MultiValueFilter<>(new Expression("geo_params.geometry", OperatorEnum.intersects, "POLYGON((-170 -2, 170 -2, 170 2, -170 2, -170 -2))")));
    handleMatchingGeometryFilter(post(request), 2, everyItem(startsWith("0,")));
    handleMatchingGeometryFilter(get("f", request.filter.f.get(0).get(0).toString()), 2, everyItem(startsWith("0,")));
    handleMatchingGeometryFilter(header(request.filter), 2, everyItem(startsWith("0,")));
    /**
     * counter clock-wise WKT
     */
    request.filter.f = Arrays.asList(new MultiValueFilter<>(new Expression("geo_params.geometry", OperatorEnum.intersects, "POLYGON((-2 -2, 2 -2, 2 2,-2 2, -2 -2))")));
    handleMatchingGeometryFilter(post(request), 34, everyItem(startsWith("0,")));
    handleMatchingGeometryFilter(get("f", request.filter.f.get(0).get(0).toString()), 34, everyItem(startsWith("0,")));
    handleMatchingGeometryFilter(header(request.filter), 34, everyItem(startsWith("0,")));
    /**
     * clock-wise WKT
     */
    request.filter.f = Arrays.asList(new MultiValueFilter<>(new Expression("geo_params.geometry", OperatorEnum.intersects, "POLYGON((-330 -2, -330 -1, -290 -1, -290 2, -15 2, -15 1, -40 1, -40 -2, -330 -2))")));
    handleMatchingGeometryFilter(post(request), 31, everyItem(startsWith("0,")));
    handleMatchingGeometryFilter(get("f", request.filter.f.get(0).get(0).toString()), 31, everyItem(startsWith("0,")));
    handleMatchingGeometryFilter(header(request.filter), 31, everyItem(startsWith("0,")));
    /**
     * counter clock-wise WKT
     */
    request.filter.f = Arrays.asList(new MultiValueFilter<>(new Expression("geo_params.geometry", OperatorEnum.intersects, "POLYGON((-330 -2, -40 -2, -40 1, -15 1, -15 2, -290 2, -290 -1, -330 -1, -330 -2))")));
    handleMatchingGeometryFilter(post(request), 12, everyItem(startsWith("0,")));
    handleMatchingGeometryFilter(get("f", request.filter.f.get(0).get(0).toString()), 12, everyItem(startsWith("0,")));
    handleMatchingGeometryFilter(header(request.filter), 12, everyItem(startsWith("0,")));
    /**
     * clock-wise WKT
     */
    request.filter.f = Arrays.asList(new MultiValueFilter<>(new Expression("geo_params.geometry", OperatorEnum.intersects, "POLYGON((10 -2, 10 2, 350 2, 350 0, 300 0, 350 -2, 10 -2))")));
    handleMatchingGeometryFilter(post(request), 34, everyItem(startsWith("0,")));
    handleMatchingGeometryFilter(get("f", request.filter.f.get(0).get(0).toString()), 34, everyItem(startsWith("0,")));
    handleMatchingGeometryFilter(header(request.filter), 34, everyItem(startsWith("0,")));
    /**
     * counter clock-wise WKT
     */
    request.filter.f = Arrays.asList(new MultiValueFilter<>(new Expression("geo_params.geometry", OperatorEnum.intersects, "POLYGON((10 -2, 350 -2, 300 0, 350 0, 350 2, 10 2, 10 -2))")));
    handleMatchingGeometryFilter(post(request), 8, everyItem(startsWith("0,")));
    handleMatchingGeometryFilter(get("f", request.filter.f.get(0).get(0).toString()), 8, everyItem(startsWith("0,")));
    handleMatchingGeometryFilter(header(request.filter), 8, everyItem(startsWith("0,")));
    /**
     * clock-wise WKT with with a point longitude > 180
     */
    request.filter.f = Arrays.asList(new MultiValueFilter<>(new Expression("geo_params.geometry", OperatorEnum.intersects, "POLYGON((-130 -2, -130 2, 220 2, 220 -2, -130 -2))")));
    handleMatchingGeometryFilter(post(request), 35, everyItem(startsWith("0,")));
    handleMatchingGeometryFilter(get("f", request.filter.f.get(0).get(0).toString()), 35, everyItem(startsWith("0,")));
    handleMatchingGeometryFilter(header(request.filter), 35, everyItem(startsWith("0,")));
    /**
     * counter clock-wise WKT with a point longitude > 180
     */
    request.filter.f = Arrays.asList(new MultiValueFilter<>(new Expression("geo_params.geometry", OperatorEnum.intersects, "POLYGON((-130 -2, 220 -2, 220 2, -130 2,  -130 -2))")));
    handleMatchingGeometryFilter(post(request), 2, everyItem(startsWith("0,")));
    handleMatchingGeometryFilter(get("f", request.filter.f.get(0).get(0).toString()), 2, everyItem(startsWith("0,")));
    handleMatchingGeometryFilter(header(request.filter), 2, everyItem(startsWith("0,")));
    /**
     * clock-wise WKT
     */
    request.filter.f = Arrays.asList(new MultiValueFilter<>(new Expression("geo_params.geometry", OperatorEnum.intersects, "POLYGON((0 1,1 1,1 -1,0 -1,0 1))")));
    handleMatchingGeometryFilter(post(request), 1, everyItem(equalTo("0,0")));
    handleMatchingGeometryFilter(get("f", request.filter.f.get(0).get(0).toString()), 1, everyItem(equalTo("0,0")));
    handleMatchingGeometryFilter(header(request.filter), 1, everyItem(equalTo("0,0")));
    /**
     * clock-wise WKT
     */
    request.filter.f = Arrays.asList(new MultiValueFilter<>(new Expression("geo_params.geometry", OperatorEnum.intersects, "POLYGON((2 2,2 3,3 3,3 2,2 2))")));
    handleNotMatchingGintersectFilter(post(request));
    handleNotMatchingGintersectFilter(get("f", request.filter.f.get(0).get(0).toString()));
    handleNotMatchingGintersectFilter(header(request.filter));
    /**
     * WKT Linestring that crosses the dateline
     */
    request.filter.f = Arrays.asList(new MultiValueFilter<>(new Expression("geo_params.geometry", OperatorEnum.intersects, "LINESTRING(50 0, 340 0)")));
    handleMatchingGeometryFilter(post(request), 29, everyItem(startsWith("0,")));
    handleMatchingGeometryFilter(get("f", request.filter.f.get(0).get(0).toString()), 29, everyItem(startsWith("0,")));
    handleMatchingGeometryFilter(header(request.filter), 29, everyItem(startsWith("0,")));
    /**
     * WKT Linestring that doesn't cross the dateline
     */
    request.filter.f = Arrays.asList(new MultiValueFilter<>(new Expression("geo_params.geometry", OperatorEnum.intersects, "LINESTRING(50 0, -20 0)")));
    handleMatchingGeometryFilter(post(request), 8, everyItem(startsWith("0,")));
    handleMatchingGeometryFilter(get("f", request.filter.f.get(0).get(0).toString()), 8, everyItem(startsWith("0,")));
    handleMatchingGeometryFilter(header(request.filter), 8, everyItem(startsWith("0,")));
    /**
     * west < east bbox
     */
    request.filter.f = Arrays.asList(new MultiValueFilter<>(new Expression("geo_params.geometry", OperatorEnum.intersects, "-12,-12,12,12")), new MultiValueFilter<>(new Expression("geo_params.geometry", OperatorEnum.intersects, "0,-1,1,1")));
    handleMatchingGeometryFilter(post(request), 1, everyItem(equalTo("0,0")));
    handleMatchingGeometryFilter(get(Arrays.asList(new ImmutablePair<>("f", request.filter.f.get(0).get(0).toString()), new ImmutablePair<>("f", request.filter.f.get(1).get(0).toString()))), 1, everyItem(equalTo("0,0")));
    handleMatchingGeometryFilter(header(request.filter), 1, everyItem(equalTo("0,0")));
    /**
     * west < east bbox along with a clock-wise WKT
     */
    request.filter.f = Arrays.asList(new MultiValueFilter<>(Arrays.asList(new Expression("geo_params.geometry", OperatorEnum.intersects, "-12,-12,12,12"), new Expression("geo_params.geometry", OperatorEnum.intersects, "POLYGON((0 1,1 1,1 -1,0 -1,0 1))"))));
    handleMatchingGeometryFilter(post(request), 9, everyItem(notNullValue()));
    handleMatchingGeometryFilter(get("f", request.filter.f.get(0).get(0).toString() + ";" + request.filter.f.get(0).get(1).toString()), 9, everyItem(notNullValue()));
    handleMatchingGeometryFilter(header(request.filter), 9, everyItem(notNullValue()));
    /**
     * clock-wise wkt
     */
    request.filter.f = Arrays.asList(new MultiValueFilter<>(new Expression("geo_params.geometry", OperatorEnum.notintersects, "POLYGON((180 90, 180 -70, 160 -70, 160 -90,-180 -90,-180 90,180 90))")));
    handleMatchingGeometryFilter(post(request), 1, everyItem(equalTo("-80,170")));
    handleMatchingGeometryFilter(get("f", request.filter.f.get(0).get(0).toString()), 1, everyItem(equalTo("-80,170")));
    handleMatchingGeometryFilter(header(request.filter), 1, everyItem(equalTo("-80,170")));
    /**
     * counter clock-wise WKT
     */
    request.filter.f = Arrays.asList(new MultiValueFilter<>(new Expression("geo_params.geometry", OperatorEnum.notintersects, "POLYGON((-2 -2, 2 -2, 2 2,-2 2, -2 -2))")));
    handleMatchingGeometryFilter(post(request), 561, everyItem(notNullValue()));
    handleMatchingGeometryFilter(get("f", request.filter.f.get(0).get(0).toString()), 561, everyItem(notNullValue()));
    handleMatchingGeometryFilter(header(request.filter), 561, everyItem(notNullValue()));
    /**
     * clock-wise wkt
     */
    request.filter.f = Arrays.asList(new MultiValueFilter<>(new Expression("geo_params.geometry", OperatorEnum.notintersects, "POLYGON((180 90,180 -90,-180 -90,-180 90,180 90))")));
    handleNotMatchingNotGintersectFilter(post(request));
    handleNotMatchingNotGintersectFilter(get("f", request.filter.f.get(0).get(0).toString()));
    handleNotMatchingNotGintersectFilter(header(request.filter));
    /**
     * counter clock-wise WKT
     */
    request.filter.f = Arrays.asList(new MultiValueFilter<>(new Expression("geo_params.geometry", OperatorEnum.notintersects, "POLYGON((160 -2, 160 2, -160 2, -160 -2, 160 -2))")));
    handleMatchingGeometryFilter(post(request), 591, everyItem(notNullValue()));
    handleMatchingGeometryFilter(get("f", request.filter.f.get(0).get(0).toString()), 591, notNullValue());
    handleMatchingGeometryFilter(header(request.filter), 591, everyItem(notNullValue()));
    /**
     * west < east bbox along with a clock-wise WKT
     */
    request.filter.f = Arrays.asList(new MultiValueFilter<>(new Expression("geo_params.geometry", OperatorEnum.notintersects, "-12,-12,12,12")), new MultiValueFilter<>(new Expression("geo_params.geometry", OperatorEnum.notintersects, "POLYGON((180 90, 180 -70, 160 -70, 160 -90,-180 -90,-180 90,180 90))")));
    handleMatchingGeometryFilter(post(request), 1, everyItem(equalTo("-80,170")));
    handleMatchingGeometryFilter(get(Arrays.asList(new ImmutablePair<>("notintersects", request.filter.f.get(0).get(0).toString()), new ImmutablePair<>("f", request.filter.f.get(1).get(0).toString()))), 1, everyItem(equalTo("-80,170")));
    handleMatchingGeometryFilter(header(request.filter), 1, everyItem(equalTo("-80,170")));
    /**
     * clock-wise wkts
     */
    request.filter.f = Arrays.asList(new MultiValueFilter<>(Arrays.asList(new Expression("geo_params.geometry", OperatorEnum.notintersects, "POLYGON((12 12,12 -12,-12 -12,-12 12,12 12))"), new Expression("geo_params.geometry", OperatorEnum.notintersects, "POLYGON((180 90, 180 -70, 160 -70, 160 -90,-180 -90,-180 90,180 90))"))));
    handleMatchingGeometryFilter(post(request), 586, everyItem(notNullValue()));
    handleMatchingGeometryFilter(get("f", request.filter.f.get(0).get(0).toString() + ";" + request.filter.f.get(0).get(1).toString()), 586, everyItem(notNullValue()));
    handleMatchingGeometryFilter(header(request.filter), 586, everyItem(notNullValue()));
    /**
     * clock-wise wkts
     */
    request.filter.f = Arrays.asList(new MultiValueFilter<>(new Expression("geo_params.geometry", OperatorEnum.intersects, "POLYGON((10 10,10 -10,-10 -10,-10 10,10 10))")), new MultiValueFilter<>(new Expression("geo_params.geometry", OperatorEnum.notintersects, "POLYGON((10 10,10 -10,0 -10,0 10,10 10))")));
    handleMatchingGeometryFilter(post(request), 3, hasItems("10,-10", "0,-10", "-10,-10"));
    handleMatchingGeometryFilter(givenFilterableRequestParams().param("f", request.filter.f.get(0).get(0).toString()).param("f", request.filter.f.get(1).get(0).toString()).when().get(getUrlPath("geodata")).then(), 3, hasItems("10,-10", "0,-10", "-10,-10"));
    handleMatchingGeometryFilter(header(request.filter), 3, hasItems("10,-10", "0,-10", "-10,-10"));
    /**
     * clock-wise wkts
     */
    request.filter.f = Arrays.asList(new MultiValueFilter<>(new Expression("geo_params.geometry", OperatorEnum.intersects, "POLYGON((10 10,10 -10,-10 -10,-10 10,10 10))")), new MultiValueFilter<>(new Expression("geo_params.geometry", OperatorEnum.notintersects, "POLYGON((11 11,11 -11,-11 -11,-11 11,11 11))")));
    handleNotMatchingGintersectComboFilter(post(request));
    handleNotMatchingGintersectComboFilter(givenFilterableRequestParams().param("f", request.filter.f.get(0).get(0).toString()).param("f", request.filter.f.get(1).get(0).toString()).when().get(getUrlPath("geodata")).then());
    handleNotMatchingGintersectComboFilter(header(request.filter));
    request.filter.f = null;
}
Also used : Expression(io.arlas.server.core.model.request.Expression) MultiValueFilter(io.arlas.server.core.model.request.MultiValueFilter) Test(org.junit.Test)

Example 7 with Expression

use of io.arlas.server.core.model.request.Expression in project ARLAS-server by gisaia.

the class AbstractFilteredTest method testNotFoundCollection.

// ----------------------------------------------------------------
// ------------------------- ERROR TESTS --------------------------
// ----------------------------------------------------------------
@Test
public void testNotFoundCollection() throws Exception {
    request.filter.f = // "job:eq:" + DataSetTool.jobs[0]
    Arrays.asList(// "job:eq:" + DataSetTool.jobs[0]
    new MultiValueFilter<>(new Expression("params.job", OperatorEnum.eq, DataSetTool.jobs[0])), new MultiValueFilter<>(new Expression("params.startdate", OperatorEnum.range, "[1000000<2000000]")), new MultiValueFilter<>(new Expression("geo_params.centroid", OperatorEnum.within, "10,10,-10,-10")), new MultiValueFilter<>(new Expression("geo_params.centroid", OperatorEnum.notwithin, "5,5,-5,-5")));
    handleNotFoundCollection(givenFilterableRequestBody().body(request).when().post(getUrlPath("unknowncollection")).then());
    handleNotFoundCollection(givenFilterableRequestParams().param("f", request.filter.f).when().get(getUrlPath("unknowncollection")).then());
    request.filter.f = null;
}
Also used : Expression(io.arlas.server.core.model.request.Expression) MultiValueFilter(io.arlas.server.core.model.request.MultiValueFilter) Test(org.junit.Test)

Example 8 with Expression

use of io.arlas.server.core.model.request.Expression in project ARLAS-server by gisaia.

the class WFSServiceIT method testGetFeatureHeaderFilter.

@Test
public void testGetFeatureHeaderFilter() throws Exception {
    Filter filter = new Filter();
    filter.f = // "job:eq:Architect"
    Arrays.asList(// "job:eq:Architect"
    new MultiValueFilter<>(new Expression("params.job", OperatorEnum.like, "Architect")), new MultiValueFilter<>(new Expression("params.startdate", OperatorEnum.range, "[1009799<1009801]")));
    handleGetFeatureHeaderFilter(get(Arrays.asList(new ImmutablePair<>("SERVICE", "WFS"), new ImmutablePair<>("VERSION", "2.0.0"), new ImmutablePair<>("COUNT", "1000"), new ImmutablePair<>("REQUEST", "GetFeature")), filter));
}
Also used : Filter(io.arlas.server.core.model.request.Filter) MultiValueFilter(io.arlas.server.core.model.request.MultiValueFilter) Expression(io.arlas.server.core.model.request.Expression) MultiValueFilter(io.arlas.server.core.model.request.MultiValueFilter) Test(org.junit.Test)

Example 9 with Expression

use of io.arlas.server.core.model.request.Expression in project ARLAS-server by gisaia.

the class WFSServiceIT method testGetPropertyValueHeaderFilter.

@Test
public void testGetPropertyValueHeaderFilter() throws Exception {
    Filter filter = new Filter();
    filter.f = Arrays.asList(new MultiValueFilter<>(new Expression("params.job", OperatorEnum.like, "Architect")), new MultiValueFilter<>(new Expression("params.startdate", OperatorEnum.range, "[1009799<1009801]")));
    handleGetPropertyValueHeaderFilter(get(Arrays.asList(new ImmutablePair<>("SERVICE", "WFS"), new ImmutablePair<>("VERSION", "2.0.0"), new ImmutablePair<>("COUNT", "1000"), new ImmutablePair<>("REQUEST", "GetPropertyValue"), new ImmutablePair<>("valuereference", "params.job")), filter));
}
Also used : Filter(io.arlas.server.core.model.request.Filter) MultiValueFilter(io.arlas.server.core.model.request.MultiValueFilter) Expression(io.arlas.server.core.model.request.Expression) MultiValueFilter(io.arlas.server.core.model.request.MultiValueFilter) Test(org.junit.Test)

Example 10 with Expression

use of io.arlas.server.core.model.request.Expression in project ARLAS-server by gisaia.

the class GeoSearchRESTService method tiledgeosearch.

@Timed
@Path("{collection}/_geosearch/{z}/{x}/{y}")
@GET
@Produces(UTF8JSON)
@Consumes(UTF8JSON)
@ApiOperation(value = "Tiled GeoSearch", produces = UTF8JSON, notes = Documentation.TILED_GEOSEARCH_OPERATION, consumes = UTF8JSON, response = FeatureCollection.class)
@ApiResponses(value = { @ApiResponse(code = 200, message = "Successful operation", response = FeatureCollection.class, responseContainer = "FeatureCollection"), @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), @ApiResponse(code = 400, message = "Bad request.", response = Error.class) })
public Response tiledgeosearch(// --------------------------------------------------------
@ApiParam(name = "collection", value = "collection", required = true) @PathParam(value = "collection") String collection, @ApiParam(name = "x", value = "x", required = true) @PathParam(value = "x") Integer x, @ApiParam(name = "y", value = "y", required = true) @PathParam(value = "y") Integer y, @ApiParam(name = "z", value = "z", required = true) @PathParam(value = "z") Integer z, // --------------------------------------------------------
@ApiParam(name = "f", value = Documentation.FILTER_PARAM_F, allowMultiple = true) @QueryParam(value = "f") List<String> f, @ApiParam(name = "q", value = Documentation.FILTER_PARAM_Q, allowMultiple = true) @QueryParam(value = "q") List<String> q, @ApiParam(name = "dateformat", value = Documentation.FILTER_DATE_FORMAT) @QueryParam(value = "dateformat") String dateformat, @ApiParam(hidden = true) @HeaderParam(value = "partition-filter") String partitionFilter, @ApiParam(hidden = true) @HeaderParam(value = "Column-Filter") Optional<String> columnFilter, // --------------------------------------------------------
@ApiParam(name = "pretty", value = Documentation.FORM_PRETTY, defaultValue = "false") @QueryParam(value = "pretty") Boolean pretty, @ApiParam(name = "flat", value = Documentation.FORM_FLAT, defaultValue = "false") @QueryParam(value = "flat") Boolean flat, @ApiParam(name = "include", value = Documentation.PROJECTION_PARAM_INCLUDE, allowMultiple = true, defaultValue = "*") @QueryParam(value = "include") String include, @ApiParam(name = "exclude", value = Documentation.PROJECTION_PARAM_EXCLUDE, allowMultiple = true, defaultValue = "") @QueryParam(value = "exclude") String exclude, @ApiParam(name = "returned_geometries", value = Documentation.PROJECTION_PARAM_RETURNED_GEOMETRIES, defaultValue = "") @QueryParam(value = "returned_geometries") String returned_geometries, @ApiParam(name = "size", value = Documentation.PAGE_PARAM_SIZE, defaultValue = "10", allowableValues = "range[1, infinity]", type = "integer") @DefaultValue("10") @QueryParam(value = "size") IntParam size, @ApiParam(name = "from", value = Documentation.PAGE_PARAM_FROM, defaultValue = "0", allowableValues = "range[0, infinity]", type = "integer") @DefaultValue("0") @QueryParam(value = "from") IntParam from, @ApiParam(name = "sort", value = Documentation.PAGE_PARAM_SORT, allowMultiple = true) @QueryParam(value = "sort") String sort, @ApiParam(name = "after", value = Documentation.PAGE_PARAM_AFTER) @QueryParam(value = "after") String after, @ApiParam(name = "before", value = Documentation.PAGE_PARAM_BEFORE) @QueryParam(value = "before") String before, // --------------------------------------------------------
@ApiParam(value = "max-age-cache") @QueryParam(value = "max-age-cache") Integer maxagecache) throws NotFoundException, ArlasException {
    CollectionReference collectionReference = exploreService.getCollectionReferenceService().getCollectionReference(collection);
    if (collectionReference == null) {
        throw new NotFoundException(collection);
    }
    BoundingBox bbox = GeoTileUtil.getBoundingBox(new Tile(x, y, z));
    // west, south, east, north
    Expression pwithinBbox = new Expression(collectionReference.params.centroidPath, OperatorEnum.within, bbox.getWest() + "," + bbox.getSouth() + "," + bbox.getEast() + "," + bbox.getNorth());
    return geosearch(collectionReference, ParamsParser.getFilter(collectionReference, f, q, dateformat, bbox, pwithinBbox), partitionFilter, columnFilter, flat, include, exclude, size, from, sort, after, before, maxagecache, returned_geometries, false);
}
Also used : Expression(io.arlas.server.core.model.request.Expression) CollectionReference(io.arlas.server.core.model.CollectionReference) Timed(com.codahale.metrics.annotation.Timed) ApiOperation(io.swagger.annotations.ApiOperation) ApiResponses(io.swagger.annotations.ApiResponses)

Aggregations

Expression (io.arlas.server.core.model.request.Expression)18 MultiValueFilter (io.arlas.server.core.model.request.MultiValueFilter)17 Test (org.junit.Test)15 Filter (io.arlas.server.core.model.request.Filter)9 ArlasException (io.arlas.server.core.exceptions.ArlasException)2 CollectionReferenceParameters (io.arlas.server.core.model.CollectionReferenceParameters)2 DublinCoreElementName (io.arlas.server.core.model.DublinCoreElementName)2 Inspire (io.arlas.server.core.model.Inspire)2 IOException (java.io.IOException)2 UnknownHostException (java.net.UnknownHostException)2 Timed (com.codahale.metrics.annotation.Timed)1 CollectionReference (io.arlas.server.core.model.CollectionReference)1 RequestSpecification (io.restassured.specification.RequestSpecification)1 ApiOperation (io.swagger.annotations.ApiOperation)1 ApiResponses (io.swagger.annotations.ApiResponses)1