Description

The "Search Intersects" endpoint allows you to find intersecting geometries with the provided polygon within the provided collection. This endpoint accepts a polygon as input and search the within the provided collection for all the geometries that are intersecting the input geometry.

Proto Definition


service BGSearch {
     rpc SearchIntersects (SearchIntersectsArgs) returns (stream SearchResult) {}
}

Input Message

Name: SearchIntersectsArgs

AttributetypeDescription
collectionstringThe name of the collection.
lat_lng_bboxLatLngBBoxThe lat lng bounding box to find intersections with.
polygonPolygonThe polygon to find intersections with.
controlsSearchControlsThe search controls.

SearchControls:

AttributeTypeDescription
return_geometriesboolControls whether the search returns geometries (it'll always return IDs).
return_payloadsboolControls whether the search returns payloads associated with geometries.
chunk_sizeuint64Controls the number of geometries returned in each streamed SearchResult message. A number between 1,000 to 10,000 is optimal. If 0 is passed, it'll return the search result geometries one by one which is very slow.
message SearchControls {
  bool return_geometries = 1;
  bool return_payloads = 2;
  uint64 chunk_size = 3;
}

message SearchIntersectsArgs {
  string collection = 1;
  oneof search_geometry {
    // LatLng point = 2;
    // LineStrip line_strip = 3;
    Polygon polygon = 4;
    LatLngBBox lat_lng_bbox = 5;
  };
  reserved 2, 3, 6 to 14;
  reserved "point", "line_strip";
  SearchControls controls = 15;
}

Output Message

Name: stream SearchResult

AttributeTypeDescription
geometriesGeometry[]The result of the search operation. Can only be Geometry[].
message SearchResult {
  message Geometry {
    GeometryID id = 1;
    optional IndexableGeometry geometry = 2;
    optional Payload payload = 3;
  }

  repeated Geometry geometries = 1;

  reserved 2;
  reserved "aggregates";
}

Status Code

  • 5: NOT_FOUND if a collection with the provided name does not exist.