Skip to content

Support for filtering by a GeoBoundingBox #83

@alexander-schranz

Description

@alexander-schranz

Why Loupe already supports filtering by a GeoDistance. Which support we already merged also int SEAL. It would also be nice to filter by a bounding box (rectangle). That is mostly used for things when a user navigates around a map and have a specific area shown.

Example for a bounding box search AirBnB:

Bildschirmfoto 2024-09-16 um 09 36 00


I did some research about it what input parameters most search engine uses:

Algolia, Elasticsearch / Opensearch are using Top Left -> Bottom Right ↘️

Meilisearch is using Top Right -> Bottom Left ↙️

For me it was little bit strange and unusually that Meilisearch did go here another way. But after some research I found out it totally make sense. The JS libraries Google Maps API and MapBox API returns NorthEast (TopRight) -> SouthWest (BottomLeft). meilisearch/specifications#223. I like that way to be similar to the JS libraries most people will use and think that make more sense to avoid converting to another way.

So I think the $north, $east, $south, $west or [$north, $east], [$south, $west] make most sense for input parameters.

Links to the different search engines docs about this can be found here: PHP-CMSIG/search#365 (comment).


Some search engine only support polygon. That might be a problem if you view on areas which are bigger as half the world map as polygon goes then the shorter way and than completly exclude the area you view. In a polygon based search on areas bigger half worldmap we would need fill things with additional coordinates to avoid that flip of the polygon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions