Monthly Archives: July 2015

Testing Geospatial claims using Qgis, CartoDB and Cesium.js

andersnatten
This summer I hiked to Andersnatten, a rather small mountain in the southeast of Norway. On the start of the trail there was a sign, that among other things, said that you can see 7 parishes from the top. When we reached the top we had a great view, but I couldn’t see any parishes.. That is, I have no idea where the parishes are, so I couldn’t refute or confirm the claim.

Beeing a geospatial geek I thought that this should be possible to remedy. I just needed the Parishes as polygons, and then I could do some analysis. Well, turns out that I couldn’t find any georeferenced parishes. The closes I got was these scanned paper maps. I couldn’t let this stop me, so I opened Qgis and set to work. Luckily the parish borders resembles modern day municipality borders rather close, so with the georeferenced paper maps, and some other Qgis magic (perhaps more on this in a later blog post) I managed to digitize all the 315 parishes from 1801.

I then loaded these digitized parish polygons into cartodb, and colored the ones around Sigdal, the parish where Andersnatten is. The map turned out like this:

With this in place it was rather certain that 7 was a reasonable amount, there are 6 parishes sharing a border with Sigdal, these should be see-able. According to this article “Dust, water vapour and pollution in the air will rarely let you see more than 20 kilometres (12 miles), even on a clear day.”

Ok, 20 km, lets see how close the 7 nearest parishes are to Andersnatten, using a PostGIS query in Cartodb:

SELECT 
	name,
	ST_Distance(
      the_geom::geography,
      ST_SetSRID(
        ST_MakePoint(9.41677103, 60.11744509),
        4326
      )::geography) / 1000 as dist
FROM prestegjeld
ORDER BY dist
LIMIT 7

This gives

Sigdal      0
Rolloug     5.818130882558
Flesberg    13.510679336426
Modum       19.686924594812
Næss        20.103683955646
Nordrehoug  22.199498534301
Tind        24.804343832136

Ok, so the farthest parish of the seven are 24 kms away, give us some leeway since we are on a 733 m high peak. Interestingly, the closes ones doesn’t overlap with neighboring parishes.

Ok, but, line of sight? What if there are other mountains blocking the view? Since I’m already working on a Cesium.js project I decided to add the CartoDB map to a 3d Model and do some visual tests.

View North
View North

View Southeast
View Southeast

View South
View South

View West
View West

Oh, that’s a suprise. Ok, Cesium does not add “dust, water vapour or air pollution”, and the height model might be a bit off, but nonetheless: 13 (possibly 14) parishes can be seen in this model! That is double the number stated on the sign! Guess they have backing for their claim after all!

Oh, by the way: the digitized parishes are available at GitHub