SimonFisher92 / Scottish_Snow

2 stars 0 forks source link

geojson for each snowpatch from coords provided by Iain Cameron #8

Closed SimonFisher92 closed 9 months ago

SimonFisher92 commented 10 months ago

The geojson provided by Murray informs the ROI for sentinel data download. Currently, this focuses on the cairngorm region. To save time, memory and cost, we should be constructing geojsons for the the list of coordinates provided by Iain, these cover the dominant and important snowpatches in Scotland.

murraycutforth commented 9 months ago

FYI @SimonFisher92 I just fed some of the geojsons into this web page https://geojson.io/#map=2/22.81/14.7 to double check, and it showed me something in the Indian Ocean, because they were expecting (lon, lat) and we currently have it in (lat, lon).

When I googled it there seems like a lot of controversy about which way is correct!

murraycutforth commented 9 months ago

Okay I've also realised that maybe a constant offset in lat and lon isn't suitable, because it results in rectangular boxes at high latitudes.

Here's an example using the An Stuc snow patch:

image

It's down to the trigonometry, the distance per degree of latitude is constant at 2*pi*R / 360, whereas the distance per degree of longitude is dependent on the latitude (call this theta): 2*pi*R*cos(theta) / 360.

At ~56 degrees of latitude, the cos(theta) term equals 0.85, so we should use a longitude offset which is larger by a factor of 1 / 0.85 to get square bounding boxes.

I've implemented this in a way which computes the correction term on the fly so we're not hardcoding 0.85 in there, and it looks like it works:

image

I think I deleted the branch you made for this so I'll make a new branch/PR with this in.

murraycutforth commented 9 months ago

One more question for you @SimonFisher92.

I've just given all the boxes a quick check, and the one which is labelled Nevis Gullies is actually over Aonach Beag. Maybe a mistake in the coords?

image

SimonFisher92 commented 9 months ago

Yes, its Aonach Beag! Sorry, that was a carryover- excellent spot