My brother suggested that I should write a web app that lets students create and print blank maps. A blank map is a map that contains country borders, waters etc. but no text labels. The first use case is the following:
- User selects 'Hungary' from a list. A blank map of Hungary appears on screen.
- User enters a name of a Hungarian town or place in a textbox. A small marker appears on the map in the specified place, but without a text label.
- User repeats step 2 as many times as he wishes, with different towns.
- User prints the resulting image and uses it to practice for his upcoming history or geography exam. The exam task is the same: receiving a blank map with textless markers and you have to fill in the town names from memory.
So I started to write the app, and at step 1, I've ran into the first problem. I don't have a database of blank maps. In order to let the user select a blank map from a list, someone has to create and fill a database of blank maps, in which the maps
table has the following (pseudo-)definition:
CREATE TABLE maps (
name TEXT PRIMARY KEY,
image BLOB,
minlat FLOAT,
minlon FLOAT,
maxlat FLOAT,
maxlon FLOAT
);
I decided to fill out one or two rows of this table myself, for testing. I downloaded this blank map of Hungary by a quick Google Search:
Now how on earth do I determine the coordinates? Let's try and create an overlay in Google Earth:
As you can see I didn't manage to position it precisely, the eastern borders are a bit off. So my question is:
Given an image file showing a map, how do I determine the exact lat/lon coordinates of its corners?