Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

have a map image 800px wide. How can I figure out a city.

like New York has 40.75 latitude and -73.98 longitude. I have to pin a mark over this point.

Before I have done with x_axis and y_axis which gives problem on more cities figure because i manually had to input values. now i have database with all cities with latitude and longitude. or is there any way that i can convert latitude and longitude to x and y axis.

Thank you

EDIT

x = image.width * (longitude + 180) / (2 * 180)
y = image.height * (latitude + 180) / (2 * 180)
share|improve this question
    
An answer is provided by the statement of the question at gis.stackexchange.com/questions/12073/… ! –  whuber Jul 12 '11 at 15:18

1 Answer 1

The maths is pretty easy if you want to do it by hand(or in the database) but you will probably be best served by setting up a desktop GIS to draw the output image once or if you need interactivity then a web map server will be a better way to go.

share|improve this answer
    
For now i have latitude and longitude stored in database. I have to calculate x coordinate and y-coordinate of a image map and point the place on the coordinate. what will be the exact calculation. please see the codes to calculate on edit section up. this doesn't gives accurate coordinates. –  kamal Jul 12 '11 at 10:16
1  
with only 400x800 pixels to play with how accurate do you expect? –  iant Jul 12 '11 at 12:07
    
Definitely I want accurate data. It it is possible as I am doing please advice. else I will search for gis disktop etc.. –  kamal Jul 12 '11 at 13:15
1  
well by my calculations you can't get better than .45 degree per pixel for that size of image. –  iant Jul 12 '11 at 13:20
1  
@iant It looks like the Robinson projection. The formulas are available. @kamal: look at those formulas. They will give an appreciation for what GIS software does. Do you really want to reinvent this wheel? If so, then pick a real simple projection, such as Plate Carree. –  whuber Jul 12 '11 at 17:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.