{"id":320,"date":"2012-11-08T07:16:00","date_gmt":"2012-11-08T07:16:00","guid":{"rendered":"http:\/\/dbbd.sg\/blog\/uncategorized\/geocoding-from-the-streets-to-adobe-bridge-and-then-excel-part-i\/"},"modified":"2022-03-09T07:35:30","modified_gmt":"2022-03-09T07:35:30","slug":"geocoding-from-the-streets-to-adobe-bridge-and-then-excel-part-i","status":"publish","type":"post","link":"https:\/\/dbbd.sg\/blog\/2012\/11\/geocoding-from-the-streets-to-adobe-bridge-and-then-excel-part-i\/","title":{"rendered":"Geocoding: From the streets to Adobe Bridge and then Excel (Part I)"},"content":{"rendered":"<p>This is a documentation post for my own record on how I will produce a map of 180 date points that I have collected so far. To be honest I&#8217;m not a real programmer or anything like that, so the methods used in this post might be desultory or silly. I&#8217;m helplessly flapping about here. I&#8217;d be happy to hear of what method others would use! But in the absence of any external assistance&#8230;&#8230;..<\/p>\n<p>So the situation thus far is that all the images I have taken have been geotagged by default in iPhone 4, and I want to pull the metadata out into csv (comma separated values) and then bring into something like TileMill where I can produce a proper map of it all.<\/p>\n<p><center><img loading=\"lazy\" class=\"alignnone size-full wp-image-4464\" src=\"https:\/\/dbbd.sg\/blog\/wp-content\/uploads\/2022\/03\/8166021546_03c481c032_o.png\" width=\"422\" height=\"653\" alt=\"Screen Shot 2012-11-08 at 6.49.15 AM.png\" srcset=\"https:\/\/dbbd.sg\/blog\/wp-content\/uploads\/2022\/03\/8166021546_03c481c032_o.png 422w, https:\/\/dbbd.sg\/blog\/wp-content\/uploads\/2022\/03\/8166021546_03c481c032_o-194x300.png 194w, https:\/\/dbbd.sg\/blog\/wp-content\/uploads\/2022\/03\/8166021546_03c481c032_o-300x464.png 300w\" sizes=\"(max-width: 422px) 100vw, 422px\" \/><\/center>Viewing Metadata in Adobe Bridge<br \/>\nBut first, the drudgery. I needed to batch export the filenames and gps data from all my images. Unfortunately there was no instant readymade solution for this online that I could immediately find. Like with Illustrator and Flash&#8217;s automation scripts, what I ended having to do was to write a simple Adobe Bridge script to export all the information&#8230;<\/p>\n<p>To find the location for your Bridge scripts, go to Preferences &gt; Click on &#8220;Reveal My Startup Scripts&#8221; to see the folder in Finder. I found a <a href=\"http:\/\/www.ps-scripts.com\/bb\/viewtopic.php?t=886\">script on a forum<\/a> and adapted it slightly (quick and dirty) to include the GPS data. Save it as a .jsx file and drop it into the Startup Scripts folder. Because Bridge is silly, you will have to close and reopen Bridge in order for the script to load &#8211; apparently you can&#8217;t load it on the fly while Bridge is open. With this script, a new menu item will appear under tools: &#8220;<b>Export CSV file<\/b>&#8221;<\/p>\n<p><center><img loading=\"lazy\" class=\"alignnone size-full wp-image-4468\" src=\"https:\/\/dbbd.sg\/blog\/wp-content\/uploads\/2022\/03\/8166134224_dd53061187_o.png\" width=\"753\" height=\"488\" alt=\"Screen Shot 2012-11-08 at 7.09.29 AM.png\" srcset=\"https:\/\/dbbd.sg\/blog\/wp-content\/uploads\/2022\/03\/8166134224_dd53061187_o.png 753w, https:\/\/dbbd.sg\/blog\/wp-content\/uploads\/2022\/03\/8166134224_dd53061187_o-300x194.png 300w, https:\/\/dbbd.sg\/blog\/wp-content\/uploads\/2022\/03\/8166134224_dd53061187_o-640x415.png 640w\" sizes=\"(max-width: 753px) 100vw, 753px\" \/><\/center>Export to CSV<br \/>\nFor some reason, iPhone&#8217;s geodata is formatted in degrees:minutes:seconds rather than decimal degrees, and on top of that &#8211; confusingly \u00ba (degree) is replaced by comma and minutes by full stop, e.g:<\/p>\n<p><b>48,49.8N 2,22.13E<\/b><\/p>\n<p>I wonder why that is so by default. I suppose I understand it but let me tell you if you just plug this into TileMill it wont be read because of the wrong delimiters and I suspect it also requires decimal degrees (DD) instead of degrees-minutes-seconds (DMS). Cue the furious googling of &#8220;HOW DOES I CONVERT DMS TO DD?&#8221;<\/p>\n<p>Anyway back to the batch exporting of metadata to Excel. The data is saved in different namespaces such as the &#8220;exif&#8221; and &#8220;photoshop&#8221; data. EXIF stands for Exchangeable image file format and this is the format for the storage of metadata in files such as images and also audio files. You need to invoke the right namespace to find the right property. For example I realised that the Date Created in both exif and photoshop are different because only files that have been edited within photoshop have got a Date Created stamp (do note the property names also differ slightly in syntax although they may describe similar types of properties).<\/p>\n<p>I eventually figured out which namespace the gps data resided in (EXIF). I don&#8217;t know why it isn&#8217;t more straightforward to find a reference for all these things. Anyway since we are on the topic, this is a list of standard Namespaces; from these different namespaces you can search for the properties you are looking for so you can call them up:<\/p>\n<p>IPTC Core: http:\/\/iptc.org\/std\/Iptc4xmpCore\/1.0\/xmlns\/ (&#8220;Iptc4xmpCore&#8221;)<br \/>\nEXIF: http:\/\/ns.adobe.com\/exif\/1.0\/ (&#8220;exif&#8221;);<br \/>\nDublin Core: http:\/\/purl.org\/dc\/elements\/1.1\/ (&#8220;dc&#8221;)<br \/>\nTIFF: http:\/\/ns.adobe.com\/tiff\/1.0\/ (&#8220;tiff&#8221;)<br \/>\nXMP Basic: http:\/\/ns.adobe.com\/xap\/1.0\/ (&#8220;xmp&#8221;)<br \/>\nXMP Media Management: http:\/\/ns.adobe.com\/xap\/1.0\/mm\/ (&#8220;xmpMM&#8221;)<br \/>\nXMP Rights Management: http:\/\/ns.adobe.com\/xap\/1.0\/rights\/ (&#8220;xmpRights&#8221;)<br \/>\nXMP Basic Job Ticket: http:\/\/ns.adobe.com\/xap\/1.0\/bj\/ (&#8220;xmpBJ&#8221;)<br \/>\nXMP Paged-Text: http:\/\/ns.adobe.com\/xap\/1.0\/t\/pg\/ (&#8220;xmpTPg&#8221;)<br \/>\nPhotoshop: http:\/\/ns.adobe.com\/photoshop\/1.0\/ (&#8220;photoshop&#8221;)<br \/>\nStock Photo: http:\/\/ns.adobe.com\/StockPhoto\/1.0\/ (&#8220;bmsp&#8221;)<br \/>\nAdobe PDF: http:\/\/ns.adobe.com\/pdf\/1.3\/ (&#8220;pdf&#8221;)<br \/>\nCamera Raw Settings: http:\/\/ns.adobe.com\/camera-raw-settings\/1.0\/ (&#8220;crs&#8221;)<br \/>\nPNG: http:\/\/ns.adobe.com\/png\/1.0\/ (&#8220;png&#8221; )<\/p>\n<p>AND VERY IMPORTANT: <a href=\"http:\/\/www.exiv2.org\/metadata.html\">Reference list of properties for the above schemas<\/a><\/p>\n<pre>#target bridge<\/pre>\n<p>if (BridgeTalk.appName == &#8220;bridge&#8221; ) {<br \/>\nvar menu = MenuElement.create( &#8220;command&#8221;, &#8220;Export CSV File&#8221;, &#8220;at the end of Tools&#8221;);<br \/>\nmenu.onSelect = function(m) {<br \/>\ntry {<br \/>\nvar tDate = new Date();<br \/>\nvar tDay = parseInt(tDate.getMonth()+1)+&#8217;\/&#8217;+tDate.getDate()+&#8217;\/&#8217;+tDate.getFullYear();<br \/>\nvar f = File.saveDialog(&#8220;Export file list to:&#8221;, &#8220;Comma delimited file:*.CSV&#8221;);<br \/>\nif ( !f ) { return; }<br \/>\nf.open(&#8220;w&#8221;);<br \/>\nf.writeln(&#8220;DateProcessed,FileName,DateCreated,ImageWidth,ImageHeight,Latitude,Latitude2,Longitude,Longitude2,Altitude,ImageDirection&#8221;);<br \/>\nvar items = app.document.visibleThumbnails;<br \/>\nfor (var i = 0; i &lt; items.length; ++i) {<br \/>\nvar item = items[i];<br \/>\nf.writeln(tDay,&#8217;,&#8217;,item.name,&#8217;,&#8217;,ListMetadata(item) );<br \/>\n};<br \/>\nf.close();<br \/>\n} catch(e) {}<br \/>\n};<br \/>\n};<\/p>\n<p>function ListMetadata(tn) {<br \/>\nmd = tn.metadata;<br \/>\nmd.namespace = &#8220;http:\/\/ns.adobe.com\/xap\/1.0\/&#8221;;<br \/>\nvar res = md.CreateDate;<br \/>\nmd.namespace = &#8220;http:\/\/ns.adobe.com\/tiff\/1.0\/&#8221;;<br \/>\nres = res + &#8216;,&#8217; + md.ImageWidth + &#8216;,&#8217; + md.ImageLength;<br \/>\nmd.namespace = &#8220;http:\/\/ns.adobe.com\/exif\/1.0\/&#8221;;<br \/>\nres = res + &#8216;,&#8217; + md.GPSLatitude + &#8216;,&#8217; + md.GPSLongitude + &#8216;,&#8217; + md.GPSAltitude + &#8216;,&#8217; + md.GPSImgDirection ;<br \/>\nreturn res;<br \/>\n}<\/p>\n<p><center><img loading=\"lazy\" class=\"alignnone size-full wp-image-4473\" src=\"https:\/\/dbbd.sg\/blog\/wp-content\/uploads\/2022\/03\/8166134374_c0f64a43a7_c.jpg\" width=\"799\" height=\"598\" alt=\"Screen Shot 2012-11-08 at 8.08.35 AM.png\" srcset=\"https:\/\/dbbd.sg\/blog\/wp-content\/uploads\/2022\/03\/8166134374_c0f64a43a7_c.jpg 799w, https:\/\/dbbd.sg\/blog\/wp-content\/uploads\/2022\/03\/8166134374_c0f64a43a7_c-300x225.jpg 300w, https:\/\/dbbd.sg\/blog\/wp-content\/uploads\/2022\/03\/8166134374_c0f64a43a7_c-768x575.jpg 768w, https:\/\/dbbd.sg\/blog\/wp-content\/uploads\/2022\/03\/8166134374_c0f64a43a7_c-640x479.jpg 640w\" sizes=\"(max-width: 799px) 100vw, 799px\" \/> Data now in Excel<\/center>NEXT POST: <a href=\"http:\/\/openurbanism.blogspot.fr\/2012\/11\/geocoding-from-excel-to-tilemill-part-ii.html\">EXCEL TO TILEMILL<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a documentation post for my own record on how I will produce a map of 180 date points that I have collected so far. To be honest I&#8217;m not a real programmer or anything like that, so the methods used in this post might be desultory or silly. I&#8217;m helplessly flapping about here. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4464,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[785,783,775,771,777,780,779,770,781,782,778,773,784,776,586,769,774,544,587,772],"jetpack_featured_media_url":"https:\/\/dbbd.sg\/blog\/wp-content\/uploads\/2022\/03\/8166021546_03c481c032_o.png","_links":{"self":[{"href":"https:\/\/dbbd.sg\/blog\/wp-json\/wp\/v2\/posts\/320"}],"collection":[{"href":"https:\/\/dbbd.sg\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dbbd.sg\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dbbd.sg\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dbbd.sg\/blog\/wp-json\/wp\/v2\/comments?post=320"}],"version-history":[{"count":1,"href":"https:\/\/dbbd.sg\/blog\/wp-json\/wp\/v2\/posts\/320\/revisions"}],"predecessor-version":[{"id":4476,"href":"https:\/\/dbbd.sg\/blog\/wp-json\/wp\/v2\/posts\/320\/revisions\/4476"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dbbd.sg\/blog\/wp-json\/wp\/v2\/media\/4464"}],"wp:attachment":[{"href":"https:\/\/dbbd.sg\/blog\/wp-json\/wp\/v2\/media?parent=320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dbbd.sg\/blog\/wp-json\/wp\/v2\/categories?post=320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dbbd.sg\/blog\/wp-json\/wp\/v2\/tags?post=320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}