## Find features near a geographic point `client.elements.nearbyPost(ElementNearbyPostParamsparams?, RequestOptionsoptions?): FeatureCollection` **post** `/api/v1/features/nearby` Find features near a geographic point ### Parameters - `params: ElementNearbyPostParams` - `lat?: number` Legacy shorthand. Latitude (-90 to 90). Use near param instead. - `limit?: number` Maximum results (default 20, max 100) - `lng?: number` Legacy shorthand. Longitude (-180 to 180). Use near param instead. - `near?: string` Point geometry for proximity search (lat,lng or GeoJSON). Alternative to lat/lng params. - `outputBuffer?: number` Buffer geometry by meters - `outputCentroid?: boolean` Replace geometry with centroid - `outputFields?: string` Comma-separated property fields to include - `outputGeometry?: boolean` Include geometry (default true) - `outputInclude?: string` Extra computed fields: bbox, distance, center - `outputPrecision?: number` Coordinate decimal precision (1-15, default 7) - `outputSimplify?: number` Simplify geometry tolerance in meters - `outputSort?: string` Sort by: distance, name, osm_id - `radius?: number` Search radius in meters (default 500, max 10000) ### Returns - `FeatureCollection` GeoJSON FeatureCollection (RFC 7946). For paginated endpoints, metadata is returned in HTTP response headers rather than the body: | Header | Description | | --------------- | ------------------------------------------------ | | `X-Limit` | Requested result limit | | `X-Has-More` | `true` if more results exist | | `X-Next-Cursor` | Opaque cursor for next page (cursor pagination) | | `X-Next-Offset` | Numeric offset for next page (offset pagination) | | `Link` | RFC 8288 `rel="next"` link to the next page | Content-Type is `application/geo+json`. - `features: Array` Array of GeoJSON Feature objects - `geometry: GeoJsonGeometry` GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints. - `coordinates: Array | Array> | Array>> | Array>>>` Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc. - `Array` - `Array>` - `Array>>` - `Array>>>` - `type: "Point" | "LineString" | "Polygon" | 3 more` Geometry type - `"Point"` - `"LineString"` - `"Polygon"` - `"MultiPoint"` - `"MultiLineString"` - `"MultiPolygon"` - `properties: Record` OSM tags flattened as key-value pairs, plus `@type` (node/way/relation) and `@id` (OSM ID) metadata fields. May include `distance_m` for proximity queries. - `type: "Feature"` Always `Feature` - `"Feature"` - `id?: string` Compound identifier in `type/osm_id` format - `type: "FeatureCollection"` Always `FeatureCollection` - `"FeatureCollection"` ### Example ```typescript import Plaza from '@plazafyi/sdk'; const client = new Plaza({ apiKey: process.env['PLAZA_API_KEY'], // This is the default and can be omitted }); const featureCollection = await client.elements.nearbyPost(); console.log(featureCollection.features); ``` #### Response ```json { "features": [ { "geometry": { "coordinates": [ 2.3522, 48.8566 ], "type": "Point" }, "properties": { "@id": "bar", "@type": "bar", "amenity": "bar", "cuisine": "bar", "name": "bar" }, "type": "Feature", "id": "node/21154906" } ], "type": "FeatureCollection" } ```