THIS SDK ISDEPRECATED.

We rolled out a new and better SDK for you.

Geometry search

Allow your users to perform a free text search inside geometries specified by circles and/or polygons.

Sample use case: You are planing to visit the area of Amsterdam. You need find a parking spot, an ATM, and a grocery store in the city centre in Amsterdam and/or in the west part of the city.

Use the following code to try this in your app:

1List<Geometry> geometries = new ArrayList<>()
2geometries.add(new Geometry(new PolygonGeometry(DefaultGeometries.POLYGON_POINTS)));
3geometries.add(new Geometry(new CircleGeometry(DefaultGeometries.CIRCLE_CENTER, DefaultGeometries.CIRCLE_RADIUS)));
1val circleGeometry = createDefaultCircleGeometry()
2val polygonGeometry = createDefaultPolygonGeometry()
3val geometriesList = listOf(Geometry(circleGeometry), Geometry(polygonGeometry))
4
5val query = GeometrySearchQueryBuilder.create(term, geometriesList)
6 .withLimit(SEARCH_RESULTS_LIMIT)
7 .build()
1GeometrySearchQuery query = new GeometrySearchQueryBuilder(term, geometries)
2 .withLimit(SEARCH_RESULTS_LIMIT).build();
3
4SearchApi searchAPI = OnlineSearchApi.create(context, BuildConfig.SEARCH_API_KEY);
5searchAPI.geometrySearch(query, geometrySearchCallback);
searchApi.geometrySearch(geometryQuery)

Sample views utilizing Geometry Search:

image

Geometry search with term: Parking

image

Geometry search with term: ATM