So I did another search, this time "convert lat long to utm". I thought it would be a straight forward formula, but instead all I got was calculators. So I settled on the one hosted by University of Wisconsin Green Bay: Convert Between Geographic and UTM Coordinates. I was still thinking there was some magic formula that no one wanted to share, so I started poking around in the dev console looking for it:
Well there we go, a JavaScript function does the conversion. Lets take a look...
Yeah.... so I'm not even trying to reimplement that in a formula in Google Sheets. So my next thought is "well I'll just bring the data into the console and iterate it through the function..." Simple enough right? So I'm in the spreadsheet, come up with a simple way to build up an array declaration:
Works like a charm... except there is one little tiny problem. The training lab has been recently refitted with Chromeboxes for all the workstations, and I'm logged in as Guest. While I thought this was fantastic when I found out it means that every chrome instance is pretty much automatically incognito (so I don't have to worry about my log ins hanging around)... it also means I have no clipboard access in Google Sheets without installing the Drive app. And guess what? Installation is not enabled... fml...
Not to be deterred, I knew there had to be SOME way of getting the data out. Turns out that I had copy paste access to pdf documents, so I threw the last cell into it's own sheet so I could make the one cell nice and huge, and I downloaded it as a pdf.
Not pretty but at least I could use the clipboard... |
The next bit was pretty straight forward, programming wise. The GeogToUtm() function was grabbing values out of the lat and long input fields, transforming them, and dropping the result in the UTM input fields. So all I had to do was iterate over my points, and for each one drop the value into the lat/long inputs, run the transform, and pick the result out of the output. First go at it I just printed the results to the console, apparently having forgotten about the "no clipboard access" issue I was having with Sheets...
Success! Now I just need to copy and paste.. these.. into... well damn... |
Running the second part got me the data downloaded. On the Chromebox it seamlessly opened it up in Sheets, whereas on my regular workstation it downloaded like a normal file (after I told it the pop-up was ok, of course):
Once I had the converted data in Sheets it was trivial to try importing it into MyMaps and discovering that, no, you cannot use UTM coordinates (even tried adding a "zones" column, since a proper UTM coordinate requires one... and yeah, no dice there either). Want to know the REALLY funny part? Had I logged in (instead of using the machine as a Guest), I'm pretty sure I either A) would have had the Drive app already installed or B) could have installed it myself... and thus could have finished much faster. Doh. It was a fun exercise anyway, though... yolo. =P
No comments:
Post a Comment