Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import Woodland Trust woods #543

Open
zarino opened this issue May 1, 2024 · 0 comments
Open

Import Woodland Trust woods #543

zarino opened this issue May 1, 2024 · 0 comments

Comments

@zarino
Copy link
Member

zarino commented May 1, 2024

According to their About page, the Woodland Trust manages "over 1000" woods in the UK.

We could ask them for a list of these woods. (Shapefiles would be even better – then we can calculate overlaps with constituencies and local authority boundaries.)

Or we could scrape the list from their website. Their "Find woods" page uses ajax to query a database of these woods. It’s clever enough to reject requests that don’t look like they’re coming from a browser, but if you call something like:

curl 'https://www.woodlandtrust.org.uk/umbraco/api/woodspages/SearchWoodsNearAll?lat=54.093409&lng=-2.89479&distance=999999' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:125.0) Gecko/20100101 Firefox/125.0'

You get back a JSON object with 5000 items, that looks like:

{
  "Id": 400,
  "Name": "Storeton Woods, Higher Bebington",
  "Description": null,
  "ConsultationEndDate": null,
  "Latitude": 53.3567499631435,
  "Longitude": -3.03314689520446,
  "GridReference": null,
  "Location": "Higher Bebington",
  "Features": 0,
  "Area": 12.71,
  "Landranger": null,
  "Explorer": null,
  "WoodNames": null,
  "Hash": null,
  "IsWoodlandTrust": true,
  "Owner": "Woodland Trust",
  "WoodGroupId": 4400,
  "WoodGroupName": "Storeton Woods",
  "WoodsInGroup": 1,
  "WoodGroupLatitude": null,
  "WoodGroupLongitude": null,
  "ItemType": "Wood"
}

I can’t guarantee this is a list of all woods, only the ones within a distance=999999 of Morecambe Bay, the centre of the UK. But upping the distance doesn’t increase the item count beyond 5000. Such a round number is suspicious, I expect we’re hitting an internal cap. Perhaps it might be worth trying coordinates at different ends of the country, and checking whether the same 5000 items are always returned.

We’d probably want to investigate what happens when items have a WoodsInGroup value higher than 1, and also what the different values are for Owner, IsWoodlandTrust, and ItemType.

@zarino zarino added this to the Movement data push milestone May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant