{"id":1462,"date":"2016-10-13T02:55:55","date_gmt":"2016-10-13T02:55:55","guid":{"rendered":"http:\/\/blogs.lincoln.ac.nz\/gis\/?p=1462"},"modified":"2023-05-07T03:51:18","modified_gmt":"2023-05-07T03:51:18","slug":"imagery-is-everything","status":"publish","type":"post","link":"https:\/\/blogs.lincoln.ac.nz\/gis\/imagery-is-everything\/","title":{"rendered":"Image(ry) is Everything"},"content":{"rendered":"<p><em>This post covers obtaining a high-resolution image of post-earthquake Christchurch and creating a mosaic dataset to manage it.<\/em><\/p>\n<p>It&#8217;s that time of year when the students in ERST310\/607 are hard at work on their independent GIS analysis projects; this also means a bit of trouble shooting at GIS Central.\u00a0 One student, who is looking at some habitat differences in Christchurch pre- and post-earthquakes, got in touch when trying to track down some decent (and recent) imagery for her project.\u00a0 She was wanting to derive land cover polygons from the image using some remote sensing techniques.\u00a0 A few options came to mind, firstly some imagery from ECan, a portion of which is shown below:<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/ECanImage.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1463\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/ECanImage.jpg\" alt=\"ecanimage\" width=\"861\" height=\"521\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/ECanImage.jpg 861w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/ECanImage-300x182.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/ECanImage-768x465.jpg 768w\" sizes=\"auto, (max-width: 861px) 100vw, 861px\" \/><\/a><\/p>\n<p>Gorgeous imagery, yes!\u00a0 This image has a resolution (pixel size) of around 0.5 m by 0.5 m which is pretty awesome, but the image has a few issues.\u00a0 The first relates to time &#8211; if you look closely you can satisfy yourself that this imagery is probably from the 2011; very possibly from 22 or 23 February given the lack of fences around the cathedral.\u00a0 You can even see people standing around taking it all in.\u00a0 So it&#8217;s probably from just after the 6.3 and doesn&#8217;t capture the changes in the urban fabric that may have displaced habitats (i.e. think about all those new housing subdivisions).\u00a0 The other problem is that this image is available as a web service rather than having the actual image.\u00a0 (We talked about <a href=\"http:\/\/blogs.lincoln.ac.nz\/gis\/canterburymaps-govt-nz-and-web-services\/\" target=\"_blank\" rel=\"noopener\">web services<\/a> in an earlier post and how they can be added to your maps.)\u00a0 This image was added to the map from the ECan servers.\u00a0 Unless the right kind of services are available, when a layer like this is added from the internet, we aren&#8217;t able to use it for analysis &#8211; at best it serves as a sort of basemap (not unlike the basemaps that we can add in ArcMap by clicking the wee arrow next to the Add Data button and going to &#8220;Add Basemaps&#8230;&#8221;).\u00a0 So while this one looks great on the map, all it can really do is sit there passively in the background and make our map look nice.<\/p>\n<p>So another approach was needed.\u00a0 While we do hold a lot of imagery on the <a href=\"http:\/\/blogs.lincoln.ac.nz\/gis\/data-data-everywhere-but-what-about-what-i-need\/\" target=\"_blank\" rel=\"noopener\">J: Drive<\/a>, it&#8217;s mostly pre- and just after the 2011 earthquakes, so wasn&#8217;t of much use to the student.\u00a0 Time to look at some <a href=\"http:\/\/blogs.lincoln.ac.nz\/gis\/the-data-i-need-arent-on-the-j-drive\/\" target=\"_blank\" rel=\"noopener\">data portal<\/a><a href=\"http:\/\/blogs.lincoln.ac.nz\/gis\/2013\/04\/03\/canterburymaps-govt-nz-and-web-services\/\" target=\"_blank\" rel=\"noopener\">s<\/a>, and the <a href=\"http:\/\/data.linz.govt.nz\">LINZ Data Service<\/a> in particular:<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/LDS.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1464\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/LDS.jpg\" alt=\"lds\" width=\"1364\" height=\"732\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/LDS.jpg 1364w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/LDS-300x161.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/LDS-1024x550.jpg 1024w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/LDS-768x412.jpg 768w\" sizes=\"auto, (max-width: 1364px) 100vw, 1364px\" \/><\/a><\/p>\n<p>Well that was almost too easy &#8211; the main entry is for a 0.075 m aerial photo of Christchurch circa 2015-16.\u00a0 Jackpot!\u00a0 The 0.075m refers to the resolution &#8211; each pixel of the image is 0.075 m by 0.075 m in size.\u00a0 That&#8217;s glorious!\u00a0 Next I added that layer to the map at right (by clicking on the &#8220;+&#8221;) to get some details on the image:<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/ImageOverview.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1465\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/ImageOverview.jpg\" alt=\"imageoverview\" width=\"703\" height=\"631\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/ImageOverview.jpg 703w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/ImageOverview-300x269.jpg 300w\" sizes=\"auto, (max-width: 703px) 100vw, 703px\" \/><\/a><\/p>\n<p>Good extent.\u00a0 Certainly can&#8217;t complain about the resolution.\u00a0 And it&#8217;s pretty much cloud free.\u00a0 The planets are aligning.\u00a0 The only major problem here is shown in the upper right hand corner: the image is 41 Gb in size.\u00a0 That&#8217;s a <a href=\"http:\/\/www.urbandictionary.com\/define.php?term=samolian\" target=\"_blank\" rel=\"noopener\">lotta samolians<\/a> (not so much in dollars as in gigabytes)!\u00a0 When I click on the Download, the problem becomes more apparent:<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/ExportOptions.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1466\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/ExportOptions.jpg\" alt=\"exportoptions\" width=\"622\" height=\"443\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/ExportOptions.jpg 622w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/ExportOptions-300x214.jpg 300w\" sizes=\"auto, (max-width: 622px) 100vw, 622px\" \/><\/a><\/p>\n<p>There&#8217;s a 3.5 Gb download limit.\u00a0 Plan B &#8211; note the window above that says &#8220;Original Resolution&#8221;.\u00a0 I can change the resolution which will reduce the file size.\u00a0 My options are1\/2, 1\/4 or 1\/8 the original resolution.\u00a0 With a bit of trial and error, I used the 1\/4 resolution as JP2 images to get the download below the 3.5 Gb limit.\u00a0 This ends up with a resolution of around 300 cm.\u00a0 The download gets packaged as a zip file which you then download but once I had that locally, another problem emerged.\u00a0 This image gives you a sense of the problem:<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/Explorer.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1467\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/Explorer.jpg\" alt=\"explorer\" width=\"790\" height=\"568\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/Explorer.jpg 790w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/Explorer-300x216.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/Explorer-768x552.jpg 768w\" sizes=\"auto, (max-width: 790px) 100vw, 790px\" \/><\/a><\/p>\n<p>Instead of having one whopping great image, I&#8217;ve actually got several thousand files, 27,973 to be exact.\u00a0 Some of these are images (the *.jp2s &#8211; 6,993 of those) some are xml files that have metadata, and some are *.j2w files (these are small text files that tell ArcMap where to place the images).\u00a0 This isn&#8217;t an uncommon approach with images that cover large areas &#8211; it is broken up into a collection of tiles that match up and fit together to cover the area.\u00a0 Each file is prefixed with something like &#8220;BW23_500_XXXXXX&#8221;.\u00a0 The &#8220;BW##&#8221; part relates to the 1:50,000 scale topo map sheet that the tile sits within (Christchurch is covered by BW23 &amp; 24, BX23, 24 &amp; 25, and BY25).\u00a0 The 500 relates to the tiling scheme and the six digits that follow give each tile a unique identifier.<\/p>\n<p>So, what to do, what to do.\u00a0 This poor student can&#8217;t add 6,993 separate images and then do her remote sensing analysis on each one &#8211; she&#8217;ll either lose her sanity (which she might anyway, that&#8217;s GIS) or way overshoot the project deadline.\u00a0 Enter <a href=\"http:\/\/desktop.arcgis.com\/en\/arcmap\/10.3\/manage-data\/raster-and-images\/what-is-a-mosaic-dataset.htm\" target=\"_blank\" rel=\"noopener\" data-wplink-edit=\"true\">Mosaic Datasets<\/a>!\u00a0 These data structures are perfect for this problem.\u00a0 When finished, the mosaic dataset stitches together all the tiles into a seamless whole that can be added and draws much more quickly than a collection of tiles.\u00a0 Plus, they are honoured by analysis tools so will significantly help this cause.<\/p>\n<p>To create the dataset, we first need a geodatabase to hold it.\u00a0 In the J:\\Data\\Christchurch\\Imagery folder I created a new file geodatabase called &#8220;ChristchurchImage2015&#8221;.\u00a0 Inside that, I created a new mosaic dataset by right-clicking on the GDB and going to New &gt; Mosaic Dataset.\u00a0 This I called &#8220;CHC2015&#8221;.\u00a0 At this point, it&#8217;s an empty container, so to fill it up, I right-clicked on the dataset name and went to &#8220;Add Rasters&#8230;&#8221;<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/AddRasters.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1468\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/AddRasters.jpg\" alt=\"addrasters\" width=\"766\" height=\"522\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/AddRasters.jpg 766w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/AddRasters-300x204.jpg 300w\" sizes=\"auto, (max-width: 766px) 100vw, 766px\" \/><\/a><\/p>\n<p>The tool that opens lets you set which images to add.\u00a0 Happily, I can point it at a folder (workspace) rather than all the individual files and it will add all the images in that folder:<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/AddRasterTool.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1469\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/AddRasterTool.jpg\" alt=\"addrastertool\" width=\"464\" height=\"442\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/AddRasterTool.jpg 464w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/AddRasterTool-300x286.jpg 300w\" sizes=\"auto, (max-width: 464px) 100vw, 464px\" \/><\/a><\/p>\n<p>Click OK and off it goes.\u00a0 When finished I can add this to a map:<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/Footprints.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1471\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/Footprints.jpg\" alt=\"footprints\" width=\"1361\" height=\"728\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/Footprints.jpg 1361w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/Footprints-300x160.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/Footprints-1024x548.jpg 1024w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/Footprints-768x411.jpg 768w\" sizes=\"auto, (max-width: 1361px) 100vw, 1361px\" \/><\/a><\/p>\n<p>The green boxes show the outline (the footprints) of each of the tiles, so we can see there is good coverage across urban Christchurch and a smattering across Banks Peninsula to the southeast.\u00a0 To see the actual images we need to zoom in.\u00a0 I&#8217;ll do that in two steps.\u00a0 First we&#8217;ll zoom in far enough that we can see the labels for each tile:<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/FootprintLabels.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1472\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/FootprintLabels.jpg\" alt=\"footprintlabels\" width=\"1357\" height=\"723\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/FootprintLabels.jpg 1357w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/FootprintLabels-300x160.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/FootprintLabels-1024x546.jpg 1024w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/FootprintLabels-768x409.jpg 768w\" sizes=\"auto, (max-width: 1357px) 100vw, 1357px\" \/><\/a><\/p>\n<p>And then we&#8217;ll turn on the image:<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/ImageWithFootprints.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1473\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/ImageWithFootprints.jpg\" alt=\"imagewithfootprints\" width=\"1360\" height=\"726\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/ImageWithFootprints.jpg 1360w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/ImageWithFootprints-300x160.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/ImageWithFootprints-1024x547.jpg 1024w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2016\/10\/ImageWithFootprints-768x410.jpg 768w\" sizes=\"auto, (max-width: 1360px) 100vw, 1360px\" \/><\/a><\/p>\n<p>Now we&#8217;re talkin&#8217;!\u00a0 With this image you can see how the central city has been transformed.\u00a0 We haven&#8217;t lost a lot by working with a mere 300 cm resolution and, more importantly, the student can now get on with her analysis.<\/p>\n<p>This mosaic dataset is available for your use.\u00a0 Have a look in J:\\Data\\Christchurch\\Imagery\\ChristchurchImage2015\\CHC2015 and add it to your map.\u00a0 The mosaic dataset allows us to work seamlessly with a sizeable collection of individual image tiles as if it were one image.\u00a0 It will load and draw faster this way and if we were interested in serving this image up on the GIS server, the mosaic dataset is optimised to do this efficiently.\u00a0 And mosaic datasets aren&#8217;t just for imagery.\u00a0 They can be used with any collection of raster grids, be it elevation, or aspect, or slope, or whatever.<\/p>\n<p>One important thing to note is that the images aren&#8217;t actually &#8220;inside&#8221; the mosaic dataset.\u00a0 On its own, the dataset is quite small.\u00a0 It basically references all the raster by maintaining a list of the layer and where they are stored.\u00a0 The footprints and boundary layers are a part of the dataset but not the images themselves.\u00a0 All brought to you through the power of geodatabases.<\/p>\n<p>C<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post covers obtaining a high-resolution image of post-earthquake Christchurch and creating a mosaic dataset to manage it. It&#8217;s that time of year when the students in ERST310\/607 are hard at work on their independent GIS analysis projects; this also means a bit of trouble shooting at GIS Central.\u00a0 One student, who is looking at [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1462","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts\/1462","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/comments?post=1462"}],"version-history":[{"count":1,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts\/1462\/revisions"}],"predecessor-version":[{"id":4143,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts\/1462\/revisions\/4143"}],"wp:attachment":[{"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/media?parent=1462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/categories?post=1462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/tags?post=1462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}