GPS Coords to map (x,y) coords convertation

Posted on 2004-08-11
Last Modified: 2010-10-05

I have a problem.
I have a digital 2 dimensional map, I know this map 2d corners coordinates and this coordinates' GPS coordinates.
forexample :
   x,y                       longitude, latitude
  (0,0)                     (47,36'48 and 18,55'24)
  (map.width,0)       (47,28'52 and 18,55'28)
  (0,map.height)        (..... .....)
  (map.width,map.height) (... ...)
and so on...

How can I calibrate the longitude and the latitude If I get an another x,y points
like (20,20)  -----> (??? , ???)

I need a (delphi) procedure or function...
Question by:wwwbetyar
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 55

Accepted Solution

Jaime Olivares earned 500 total points
ID: 11774929
First of all, how are you storing coordinates values? a good form is in pure grades as a real number:

47g36'48" can be stored as: 47.613333 grades

Or you can store it as pure seconds (my prefered method because no loss of precision)

47g36'48" can be stored as: 171408 seconds

No matters how has you stored them (but need to be stored as a UNIQUE value) the conversion formula is:

lon' = x/mapW * (lonE-lonW) + lonW
lat' = y/mapH * (latS-latN) + latN


x,y        = map coordinates position (ex. 20,20)
mapW,MapH  = map width and height
latW,latN  = upper-left corner of your map, expressed in geodesic coordinates
lonE,latS  = lower-right corner of your map

assuming (very important):
W coordinates are negatives
N coordinates are negatives


Author Comment

ID: 11778270
It seems to be good ...
So I accept this answear, but I tried it only only map...

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I feel like more and more people want to know how to programmatically convert addresses into geospatial locations. So in this article, I will show you how you can do it with Bing Maps. I'm going to use PowerShell, which is a nice scripting language,…
Introduction This article is designed to assist GIS (Geographic Information System) and GPS (Global Positioning System) developers using ESRI ArcGIS and other spatial information management systems.   For the uninitiated the concept of projectio…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question