LGA boundaries
GET
https://api.ai4mproject.com/v1/boundaries/lgasScope: lga_boundariesReturns the outline of every LGA in one state as a GeoJSON FeatureCollection.
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
state |
string | Yes | Two-letter state code, such as KN |
Parameters go in the query string.
Request
Section titled “Request”curl "https://api.ai4mproject.com/v1/boundaries/lgas?state=KN" \ -H "Authorization: Bearer $AI4M_API_KEY"shapes = client.get_lga_boundaries("KN")for feature in shapes["features"]: print(feature["properties"]["lgaCode"])const shapes = await client.getLgaBoundaries("KN");for (const feature of shapes.features) { console.log(feature.properties.lgaCode);}shapes, err := client.LGABoundaries(ctx, "KN")if err != nil { log.Fatal(err)}fmt.Println(len(shapes["features"].([]any)), "LGAs")Response
Section titled “Response”| Field | Type | Description |
|---|---|---|
type |
string | Always FeatureCollection |
source |
string | Where the shapes come from |
features[].properties.lgaCode |
string | LGA identifier, matching lga_code in the risk endpoints |
features[].properties.lga |
string | LGA name |
features[].properties.state |
string | Two-letter state code |
features[].geometry |
object | A GeoJSON Polygon or MultiPolygon, in longitude and latitude (WGS 84) |
{ "type": "FeatureCollection", "source": "GADM 4.1, simplified", "features": [ { "type": "Feature", "properties": { "state": "KN", "lga": "Ajingi", "lgaCode": "NGA.20.1_1" }, "geometry": { "type": "Polygon", "coordinates": [ "…" ] } }, { "type": "Feature", "properties": { "state": "KN", "lga": "Albasu", "lgaCode": "NGA.20.2_1" }, "geometry": { "type": "Polygon", "coordinates": [ "…" ] } } ]}The example shows two of Kano’s 44 LGAs, with coordinates left out.
Errors
Section titled “Errors”| Code | Status | When |
|---|---|---|
UNKNOWN_STATE |
404 | state is missing or is not a valid state code |
SCOPE_REQUIRED |
403 | The key does not include the scope this endpoint needs |
Any request can also return 401 for a bad key and 429 when a limit is reached. See Errors.