April 14, 2011

Wow - The Birth of a Map

I created something that maybe is worth mentioning:

Some evening in Spring, I surfed the web to look for some nautical publications for my Summer 2011 on SY Wosamma. I knew, there are Anchorages in Croatia with buoys where you have to pay for usage, some of them legal or illegal, i did not know exactly. I knew, there is a Concession List published by a Croatian Ministry, to bring some kind of "Official Status" to some Anchorages, and also to bring some money to the Republic of Croatia since there are fees to get a concession to run a legal Anchorage.

I had a look at this Concession List (it's an Excel-Sheet, published here). I found a boring Excel-Sheet, containing lots of coordinates, telling nothing else than hundreds of Positions just like N43°42'45.8'' E15°40'43'' to N43°41'12.3'' E15°43'38.2''. This was not the "Overview of Anchorages" i expected. I still did not have the slightest idea, WHERE this Anchorages exactly are.

Hmm, what to do???
I am Software Developer, so I am used to help myself in such issues...

There must be a way, to show this coordinates in an overview... Hmmm... I googled around... Ah: Google-Maps can display coordinates, interesting... Oooh, Google-Maps can display areas also, great! But how to bring this Excel-Sheet-Shit into Google-Maps? Another googling... Yep, PHP can read Excel, okay. Nice, there is a PHP-library that helps parsing Ecxel-Sheets. Hmmm... There MUST be a ......

Gotcha!!! Minutes later I startet to implement a little script. Binding the PHP-library, reading the Excel-Sheet, parsing the coordinates, midnight. Slept bad, too many how-if-when in my brain. The next day I read the details about the Google-Maps API, brought the script to write the coordinates into Google-Map, published on the server and nervously tried a First Run... Error!!! Okay, here is a little Bug, never mind. Corrected the Bug. Trial. Error. Okay, another Bug. Corrected. Trial. Error. Correct. Trial. Error. Correct. Trial, and... FINALLY....

BOAH!!! YIPPIEEE! Horray, Cheers, Bingo!!! Thats it! For the first time I could see the coordinates of the Excel-Sheet on a Google-Map. Within seconds I realized: This might be interesting for every sailor in Croatia!

Of course, there were many things left to do: Several typos in the Excel-Sheet leading to coordinates displayed in Italy. Some of the Anchorages used coordinates in WGS-84, some used Bessel-1841. Some coordinates were in decimal, some in minutes-seconds. Lot of details, but finally the script worked.

And now: Raise the curtain! Proudly presenting: THE SCRIPT!!!!