Go Back  PPRuNe Forums > Flight Deck Forums > Tech Log
Reload this Page >

WGS84 coordinates to a flat bitmap?

Wikiposts
Search
Tech Log The very best in practical technical discussion on the web

WGS84 coordinates to a flat bitmap?

Thread Tools
 
Search this Thread
 
Old 2nd Jun 2003, 03:10
  #1 (permalink)  
Thread Starter
 
Join Date: May 2000
Location: Woodville, Derbyshire, UK
Age: 65
Posts: 226
Likes: 0
Received 0 Likes on 0 Posts
WGS84 coordinates to a flat bitmap?

I'm flumoxed, but I'm sure someone here can help!!

My site, 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

Last edited by EGCC Rwy 24; 2nd Jun 2003 at 03:31.
EGCC Rwy 24 is offline  
Old 2nd Jun 2003, 17:50
  #2 (permalink)  
 
Join Date: Jan 2002
Location: Sandwich, Kent, UK
Posts: 156
Likes: 0
Received 0 Likes on 0 Posts
I'm no expert but I would suggest that you need to do some research into map projection techniques, and specifically, find out what projection your bitmap of the UK is based on.

Your conversion formulae are linear, which will only work if your bitmap is also 'linear' - ie if your bitmap is the same number of degress of longitude wide at the top and bottom. However, if that were the case for your bitmap, some distortion is inevitable - Scotland would be 'stretched' in the same way that Greenland is stretched in many atlases to appear the same size as Africa, when in fact it is many times smaller...

If your bitmap isn't linear in the sense described above, then you'll need non-linear formulae to do the mapping...

Good luck!

cbl
CBLong is offline  
Old 2nd Jun 2003, 20:54
  #3 (permalink)  
 
Join Date: May 2000
Location: Worldwide
Posts: 340
Likes: 0
Received 0 Likes on 0 Posts
Nick,

Had a look at your site, not sure what projection/ellipsoid multimap are using.

WGS84 is an ellipsoid, not a projection. I believe all you would need to do is transform the co-ordinates from WGS84 ellipsoid to whatever ellipsoid multimap is using, then just plot the coordinates. (it might be something simple like the Clarke 1866)

A useful set of transformations and projections can be found in the proj4 package http://www.remotesensing.org/proj/

This is similar to what they did for the great circle mapper @ http://gc.kls2.com
Zeke is offline  
Old 6th Jun 2003, 07:32
  #4 (permalink)  
Thread Starter
 
Join Date: May 2000
Location: Woodville, Derbyshire, UK
Age: 65
Posts: 226
Likes: 0
Received 0 Likes on 0 Posts
Thanks guys. Definitely some food for thought there. Much appreciated.
EGCC Rwy 24 is offline  

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Contact Us - Archive - Advertising - Cookie Policy - Privacy Statement - Terms of Service

Copyright © 2024 MH Sub I, LLC dba Internet Brands. All rights reserved. Use of this site indicates your consent to the Terms of Use.