{"id":788,"date":"2014-07-14T13:58:51","date_gmt":"2014-07-14T20:58:51","guid":{"rendered":"http:\/\/s4.sonoma.edu\/?p=788"},"modified":"2017-12-08T16:03:15","modified_gmt":"2017-12-08T23:03:15","slug":"color-coding-script","status":"publish","type":"post","link":"https:\/\/s4.sonoma.edu\/?p=788","title":{"rendered":"Color Coding Script"},"content":{"rendered":"<p>Sam Koshy was ambitious enough to write a Python script that will colorize the points in a KML file with respect to altitude as shown here: If you&#8217;re interested in having your data color coded like this, you can follow these simple steps:<a href=\"http:\/\/s4.sonoma.edu\/wp-content\/uploads\/2014\/07\/Screen-Shot-2014-07-11-at-9.27.54-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-843\" src=\"http:\/\/s4.sonoma.edu\/wp-content\/uploads\/2014\/07\/Screen-Shot-2014-07-11-at-9.27.54-PM-300x211.png\" alt=\"Screen Shot 2014-07-11 at 9.27.54 PM\" width=\"300\" height=\"211\" srcset=\"https:\/\/s4.sonoma.edu\/wp-content\/uploads\/2014\/07\/Screen-Shot-2014-07-11-at-9.27.54-PM-300x211.png 300w, https:\/\/s4.sonoma.edu\/wp-content\/uploads\/2014\/07\/Screen-Shot-2014-07-11-at-9.27.54-PM-1024x721.png 1024w, https:\/\/s4.sonoma.edu\/wp-content\/uploads\/2014\/07\/Screen-Shot-2014-07-11-at-9.27.54-PM-426x300.png 426w, https:\/\/s4.sonoma.edu\/wp-content\/uploads\/2014\/07\/Screen-Shot-2014-07-11-at-9.27.54-PM.png 1068w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<ol>\n<li>Download and unzip the python script that Sam wrote: <a href=\"http:\/\/s4.sonoma.edu\/wp-content\/uploads\/2014\/07\/Colorpy.zip\">http:\/\/s4.sonoma.edu\/wp-content\/uploads\/2014\/07\/Colorpy.zip<\/a><\/li>\n<li>Use the S4 Data Manager to export your desired data set to a KML file as normal<\/li>\n<li>Make sure that the python script (Colorpy.py that you extracted in step 1) and the file you want to edit are located in the same folder on your computer.<\/li>\n<li>Open the Colorpy.py in any text editor<\/li>\n<li>Locate the line in the file that reads xmldoc = minidom.parse(&#8220;MoffettLaunch.kml&#8221;)and change the text inside the quotation marks to match the file you want to colorize: xmldoc = minidom.parse(&#8220;MyFileName.kml&#8221;) Save the file<\/li>\n<li>Execute the python script, and it will create a new file called &#8220;fileout.kml&#8221; that has the colorized data set.<\/li>\n<\/ol>\n<p>Executing a python file requires you to have python installed. You should have no trouble finding a tutorial on running a python script on your particular operating system if you Google it, but if there is sufficient interest in this process, I will be happy to write a quick tutorial.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sam Koshy was ambitious enough to write a Python script that will colorize the points in a KML file with respect to altitude as shown here: If you&#8217;re interested in having your data color coded like this, you can follow &hellip; <a href=\"https:\/\/s4.sonoma.edu\/?p=788\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":101013,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-788","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/s4.sonoma.edu\/index.php?rest_route=\/wp\/v2\/posts\/788","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/s4.sonoma.edu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/s4.sonoma.edu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/s4.sonoma.edu\/index.php?rest_route=\/wp\/v2\/users\/101013"}],"replies":[{"embeddable":true,"href":"https:\/\/s4.sonoma.edu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=788"}],"version-history":[{"count":4,"href":"https:\/\/s4.sonoma.edu\/index.php?rest_route=\/wp\/v2\/posts\/788\/revisions"}],"predecessor-version":[{"id":844,"href":"https:\/\/s4.sonoma.edu\/index.php?rest_route=\/wp\/v2\/posts\/788\/revisions\/844"}],"wp:attachment":[{"href":"https:\/\/s4.sonoma.edu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=788"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/s4.sonoma.edu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=788"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/s4.sonoma.edu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=788"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}