{"id":50524,"date":"2020-10-10T03:01:15","date_gmt":"2020-10-09T17:01:15","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=50524"},"modified":"2020-10-09T19:59:52","modified_gmt":"2020-10-09T09:59:52","slug":"html-and-javascript-and-css-survey-traverse-csv-co-ordinates-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/html-and-javascript-and-css-survey-traverse-csv-co-ordinates-tutorial\/","title":{"rendered":"HTML and Javascript and CSS Survey Traverse CSV Co-ordinates Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"HTML and Javascript and CSS Survey Traverse CSV Co-ordinates Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/SurveyTraverse_csv.jpg\" title=\"HTML and Javascript and CSS Survey Traverse CSV Co-ordinates Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">HTML and Javascript and CSS Survey Traverse CSV Co-ordinates Tutorial<\/p><\/div>\n<p>To help out the Survey Traverse functionality of the recent <a title='HTML and Javascript and CSS Survey Traverse Canvas Tutorial' href='#htmljcssstct'>HTML and Javascript and CSS Survey Traverse Canvas Tutorial<\/a> &#8230;<\/p>\n<ul>\n<li>it is no surprise that the improvement relates to getting lots of data in quickly and easily &#8230; that being &#8230;<\/li>\n<li>co-ordinate data &#8230; letting the web application &#8230;<\/li>\n<li>derive for us bearings and distances &#8230; implied by that &#8230;<\/li>\n<li>&#8220;comma separated values&#8221; file format means of importing<\/li>\n<\/ul>\n<p>There is a small issue trying to get into the HTML\/Javascript client web application the CSV data just using &#8220;client pre-emptive iframe&#8221; methodologies, because most platforms will, instead, shape to download this data.  So cue the help we (<font color=blue>and you<\/font> &#8230;<\/p>\n<p><code><br \/>\nfunction checkAtStart() {    \/\/ check query string<br \/>\n if (numlegs != 0) {<br \/>\n  \/\/alert(params['traverse']);<br \/>\n  processTraverse(params['traverse']);<br \/>\n } else {<br \/>\n  numlegs = prompt(\"Please tell me how many Traverse legs you have.  If you have a set of co-ordinates number of Traverse legs is one less than this number of co-ordinate sets.<font color=blue>  If you are specifying a CSV filename to use for a set of co-ordinate that is allowed too.<\/font>\", \"0\");<br \/>\n  <font color=blue>if (('' + numlegs + '~').toLowerCase().indexOf('.csv~') != -1) {<br \/>\n   document.getElementById('preifcsv').src='.\/SurveyTraverse.php?csvfile=' + encodeURIComponent(numlegs);<br \/>\n  } else <\/font>if (numlegs != \"0\" && numlegs != null) {<br \/>\n   window.location = window.location + \"?traverse=\" + numlegs + \",0\";<br \/>\n  }<br \/>\n }<br \/>\n}<br \/>\n<\/code><\/p>\n<p>) &#8230; can get from, into a first HTML iframe (as referenced above) &#8230;<\/p>\n<p><code><br \/>\n&lt;iframe src='\/\/www.rjmprogramming.com.au\/About_Us.html' style=display:none; id=preifcsv&gt;&lt;\/iframe&gt;<br \/>\n<\/code><\/p>\n<p> &#8230; <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/SurveyTraverse.php-GETME' title='Download me'>our changed &#8220;sister&#8221; PHP<\/a> <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/SurveyTraverse.php-GETME' title='Download me'>SurveyTraverse.php<\/a> code &#8230;<\/p>\n<p>&lt;?php<br \/>\n<code><br \/>\n  if (isset($_GET['csvfile'])) {<br \/>\n    $fname=str_replace(\"+\",\" \",urldecode($_GET['csvfile']));<br \/>\n    $csvcont='';<br \/>\n    if (strpos(strtolower($fname),\"http\") !== false) {<br \/>\n     $csvcont=file_get_contents($fname);<br \/>\n    } else if (file_exists($fname)) {<br \/>\n     $csvcont=file_get_contents($fname);<br \/>\n    }<br \/>\n    if (strpos($csvcont,',') !== false) {<br \/>\n      echo '&lt;html&gt;&lt;body onload=\"parent.document.getElementById(' . \"'\" . ifcsv . \"'\" . ').srcdoc=' . \"'&lt;pre&gt;\" . str_replace(\"\\r\",\"&lt;br&gt;\",str_replace(\"\\n\",\"&lt;br&gt;\",str_replace(\"\\r\\n\",\"&lt;br&gt;\",str_replace(\"'\",\"\",$csvcont)))) . \"&lt;\/pre&gt;'\" . ';\"&gt;&lt;\/body&gt;&lt;\/html&gt;';<br \/>\n    }<br \/>\n    exit;<br \/>\n  }<br \/>\n  $prehtml = \"\";<br \/>\n  $midhtml = \"\";<br \/>\n  $posthtml = \"\";<br \/>\n  function retval($inv) {<br \/>\n    if (strpos($inv, \"E-\") !== false) return \"0\";<br \/>\n    return $inv;<br \/>\n  }<br \/>\n<\/code><br \/>\n?&gt;<\/p>\n<p> &#8230; populating the second HTML iframe with the CSV data (modified into text\/html) via that iframe&#8217;s &#8220;srcdoc&#8221; attribute &#8230;<\/p>\n<p><code><br \/>\n&lt;iframe srcdoc='' style=display:none; onload='getthis(this);' id=ifcsv&gt;&lt;\/iframe&gt;<br \/>\n<\/code> <\/p>\n<p> &#8230; and then back to &#8230;<\/p>\n<p><code><br \/>\nfunction isNumeric(str) { \/\/ thanks to https:\/\/stackoverflow.com\/questions\/175739\/built-in-way-in-javascript-to-check-if-a-string-is-a-valid-number<br \/>\n  if (typeof str != \"string\") return false \/\/ we only process strings!<br \/>\n  return !isNaN(str) && \/\/ use type coercion to parse the _entirety_ of the string (`parseFloat` alone does not do this)...<br \/>\n         !isNaN(parseFloat(str)) \/\/ ...and ensure strings of whitespace fail<br \/>\n}<br \/>\n<br \/>\nfunction getthis(iois) {<br \/>\n  var totco=0;<br \/>\n  var legcnt=-1;<br \/>\n  var lsst='', lsstd='';<br \/>\n  var miniarr=[], minirec='', ethere=false, nthere=false;<br \/>\n  if (iois != null) {<br \/>\n    var aconto = (iois.contentWindow || iois.contentDocument);<br \/>\n    if (aconto != null) {<br \/>\n     if (aconto.document) { aconto = aconto.document; }<br \/>\n     if (aconto.body != null) {<br \/>\n       if (aconto.body.innerHTML.indexOf('&lt;pre&gt;') == 0 && aconto.body.innerHTML.indexOf(',') != -1) {<br \/>\n         var reclines=aconto.body.innerHTML.replace('&lt;pre&gt;','').replace('&lt;\/pre&gt;','').split('&lt;br&gt;');<br \/>\n         for (var irecs=0; irecs&lt;reclines.length; irecs++) {<br \/>\n           miniarr=reclines[irecs].split(',');<br \/>\n           minirec='';<br \/>\n           ethere=false;<br \/>\n           nthere=false;<br \/>\n           if (miniarr.length &gt;= 2) {<br \/>\n             if (isNumeric('' + miniarr[0].replace(\/\\\"\/g,'').replace(\/\\'\/g,''))) { minirec+= '' + miniarr[0].replace(\/\\\"\/g,'').replace(\/\\'\/g,''); ethere=true; }<br \/>\n             if (isNumeric('' + miniarr[1].replace(\/\\\"\/g,'').replace(\/\\'\/g,''))) {<br \/>\n              if (ethere) {<br \/>\n               minirec+= ',' + miniarr[1].replace(\/\\\"\/g,'').replace(\/\\'\/g,''); nthere=true;<br \/>\n              } else {<br \/>\n               minirec+= '' + miniarr[1].replace(\/\\\"\/g,'').replace(\/\\'\/g,''); ethere=true;<br \/>\n              }<br \/>\n             }<br \/>\n             if (miniarr.length &gt; 2 && ethere && !nthere) {<br \/>\n             if (isNumeric('' + miniarr[2].replace(\/\\\"\/g,'').replace(\/\\'\/g,''))) {<br \/>\n               minirec+= ',' + miniarr[2].replace(\/\\\"\/g,'').replace(\/\\'\/g,''); nthere=true;<br \/>\n             }<br \/>\n             }<br \/>\n             if (nthere) { legcnt++;  lsst+=lsstd + minirec; lsstd=',';  }<br \/>\n           }<br \/>\n         }<br \/>\n         if (lsst != '' && legcnt &gt; 0) {<br \/>\n           alert(lsst.slice(-100));<br \/>\n           localStorage.setItem('en_st', encodeURIComponent(lsst));<br \/>\n           location.href=document.URL.split('#')[0].split('?')[0] + '?traverse=' + legcnt + ',0';<br \/>\n         }<br \/>\n         \/\/alert(aconto.body.innerHTML);<br \/>\n       }<br \/>\n     }<br \/>\n    }<br \/>\n  }<br \/>\n}<br \/>\n<\/code><\/p>\n<p> &#8230; the HTML\/Javascript via window.<a target=_blank title='Window object sessionStorage property' href='https:\/\/www.w3schools.com\/jsref\/prop_win_localstorage.asp'>localStorage<\/a> &#8230;<\/p>\n<p><code><br \/>\nvar envials=[];<br \/>\nvar pvials=[];<br \/>\nif (window.localStorage) {<br \/>\n  \/\/ 34,56,78,45 ... ,<br \/>\n  \/\/ 34,56,\"One\",78,45,\"Two\" ... ,\"<br \/>\n  \/\/ \"One\",34,56,\"Two\",78,45 ... \",<br \/>\n  var acontt=decodeURIComponent(('' + localStorage.getItem('en_st')).replace(\/^null$\/g,'')).replace(\/\\+\/g,' ');<br \/>\n  if (acontt != '') {   localStorage.removeItem('en_st'); }<br \/>\n  var minicom=[];<br \/>\n  var endelim=',';<br \/>\n  if (acontt.indexOf(',\"') != -1 && acontt.indexOf('\",') != -1) {<br \/>\n    if (eval('' + acontt.indexOf('\",')) &lt; eval('' + acontt.indexOf(',\"'))) {<br \/>\n    endelim='\",';<br \/>\n    } else {<br \/>\n    endelim=',\"';<br \/>\n    }<br \/>\n  } else if (acontt.indexOf(',\"') != -1) {<br \/>\n    endelim=',\"';<br \/>\n  } else if (acontt.indexOf('\",') != -1) {<br \/>\n    endelim='\",';<br \/>\n  }<br \/>\n  var jxv=0;<br \/>\n  var xenvials=acontt.split(endelim);<br \/>\n  xenvials.push('');<br \/>\n  for (var ixv=0; ixv&lt;xenvials.length; ixv++) {<br \/>\n    if (xenvials[ixv] != '') {<br \/>\n    if (endelim == ',\"') {<br \/>\n      pvials.push(xenvials[eval(1 + ixv)].split('\"')[0]);<br \/>\n      if (xenvials[ixv].indexOf('\",') != -1) { xenvials[ixv]=xenvials[ixv].replace(xenvials[ixv].split('\",')[0] + '\",',''); }<br \/>\n      minicom=xenvials[ixv].split(',');<br \/>\n      for (jxv=0; jxv&lt;minicom.length; jxv++) {<br \/>\n      envials.push(minicom[jxv]);<br \/>\n      }<br \/>\n    } else if (endelim == '\",') {<br \/>\n      pvials.push(xenvials[ixv].split('\"')[0]);<br \/>\n      if (xenvials[eval(1 + ixv)].indexOf(',\"') != -1) { xenvials[eval(1 + ixv)]=xenvials[eval(1 + ixv)].replace(',\"' + xenvials[eval(1 + ixv)].split(',\"')[0],''); }<br \/>\n      minicom=xenvials[eval(1 + ixv)].split(',');<br \/>\n      for (jxv=0; jxv&lt;minicom.length; jxv++) {<br \/>\n      envials.push(minicom[jxv]);<br \/>\n      }<br \/>\n    } else {<br \/>\n      envials.push(xenvials[ixv]);<br \/>\n    }<br \/>\n    }<br \/>\n  }<br \/>\n}<br \/>\n<\/code><\/p>\n<p> &#8230; means (in that curious way by which we can dispose of it as soon as it gets into a Javascript global var<font size=1>iable<\/font> (feels a bit like PHP GET claytons or POST claytons) via <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/SurveyTraverse.html----GETME\" title=\"SurveyTraverse.htm\">our changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/SurveyTraverse.html----GETME\" title=\"SurveyTraverse.htm\">SurveyTraverse.htm<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/\">live run<\/a> link.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/html-and-javascript-and-css-survey-traverse-csv-co-ordinates-tutorial\/'>HTML and Javascript and CSS Survey Traverse CSV Co-ordinates Tutorial<\/a>.<\/p-->\n<hr>\n<p id='htmljcssstct'>Previous relevant <a target=_blank title='HTML and Javascript and CSS Survey Traverse Canvas Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/html-and-javascript-and-css-survey-traverse-canvas-tutorial\/'>HTML and Javascript and CSS Survey Traverse Canvas Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"HTML and Javascript and CSS Survey Traverse Canvas Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/SurveyTraverse_yetmore.jpg\" title=\"HTML and Javascript and CSS Survey Traverse Canvas Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">HTML and Javascript and CSS Survey Traverse Canvas Tutorial<\/p><\/div>\n<p>Onto yesterday&#8217;s <a title='HTML and Javascript and CSS NSW State Survey Traverse Tutorial' href='#htmljcssnswsstt'>HTML and Javascript and CSS NSW State Survey Traverse Tutorial<\/a> progress with our Survey Traverse web application functionality we wanted to augment &#8230;<\/p>\n<ul>\n<li>the existent tabular data &#8230; with &#8230;<\/li>\n<li>new <a target=_blank title='HTML Canvas element information from w3schools' href='http:\/\/www.w3schools.com\/tags\/ref_canvas.asp'>canvas<\/a> graphics to show the (Easting,Northing) co-ordinate sets of the Survey Traverse<\/li>\n<\/ul>\n<p> &#8230; involving the <font color=blue>collection of minimums and maximums<\/font> Javascript &#8220;ifzeromakezero&#8221; function code changes &#8230;<\/p>\n<p><code><br \/>\n<font color=blue>var edone=false, ndone=false;<br \/>\nvar maxe=-1.0, mine=-1.0, maxn=-1.0, minn=-1.0;<\/font><br \/>\n<br \/>\nfunction ifzeromakezero(innum<font color=blue>,e_or_n<\/font>) {<br \/>\n var cinnum = innum.toString();<br \/>\n if (cinnum.indexOf(\"e-\") != (0 - 1)) {<br \/>\n   <font color=blue>if (e_or_n == 1) {<br \/>\n     if (!edone) {<br \/>\n       mine=0.0;<br \/>\n       maxe=0.0;<br \/>\n     } else {<br \/>\n       if (mine > 0.0) { mine=0.0; }<br \/>\n       if (maxe < 0.0) { maxe=0.0; }\n     } \n     edone=true;\n   } else if (e_or_n == 2) {\n     if (!ndone) {\n       minn=0.0;\n       maxn=0.0;\n     } else {\n       if (minn > 0.0) { minn=0.0; }<br \/>\n       if (maxn < 0.0) { maxn=0.0; }\n     } \n     ndone=true;\n   }<\/font><br \/>\n   return 0.000;<br \/>\n }<br \/>\n <font color=blue>if (e_or_n == 1) {<br \/>\n     if (!edone) {<br \/>\n       mine=innum;<br \/>\n       maxe=innum;<br \/>\n     } else {<br \/>\n       if (mine > innum) { mine=innum; }<br \/>\n       if (maxe < innum) { maxe=innum; }\n     } \n     edone=true;\n } else if (e_or_n == 2) {\n     if (!ndone) {\n       minn=innum;\n       maxn=innum;\n     } else {\n       if (minn > innum) { minn=innum; }<br \/>\n       if (maxn < innum) { maxn=innum; }\n     } \n     ndone=true;\n }<\/font><br \/>\n return innum;<br \/>\n}<\/code><\/p>\n<p> &#8230; and the canvas creation and line plotting, featuring (thanks to (linear gradients on canvas) ideas from <a target=_blank title='Excellent link' href='http:\/\/jsfiddle.net\/51toapv2\/'>this excellent link<\/a>) canvas Javascript code &#8230;<\/p>\n<p><code><br \/>\n    document.getElementById('overlays').innerHTML+='&lt;br&gt;&lt;br&gt;&lt;canvas style=\"background-color:#f0f0f0;border:2px dashed red;\" height=' + eval(40 + eval('' + maxn) - eval('' + minn)) + ' width=' + eval(40 + eval('' + maxe) - eval('' + mine)) + ' id=mycanvas&gt;&lt;\/canvas&gt;';<br \/>\n    setTimeout(postspanscheck, 5000);<br \/>\n    var ele=document.getElementById('mycanvas');<br \/>\n    var context=document.getElementById('mycanvas').getContext('2d');<br \/>\n    var iz=0, mto=true, grad;<br \/>\n<br \/>\n    \/\/ var pts = [[0, 0, \"red\"], [0, 0, \"green\"], [0, 0, \"blue\"], [0, 0, \"purple\"], [0, 0, \"olive\"], [0, 0, \"magenta\"], [0, 0, \"cyan\"], [0, 0, \"brown\"], [0, 0, \"black\"], [0, 0, \"pink\"], [0, 0, \"darkgreen\"], [0, 0, \"darkblue\"], [0, 0, \"darkorange\"]];<br \/>\n    var pts = [[0, 0, \"red\"], [0, 0, \"orange\"], [0, 0, \"yellow\"], [0, 0, \"green\"], [0, 0, \"cyan\"], [0, 0, \"blue\"], [0, 0, \"violet\"]];<br \/>\n    var begin = pts[0];<br \/>\n    var end = pts[1];<br \/>\n<br \/>\n    while (document.getElementById('E' + iz)) {<br \/>\n      if (document.getElementById('E' + iz).value != '') {<br \/>\n        if (mto) {<br \/>\n          context.lineWidth = 6;<br \/>\n          context.lineJoin = \"round\";<br \/>\n          context.lineCap = \"round\";<br \/>\n          \/\/context.strokeStyle = \"black\";<br \/>\n          context.beginPath();<br \/>\n          begin=pts[eval(iz % pts.length)];<br \/>\n          begin[0] = eval(20 + eval('' + document.getElementById('E' + iz).value) - eval('' + mine));<br \/>\n          begin[1] = eval(eval('' + maxn) + 20 - eval('' + document.getElementById('N' + iz).value) + 0 * eval('' + minn));<br \/>\n          context.moveTo(eval(20 + eval('' + document.getElementById('E' + iz).value) - eval('' + mine)), eval(eval('' + maxn) + 20 - eval('' + document.getElementById('N' + iz).value) + 0 * eval('' + minn)));<br \/>\n        } else {<br \/>\n          end=pts[eval(1 + eval(iz % 5))];<br \/>\n          end[0] = eval(20 + eval('' + document.getElementById('E' + iz).value) - eval('' + mine));<br \/>\n          end[1] = eval(eval('' + maxn) + 20 - eval('' + document.getElementById('N' + iz).value) + 0 * eval('' + minn));<br \/>\n          grad = context.createLinearGradient(begin[0], begin[1], end[0], end[1]);<br \/>\n          grad.addColorStop(0, begin[2]);<br \/>\n          grad.addColorStop(1, end[2]);<br \/>\n          context.strokeStyle = grad;<br \/>\n          context.lineTo(eval(20 + eval('' + document.getElementById('E' + iz).value) - eval('' + mine)), eval(eval('' + maxn) + 20 - eval('' + document.getElementById('N' + iz).value) + 0 * eval('' + minn)));<br \/>\n          context.stroke();<br \/>\n          \/\/context.strokeStyle = \"black\";<br \/>\n          context.beginPath();<br \/>\n          context.moveTo(eval(20 + eval('' + document.getElementById('E' + iz).value) - eval('' + mine)), eval(eval('' + maxn) + 20 - eval('' + document.getElementById('N' + iz).value) + 0 * eval('' + minn)));<br \/>\n          begin=pts[eval(iz % pts.length)];<br \/>\n          begin[0] = eval(20 + eval('' + document.getElementById('E' + iz).value) - eval('' + mine));<br \/>\n          begin[1] = eval(eval('' + maxn) + 20 - eval('' + document.getElementById('N' + iz).value) + 0 * eval('' + minn));<br \/>\n        }<br \/>\n        mto=false;<br \/>\n      }<br \/>\n      iz++;<br \/>\n    }<br \/>\n  }<br \/>\n<\/code><\/p>\n<p> &#8230; via <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/SurveyTraverse.html---GETME\" title=\"SurveyTraverse.htm\">our changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/SurveyTraverse.html---GETME\" title=\"SurveyTraverse.htm\">SurveyTraverse.htm<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/\">live run<\/a> link.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/html-and-javascript-and-css-survey-traverse-canvas-tutorial\/'>HTML and Javascript and CSS Survey Traverse Canvas Tutorial<\/a>.<\/p-->\n<hr>\n<p id='htmljcssnswsstt'>Previous relevant <a target=_blank title='HTML and Javascript and CSS NSW State Survey Traverse Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/html-and-javascript-and-css-nsw-state-survey-traverse-tutorial\/'>HTML and Javascript and CSS NSW State Survey Traverse Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"HTML and Javascript and CSS NSW State Survey Traverse Co-ordinates Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/survey_traverse_real.jpg\" title=\"HTML and Javascript and CSS NSW State Survey Traverse Co-ordinates Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">HTML and Javascript and CSS NSW State Survey Traverse Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a title='HTML and Javascript and CSS Survey Traverse Co-ordinates Tutorial' href='#htmljcssstc-t'>HTML and Javascript and CSS Survey Traverse Co-ordinates Tutorial<\/a> was kind of &#8220;mathematical&#8221; by nature.  Today we add some realism.<\/p>\n<p>This realism stems from the discovery of a NSW State Survey mark in the local area (to the right of today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/survey_traverse_real.jpg\">tutorial picture<\/a>).  Having a Land Surveying background, an indestructible looking survey mark is a joy to behold.  The thing is though, when I was doing a Bachelor Of Surveying in the late 1970&#8217;s and early 1980&#8217;s, this survey mark was much more an object of awe than perhaps such a mark is to people, even me, today.  Mystery surrounded it, it taking a visit to a government agency (NSW Titles Office), and no doubt some paperwork to match, would be required to find out anything about it, Land Surveyors at the very least curious about &#8230;<\/p>\n<ul>\n<li>(Easting, Northing) co-ordinates in AMG (Australian Map Grid) (in whatever ellipsoid of relevance)<\/li>\n<li>Reduced Level (at whatever datum of relevance)<\/li>\n<\/ul>\n<p>We decided on our iPhone to feed that SS46391 survey mark name into <a target=_blank title='Google' href='https:\/\/www.google.com\/search?sxsrf=ALeKk03k0t4onyTvNcOPeTf5OwWWx1CEAw%3A1597806776493&#038;ei=uJg8X_3YHcLw9QPHspuADA&#038;q=state+survey+mark+46391+amg&#038;oq=state+survey+mark+46391+amg&#038;gs_lcp=CgZwc3ktYWIQAzIFCAAQzQIyBQgAEM0CMgUIABDNAjIFCAAQzQI6BwgAEEcQsAM6BwghEAoQoAE6BQghEKABULWUAljd7wJgwvICaAFwAHgBgAHZBIgB9UOSAQ0wLjEwLjEzLjYuMS4ymAEAoAEBqgEHZ3dzLXdpesABAQ&#038;sclient=psy-ab&#038;ved=0ahUKEwj9lNSKpqbrAhVCeH0KHUfZBsAQ4dUDCAw&#038;uact=5'>Google<\/a>, thanks, and see what comes up, and discovered the <a target=_blank title='NSW Survey Marks app' href='https:\/\/six.nsw.gov.au\/content\/mobile#:~:text=The%20NSW%20Survey%20Mark%20app,please%20visit%20the%20iTunes%20Store.'>&#8220;NSW Survey Marks&#8221;<\/a> iOS app that we downloaded and spent a happy half hour &#8220;in a wooooorrrrrllllllddd of discovery and interest&#8221; <font size=1>(well, you had to be there)<\/font>.<\/p>\n<p>You see, this app is just great!  The information above is augmented by location Sketch Maps (that a Land Surveyor from the past would have created in the NSW Titles Office).<\/p>\n<p>This way, in that half hour we looked for 3 survey marks in that local area, and gleaned their co-ordinates to come up with the &#8230;<\/p>\n<ul>\n<li>(Easting, Northing) co-ordinates in AMG (Australian Map Grid) (from the NSW Survey Marks app)<\/li>\n<li>Bearings and Distances and theodolite Angles derived<\/li>\n<\/ul>\n<p> &#8230; also shown in today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/survey_traverse_real.jpg\">tutorial picture<\/a> &#8230; via <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/SurveyTraverse.html--GETME\" title=\"SurveyTraverse.html\">our changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/SurveyTraverse.html--GETME\" title=\"SurveyTraverse.html\">SurveyTraverse.html<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/\">live run<\/a> link, the changes concerning allowing both &#8230;<\/p>\n<ul>\n<li>decimal degrees &#8230; as well as &#8230;<\/li>\n<li>degrees, minutes and seconds (useful for setting an angle with a theodolite)<\/li>\n<\/ul>\n<p> &#8230; for those aforesaid mentioned Angles and Bearings (with your compass or iPhone compass app).<\/p>\n<p>Some of this &#8220;NSW Survey Marks&#8221; app&#8217;s workings can be viewed with today&#8217;s accompanying <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/pdf_jpg_ss.pdf\">PDF presentation<\/a>.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/new-html-and-javascript-and-css-survey-traverse-co-ordinates-tutorial\/'>New HTML and Javascript and CSS Survey Traverse Co-ordinates Tutorial<\/a> ...<\/p>\n\n\n\n\n\n<hr>\n\n\n\n\n\n<p id='htmljcssstc-t'>Previous relevant <a target=_blank title='HTML and Javascript and CSS Survey Traverse Co-ordinates Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/html-and-javascript-and-css-survey-traverse-co-ordinates-tutorial\/'>HTML and Javascript and CSS Survey Traverse Co-ordinates Tutorial<\/a> is shown below.<\/p>\n\n\n\n[caption id=\"\" align=\"alignnone\" width=\"220\" caption=\"HTML and Javascript and CSS Survey Traverse Co-ordinates Tutorial\"]<a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"HTML and Javascript and CSS Survey Traverse Co-ordinates Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/SurveyTraverse_more.jpg\" title=\"HTML and Javascript and CSS Survey Traverse Co-ordinates Tutorial\"  style=\"float:left;\" \/><\/a>[\/caption]\n\n\n\n<p>Today we revisit our <a title='HTML and Javascript and CSS Survey Traverse Tutorial' href='#htmljcssstt'>HTML and Javascript and CSS Survey Traverse Tutorial<\/a> web application because we want to allow it to be able to ...<\/p>\n\n\n\n\n\n<ul>\n\n\n<li>do its usual entering of theodolite measured angles and distance measurements to glean Easting,Northing co-ordinates and Bearings ... as well as, as of today ...<\/li>\n\n\n\n\n<li>enter Easting,Northing co-ordinates to derive Bearings and Distances and theodolite measured Angles (you guessed it, no adjustments)<\/li>\n\n\n<\/ul>\n\n\n\n\n\n<p>Tomorrow we\u2019ll go more into the inspiration for this adaptation of functionality, but rest assured, there are probably more scenarios whereby we know co-ordinates rather than the polar co-ordinates implied by how Survey Traverses are traditionally done using a theodolite and a distance measuring technique.  These days all happen within the one Total Station piece of equipment that Land Surveyors would be keen to get their hands on.<\/p>\n\n\n\n\n\n<p>Feel free to try <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/SurveyTraverse.html-GETME\" title=\"SurveyTraverse.html\">this changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/SurveyTraverse.html-GETME\" title=\"SurveyTraverse.html\">SurveyTraverse.html<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/\">live run<\/a> link.<\/p>\n\n\n\n<!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/html-and-javascript-and-css-survey-traverse-co-ordinates-tutorial\/'>HTML and Javascript and CSS Survey Traverse Co-ordinates Tutorial<\/a>.<\/p-->\n<hr>\n<p id='htmljcssstt'>Previous relevant <a target=_blank title='HTML and Javascript and CSS Survey Traverse Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/html-and-javascript-and-css-survey-traverse-tutorial\/'>HTML and Javascript and CSS Survey Traverse Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"HTML and Javascript and CSS Survey Traverse Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/SurveyTraverse.jpg\" title=\"HTML and Javascript and CSS Survey Traverse Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">HTML and Javascript and CSS Survey Traverse Tutorial<\/p><\/div>\n<p>Here is a tutorial showing some client-side basics in HTML and Javascript and CSS all in the one HTML file, to simplify concepts.   The tutorial subject matter is a webpage to perform Survey Traverse calculations.   A Survey Traverse is:<\/p>\n<blockquote><p>Traverse is a method in the field of surveying to establish control networks.[1] It is also used in geodesy. Traverse networks involve placing survey stations along a line or path of travel, and then using the previously surveyed points as a base for observing the next point. Traverse networks have many advantages, including:<\/p>\n<p>    Less reconnaissance and organization needed;<br \/>\n    While in other systems, which may require the survey to be performed along a rigid polygon shape, the traverse can change to any shape and thus can accommodate a great deal of different terrains;<br \/>\n    Only a few observations need to be taken at each station, whereas in other survey networks a great deal of angular and linear observations need to be made and considered;<br \/>\n    Traverse networks are free of the strength of figure considerations that happen in triangular systems;<br \/>\n    Scale error does not add up as the traverse is performed. Azimuth swing errors can also be reduced by increasing the distance between stations.<\/p>\n<p>The traverse is more accurate than triangulateration[2] (a combined function of the triangulation and trilateration practice).[3]<\/p><\/blockquote>\n<p>Let&#8217;s see some simple <a target=_blank title='click picture' href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/'>HTML<\/a> in action in a tutorial &#8230;<\/p>\n<p>Link to HTML &#8220;spiritual home&#8221; &#8230; <a target=_blank title='W3Schools' href='http:\/\/www.w3schools.com\/html\/'>at W3Schools<\/a> has many tutorials.<br \/>\nLink to Survey Traverse live run &#8230; <a target=_blank title='Survey Traverse live run' href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/SurveyTraverse.html'>here<\/a>.<br \/>\nLink to Survey Traverse live run (additional Google Line Chart functionality)  <a target=_blank title='Survey Traverse live run with Google Line Chart' href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/SurveyTraverse.php'>here<\/a>.<br \/>\nLink to Survey Traverse information &#8230; <a target=_blank title='Survey Traverse information' href='http:\/\/en.wikipedia.org\/wiki\/Traverse_(surveying)'>from Wikipedia from which quote above comes<\/a>.<br \/>\nLink to some downloadable HTML code &#8230; rename to <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/SurveyTraverse.html_GETME' title='Download me'>SurveyTraverse.html<\/a> which packages up a lot of Javascript and a little bit of CSS &#8230; or JaCvasScriptS &#8230; not sure whether this would ever catch on.<br \/>\nLink to some downloadable PHP programming code (additional Google Line Chart functionality) &#8230; rename to <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/SurveyTraverse\/SurveyTraverse.php_GETME' title='Download me'>SurveyTraverse.php<\/a>\n<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d1271' onclick='var dv=document.getElementById(\"d1271\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?cat=59\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d1271' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d50010' onclick='var dv=document.getElementById(\"d50010\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/bearing\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d50010' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d50016' onclick='var dv=document.getElementById(\"d50016\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/app\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d50016' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d50024' onclick='var dv=document.getElementById(\"d50024\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/canvas\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d50024' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d50524' onclick='var dv=document.getElementById(\"d50524\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/csv\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d50524' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>To help out the Survey Traverse functionality of the recent HTML and Javascript and CSS Survey Traverse Canvas Tutorial &#8230; it is no surprise that the improvement relates to getting lots of data in quickly and easily &#8230; that being &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/html-and-javascript-and-css-survey-traverse-csv-co-ordinates-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,14,37],"tags":[3349,1707,2531,283,290,429,576,587,3446,652,679,2408,2415,932,2902],"class_list":["post-50524","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-client-pre-emptive-iframe","tag-co-ordinates","tag-comma-separated-values","tag-csv","tag-data","tag-file_get_contents","tag-html","tag-iframe","tag-import-traverse","tag-javascript","tag-land-surveying","tag-local-storage","tag-localstorage","tag-php","tag-srcdoc"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/50524"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=50524"}],"version-history":[{"count":3,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/50524\/revisions"}],"predecessor-version":[{"id":50527,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/50524\/revisions\/50527"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=50524"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=50524"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=50524"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}