Description
The "Search Intersects" beta endpoint allows you to search a region of many Geographies at once on the earth using a polygon search area of any size, drawn anti-clockwise.
Proto Definition
service BGSearchBeta {
rpc BetaSearchIntersects (BetaSearchIntersectsArgs) returns (stream BetaSearchResult){}
}
Input Message
Name: BetaSearchIntersectsArgs
Attribute | Type | Description |
---|---|---|
collection | string | The collection to search. |
search_geometry | Polygon | lat_Lng_bbox | The Geography used to search on the surface of the earth. Please reference Polygon & LatLngBBox. |
controls | BetaSearchControls | Controlling whether you would like to obtain the geometries only, or payload, or both, as well as controlling the level of aggregation returned. |
BetaSearchControls
:
Attribute | Type | Description |
---|---|---|
return_geometries | bool | Controls whether the search returns geometries (it'll always return IDs). |
return_payloads | bool | Controls whether the search returns payloads associated with geometries. |
geometries_chunk_size | uint64 | Controls the number of geometries returned in each streamed BetaSearchResult message. If 0 is passed, it'll return the search result geometries one by one which is very slow. |
aggregates_chunk_size | uint64 | Controls the number of aggregated triangles returned in each streamed BetaSearchResult message. If 0 is passed, it'll return the search result triangles one by one which is very slow. |
aggregationArgs | AggregationArgs ? | Controls the aggregation behaviour. If it's not set, no aggregation happens. |
AggregationArgs
:
Attribute | Type | Description |
---|---|---|
max_geoms_per_cell | uint64 | The maximum number of geometries before BG-Search returns an aggregate view for that cell. A good value depends on your data but a reasonable range is between 50 to 200. Lower number means more aggressive aggregation. |
resolution_offset | uint64 | Controls the resolution of the aggregated cells returned. a good range of values in 2 to 4. |
max_additional_refines | uint64 | The maximum additional refinement for the aggregated cells. It should be 0 for most use cases. |
count_refine_factor | double | This a threshold for when to do the additional refinement aggregate. Use 1.0 for start. |
message AggregationArgs {
uint64 max_geoms_per_cell = 1;
uint64 resolution_offset = 2;
uint64 max_additional_refines = 3;
double count_refine_factor = 4;
}
message BetaSearchControls {
bool return_geometries = 1;
bool return_payloads = 2;
uint64 geometries_chunk_size = 3;
uint64 aggregates_chunk_size = 4;
optional AggregationArgs aggregationArgs = 5;
};
message BetaSearchIntersectsArgs {
string collection = 1;
oneof search_geometry {
// LatLng point = 2;
// LineStrip line_strip = 3;
Polygon polygon = 4;
LatLngBBox lat_Lng_bbox = 5;
};
reserved 2, 3;
reserved "point", "line_strip";
reserved 6 to 14;
BetaSearchControls controls = 15;
}
Output Message
A stream of the Results from the search containing aggregated Triangles and individual Geographies that are sparse enough to not be aggregated.
The result is either a Geometry
or Aggregate
, the description of each is given below:
Geometry
:
Aggregate
:
Attribute | Type | Description |
---|---|---|
cell_index | DGGSIndex | The corresponding DGGSIndex of the aggregated cell. This type is the same as that returned by PointToDGGSIndex. |
cell_vertices | Ring | The Ring denoting the vertices of the triangle on the earth. Information about the Ring type can be found here. |
point_count | uint64 | The number of LatLng contained in this aggregate Triangle. |
non_point_count | uint64 | The number of Geometries excluding LatLng contained in this aggregate Triangle. |
mean_point | LatLng | The mean point used to represent the aggregate cell in LatLng for heatmap visualization. |
BetaSearchResult
Attribute | Type | Description |
---|---|---|
geometries | Geometry[] | A list of the Geometries found as a result of this search. |
aggregates | Aggregate[] | A list of the aggregated triangles containing more information. |
message BetaSearchResult {
message Geometry {
GeometryID id = 1;
optional IndexableGeometry geometry = 2;
optional Payload payload = 3;
}
// Subject to change
message Aggregate {
DGGSIndex cell_index = 1;
Ring cell_vertices = 2;
uint64 point_count = 3;
uint64 non_point_count = 4;
LatLng mean_point = 5;
}
repeated Geometry geometries = 1;
repeated Aggregate aggregates = 2;
}