Search index supports three geographical location-based queries: GeoBoundingBoxQuery, GeoDistanceQuery, and GeoPolygonQuery.

GeoBoundingBoxQuery

You can call the GeoBoundingBoxQuery operation to query data that falls within a rectangular geographical area.

You can specify a rectangular geographical area as a filtering condition in a query. Table Store returns the rows where the value of a field falls within the rectangular geographical area.

query = GeoBoundingBoxQuery('g', '30.9,112.0', '30.2,119.0')
rows, next_token, total_count, is_all_succeed = client.search(
    table_name, index_name, 
    SearchQuery(query, limit=100, get_total_count=True), 
    ColumnsToGet(return_type=ColumnReturnType.ALL)
)

GeoDistanceQuery

You can call the GeoDistanceQuery operation to query data that falls within a circular geographical area. You can specify a circular geographical area as a filtering condition in a query, which consists of a central point and radius. Table Store returns the rows where the value of a field falls within the geographical circular area.
query = GeoDistanceQuery('g', '32.5,116.5', 300000)
rows, next_token, total_count, is_all_succeed = client.search(
    table_name, index_name, 
    SearchQuery(query, limit=100, get_total_count=True), 
    ColumnsToGet(return_type=ColumnReturnType.ALL)
)

GeoPolygonQuery

You can call the GeoPolygonQuery operation to query data that falls within a geographical polygon area. You can specify a geographical polygon area as a filtering condition in a query. Table Store returns the rows where the value of a field falls within the geographical polygon area.
query = GeoPolygonQuery('g', ['30.9,112.0', '30.5,115.0', '30.3, 117.0', '30.2,119.0'])
rows, next_token, total_count, is_all_succeed = client.search(
    table_name, index_name, 
    SearchQuery(query, limit=100, get_total_count=True), 
    ColumnsToGet(return_type=ColumnReturnType.ALL)
)