{"id":35,"date":"2020-04-04T07:00:00","date_gmt":"2020-04-04T07:00:00","guid":{"rendered":"http:\/\/wcwp.rf.gd\/2020\/04\/04\/https-landscapearchaeology-org-2020-wgs\/"},"modified":"2020-04-04T07:00:00","modified_gmt":"2020-04-04T07:00:00","slug":"wgs","status":"publish","type":"post","link":"https:\/\/landscapeanalysis.org\/?p=35","title":{"rendered":"Name the enemy: geographic projections in GIS"},"content":{"rendered":"<p>So, you have your data, you\u2019ve installed a GIS program \u2026 and there we go: slope gradient \u2013 check, solar exposition \u2013 check, water drainage \u2013 check, visibility range \u2013 check \u2026<\/p>\n<p>But somehow, the outputs don\u2019t seem right: things don\u2019t fall where they should, values go off by hundreds and your maps just look strange.<\/p>\n<p>Nine out of ten cases when QGIS plugins that I maintain \u201cdo not work\u201d are due to geographic projection errors. Based on this experience, and on what I see around, I would go as far as to estimate that <strong>the majority of raster based GIS analyses being done today is flawed<\/strong>. The main reason is the lack of proper projection management. Don\u2019t believe me? Take a look at your own models, after having read this.<\/p>\n<p>Simply put, modern GIS works with just about anything that can be thrown inside. So, let\u2019s try a visibility analysis with a piece of freely available SRTM elevation model (<a href=\"https:\/\/www2.jpl.nasa.gov\/srtm\/\">provided by NASA<\/a>). I\u2019m using <a href=\"http:\/\/www.saga-gis.org\/\">SAGA GIS<\/a> software.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-medium wp-image-67\" src=\"http:\/\/landscapearchaeology.org\/wp-content\/uploads\/figures-jekyll\/20-04-04-viewshed1.jpg\" alt=\"viewshed1\" \/><br \/>\n<em>Viewshed analysis made over a raw SRTM dataset (observer point is marked by an orange dot).<\/em><\/p>\n<p>Whoa ! How come the visible range has a shape of an ellipse ? Well, we can make it round, but then the background topography gets unrealistically stretched out.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-medium wp-image-67\" src=\"http:\/\/landscapearchaeology.org\/wp-content\/uploads\/figures-jekyll\/20-04-04-viewshed2.jpg\" alt=\"viewshed2\" \/><\/p>\n<p>What is happening here? Let\u2019s take a look at the information associated with our elevation data.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-medium wp-image-67\" src=\"http:\/\/landscapearchaeology.org\/wp-content\/uploads\/figures-jekyll\/20-04-04-wgs.jpg\" alt=\"WGS84\" \/><\/p>\n<p>We can see that our data is in degrees, and that our pixel size is 0.000-something, which cannot be meters (in that case, a pixel would be smaller than a millimetre!). What does a degree unit look like ? Well, we can only represent it in 3D because it is curved in 3 dimensions: figure below.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-medium wp-image-67\" src=\"http:\/\/landscapearchaeology.org\/wp-content\/uploads\/figures-jekyll\/20-04-04-shema.jpg\" alt=\"grids\" \/><br \/>\n<em>One angular unit in a latitude\/longitude grid vs one pixel unit in an image grid.<\/em><\/p>\n<p>Latitude\/longitude grid, such as the one above, can be seen in any GIS manual and is commonly featured on maps. How come, then, that it causes problems in GIS? Well, the truth is that <strong>the majority of raster GIS modules borrow their design from image analysis algorithms<\/strong>. These feed on pixel grids and don\u2019t care about geography. The problem with our visibility analysis is that it interpreted elongated, curved units as square pixels.<\/p>\n<p>What your GIS program sees is in most cases just an image composed of supposedly square pixels. Deformed angular units will totally skew the result. This is valid for almost any raster based analysis.<\/p>\n<p><iframe loading=\"lazy\" frameborder=\"0\" class=\"juxtapose\" width=\"100%\" height=\"820\" src=\"https:\/\/cdn.knightlab.com\/libs\/juxtapose\/latest\/embed\/index.html?uid=7b84c048-7694-11ea-a879-0edaf8f81e27\"><\/iframe><\/p>\n<p>These two hillshades were made using QGIS Hillshade algorithm. The one made over un-projected dataset is stretched to its full value range, its shading cannot be adjusted any further. Apparently, it is pretty much useless. Note, however, that I chose a piece of terrain from Norway, where the angular deformation is rather extreme as meridians converge in direction of the North Pole. Analysis bias will diminish progressively as we move south \u2013 but it will never disappear completely.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-medium wp-image-67\" src=\"http:\/\/landscapearchaeology.org\/wp-content\/uploads\/figures-jekyll\/20-04-04-wgs2.jpg\" alt=\"WGS84\" \/><\/p>\n<p>We can now name our enemy: it is called WGS 84 and its code is 4326. It\u2019s an imposter, a fake, it purports to be a valid geographic projection but it\u2019s not. Yes, most of available remotely sensed data is in WGS 84 <em>coordinate reference system<\/em>, but this only means that the data <strong>lacks<\/strong> a proper projection. WGS 84 is just a flag telling you <strong>not<\/strong> to do anything with the data before projecting it.<\/p>\n<h2 id=\"recap\">Recap<\/h2>\n<p>Modern GIS software has automated coordinate transformations, but it is unfortunately too permissive, especially concerning raster data. The worst thing is that errors are often difficult to perceive and even less so to understand. Your hillshade is a little too shady when you change the sun angle: it must be the QGIS algorithm, right?<\/p>\n<p>If you are a regular GIS user, I\u2019m challenging you: how many WGS 84 hillshades are sitting on your computer? Did you take pain to re-evaluate your data accuracy after re-projection?<\/p>\n<p>Geographic projections will continue to bother us and trusting in GIS automation is definitely not the way to go. Quite often, things \u201cwork\u201d just because the software is too forgiving. Conversely, some other algorithms \u201cdo not work\u201d (such as my Viewshed analysis module) because they are less permissive, not because they\u2019re broken. So, as soon as you download your WGS 84 data, re-project it and delete WGS84 files from your computer, your GIS life will be easier\u2026<\/p>\n<h2 id=\"ps\">PS<\/h2>\n<p>You can find an interactive example of projection distorsions at <a href=\"https:\/\/mathigon.org\/course\/circles\/spheres-cones-cylinders#sphere-maps\">https:\/\/mathigon.org\/course\/circles\/spheres-cones-cylinders#sphere-maps<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, you have your data, you\u2019ve installed a GIS program \u2026 and there we go: slope gradient \u2013 check, solar exposition \u2013 check, water drainage \u2013 check, visibility range \u2013 check \u2026 But somehow, the outputs don\u2019t seem right: things don\u2019t fall where they should, values go off by hundreds and your maps just look [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-35","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/landscapeanalysis.org\/index.php?rest_route=\/wp\/v2\/posts\/35","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/landscapeanalysis.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/landscapeanalysis.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/landscapeanalysis.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/landscapeanalysis.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=35"}],"version-history":[{"count":0,"href":"https:\/\/landscapeanalysis.org\/index.php?rest_route=\/wp\/v2\/posts\/35\/revisions"}],"wp:attachment":[{"href":"https:\/\/landscapeanalysis.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=35"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/landscapeanalysis.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=35"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/landscapeanalysis.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=35"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}