EGCC Rwy 24
2nd Jun 2003, 03:10
I'm flumoxed, but I'm sure someone here can help!!
My site (http://www.nicklocke.co.uk/Points), for those who have not yet been there, is attempting to help document the background and history of reporting point names before all the valuable anecdotal evidence is lost for ever.
For some time now, the site has offered the ability to see the approximate location of a reporting point. This is done by passing the WGS84 co-ordinates to Multimap which then does all the hard work.
I have just added the ability to show overview maps. These can show an individual point or, more importantly, the path of a route between many points.
You can see examples by clicking "Overview map" from a Point page or from a Route page.
My problem is how to convert the WGS84 co-ordinates into something that looks reasonably correct on a flat representation of the UK.
Gory details:
The bitmapped map is 310 pixels wide, by 500 tall. The SVG graphics used within the browser puts the 0,0 position in the top left. This of course is the "opposite way round" to the WGS84 co-ordinates.
So, the X and Y co-ordinates on the bitmap come from:
X = 309 - ((XXXX + 100) / 518 * 309)
Y = 499 - ((YYYY - 3000) / 519 * 499)
XXXX is the WGS84 Degrees West multiplied by 60, plus the WGS84 Minutes.
YYYY is the WGS84 Degrees North multiplied by 60, plus the WGS84 Minutes.
100 is added to counter for the fact that some of the UK is "East" and to ensure that all numbers are positive.
3000 is subtracted to counter for the fact that the Southernmost part of the UK is up from the equator.
The division by 518 or 519 was a challenge. I picked a few points at random around the extremities of the UK and noted their WGS84 co-ordinates. I then sought a number to divide by which (when multiplied back up by the number of pixels in the bitmap) seemed to give the most accurate positions. This is the bit where I really need some help!
The subtraction from 309 and 499 is simply to counter that WGS84 "increases" when going West and North, whilst the bitmap "Increases" when going South and East.
Sorry that is a long question!!
All help welcomed.
Thanks,
Nick
My site (http://www.nicklocke.co.uk/Points), for those who have not yet been there, is attempting to help document the background and history of reporting point names before all the valuable anecdotal evidence is lost for ever.
For some time now, the site has offered the ability to see the approximate location of a reporting point. This is done by passing the WGS84 co-ordinates to Multimap which then does all the hard work.
I have just added the ability to show overview maps. These can show an individual point or, more importantly, the path of a route between many points.
You can see examples by clicking "Overview map" from a Point page or from a Route page.
My problem is how to convert the WGS84 co-ordinates into something that looks reasonably correct on a flat representation of the UK.
Gory details:
The bitmapped map is 310 pixels wide, by 500 tall. The SVG graphics used within the browser puts the 0,0 position in the top left. This of course is the "opposite way round" to the WGS84 co-ordinates.
So, the X and Y co-ordinates on the bitmap come from:
X = 309 - ((XXXX + 100) / 518 * 309)
Y = 499 - ((YYYY - 3000) / 519 * 499)
XXXX is the WGS84 Degrees West multiplied by 60, plus the WGS84 Minutes.
YYYY is the WGS84 Degrees North multiplied by 60, plus the WGS84 Minutes.
100 is added to counter for the fact that some of the UK is "East" and to ensure that all numbers are positive.
3000 is subtracted to counter for the fact that the Southernmost part of the UK is up from the equator.
The division by 518 or 519 was a challenge. I picked a few points at random around the extremities of the UK and noted their WGS84 co-ordinates. I then sought a number to divide by which (when multiplied back up by the number of pixels in the bitmap) seemed to give the most accurate positions. This is the bit where I really need some help!
The subtraction from 309 and 499 is simply to counter that WGS84 "increases" when going West and North, whilst the bitmap "Increases" when going South and East.
Sorry that is a long question!!
All help welcomed.
Thanks,
Nick