get_bounds
Convert a location name or coordinate geometry into a bounding box. Handles WKT, GeoJSON, and raw strings, outputting in various formats.
Instructions
Get converted coordinates for a bounding box or text location search. Supports parsing WKT, GeoJSON, ogrinfo extent, and raw coordinate strings. If MAPBOX_ACCESS_TOKEN is not set, you MUST provide explicit coordinates via 'bbox'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| location | No | A text location to search for (e.g. 'New York City'). Requires MAPBOX_ACCESS_TOKEN env var. Either 'location' or 'bbox' MUST be provided. | |
| bbox | No | The geometry to parse. Can be a raw bounding box string ('lat1,lng1,lat2,lng2'), a WKT polygon/linestring/point, a GeoJSON payload, or an `ogrinfo` extent block. The Minimum Bounding Rectangle (MBR) encapsulating the geometry will be extracted. Either 'location' or 'bbox' MUST be provided. | |
| epsg | No | The projected EPSG code (e.g. '3857'). Defaults to '4326' (WGS84). Over 3,900 bundled projections; unknown codes are auto-fetched from epsg.io. | |
| format | No | Format of the output. Options: wkt, geojson-bbox, leaflet, overpass, ogc-bbox, kml, geojson-polygon, csv, stac-bbox. Default: csv. | |
| coord_order | No | Toggle between 'lng,lat' (default) and 'lat,lng' coordinate ordering in the formatted output. Useful for APIs that expect swapped coordinate orders. | |
| zoom | No | The map zoom level (0-22) used to calculate the map tile coordinates for the centroid. Defaults to 15. | |
| precision | No | The number of decimal places to output coordinate strings as (defaults to 6). |