observation-js Documentation - v1.14.0
    Preparing search index...

    Class Locations

    Index

    Constructors

    Methods

    • Searches for locations by name or by proximity to a geographic point.

      Parameters

      • params: { name?: string } | { lat: number; lng: number }

        The search parameters, either a name string or a lat/lng coordinate pair.

      Returns Promise<Paginated<Location>>

      A promise that resolves to a paginated list of matching locations.

      If the request is not authenticated.

      If the request fails.

    • Retrieves the details for a single location by its ID.

      Parameters

      • id: number

        The unique identifier of the location.

      Returns Promise<Location>

      A promise that resolves to the location object.

      If the request is not authenticated.

      If the request fails.

    • Lists all species seen at a specific location, with optional filters.

      Parameters

      • id: number

        The unique identifier of the location.

      • params: {
            end_date?: string;
            days?: number;
            species_group?: number;
            rarity?: number;
            fast?: boolean;
        } = {}

        Optional query parameters to filter the results (e.g., date, species group).

      Returns Promise<{ results: SpeciesSeen[] }>

      A promise that resolves to a list of species seen at the location.

      If the request is not authenticated.

      If the request fails.

    • Lists all species seen in a radius around a specified point, with optional filters.

      Parameters

      • params: {
            lat: number;
            lng: number;
            radius?: number;
            end_date?: string;
            days?: number;
            species_group?: number;
            rarity?: number;
            fast?: boolean;
            order_by?: string;
        }

        The query parameters, including lat, lng, and optional radius, filters, etc.

      Returns Promise<{ results: SpeciesSeen[] }>

      A promise that resolves to a list of species seen around the point.

      If the request is not authenticated.

      If the request fails.

    • Fetches a GeoJSON FeatureCollection with location geometry and properties. This is a public endpoint.

      Parameters

      • params: { point: string; model?: string } | { id: number; model?: string }

        The query parameters, can be a point (WKT format) or a location id.

      Returns Promise<GeoJSONFeatureCollection<GeoJSONGeometry>>

      A promise that resolves to a GeoJSON FeatureCollection.

      If the request fails.