City boundary
dv_boundaryGet city bounding boxes or neighbourhood polygons from Divar's GeoJSON. Use to draw areas or test points against boundaries.
Instructions
Neighbourhood borders of a city from Divar's GeoJSON: the city's bounding box, or one neighbourhood's polygon.
Without district: the city bounding box [min_lon, min_lat, max_lon, max_lat] and the neighbourhoods with id, centre
and box. With district: a GeoJSON Feature of that neighbourhood (coordinates [lon, lat], thinned to max_points
per ring, so the shape is approximate). Use to draw an area or test a point against it; for a point's own
neighbourhood use dv_locate. Next: dv_nearby with the centre.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| city | No | City name or id; several comma-separated, e.g. 'تهران', 'mashhad', 'تهران,کرج'. | تهران |
| limit | No | Max neighbourhoods listed in the overview. | |
| district | No | A neighbourhood name or id (e.g. 'ونک', '315') to get its polygon. Omit for the city's bounding box and its neighbourhoods. | |
| max_points | No | Max vertices per polygon ring (the full outline is thinned). |