GeoJSON Endpoint

You can obtain GeoJSON data by appending the `geojson` query parameter to a regional GET request, as explained in GET SubRegion. If you want to retrieve GeoJSON data for a set of subregions within a country, you would typically need to make separate requests for each subregion. This can be avoided by using the GeoJSON endpoint for a country and specifying the subregion level for which you want to retrieve the data.


# Retrieve country resource with GeoJSON
>>> url = "https://www.the-datagarden.io/country/netherland/geojson/"
>>> headers = {'Content-Type': 'application/json', 'Authorization': 'Bearer <access_token>'}
>>> payload = {"region_level": 1}
>>>
>>> response = requests.request("POST", url, headers=headers, payload=payload)	
>>> print(response.json())

		

The response to this request will be a FeatureCollection. It contains a feature for each region, with the GeoJSON included as geometry.


{
	"type": "FeatureCollection",
	"features": [
		{
			"type": "Feature",
			"geometry": {
				"type": "MultiPolygon",
				"coordinates": [ ... ]
			},
			"properties": {
				"name": "Noord-Nederland",
				"region_level": 1,
				"iso_cc_2": "NL",
				"local_region_code": "NL1",
				"local_region_code_type": "nuts_code"
			}
		},
		{ ... next region ... }
	]
}			

Part of the response for the Netherlands returns a list of regions with properties and the GeoJSON geometry.

Note that When retrieving GeoJSON data for a large group of regions, responses might be paginated to manage response sizes effectively. See Pagination for more information.