Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 776465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:27:10+00:00 2026-05-14T19:27:10+00:00

I am working on a geographic project in Java. The input are coordinates :

  • 0

I am working on a geographic project in Java.

The input are coordinates : 24.4444 N etc
Output: a PLAIN map (not round) showing the point of the coordinates.

I don’t know the algorithm to transform from coordinates to x,y on a JComponent, can somebody help me?

The map looks like this:
http://upload.wikimedia.org/wikipedia/commons/7/74/Mercator-projection.jpg

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T19:27:11+00:00Added an answer on May 14, 2026 at 7:27 pm

    Given your sparse example, the range of your inputs will be (90.0N – 90.0S) and (180W – 180E). It is easiest – and standard – if you convert South and West to negatives giving you latitudes of (90.0..-90.0) and longitudes of (180.0..-180.0).

    Given the size of your canvas – let’s say it is 140×120 pixels – you get:

    x = (latitude * canvas_height / 180.0) + (canvas_height / 2)
    y = (longitude * canvas_width / 360.0) + (canvas_width / 2)
    

    or:

    x = (longitude * 120.0 / 180.0) + (120/2)
    y = (latitude  * 140.0 / 360.0) + (140/2)
    

    where I have ordered the operations to minimize rounding error. This assumes the canvas has point (0,0) in the upper-left or, if not, that you are Australian.

    Added: you just threw in the bit about Mercator projections making my simple answer incorrect (but possibly still usable by you if you don’t actually care about projection)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working with a geographic point using lat/long and need to find other points
We have developers working in different geographic locations and we want to set up
Working on the problems on Project Euler to try to learn Clojure. I'm on
I'm working on an Android project that focuses on knowing how close you are
I am working on a project where I need to have data inherit at
I'm working on a project for visually tracking trains. I've refactored the object relationship
Our project is working within fairly close quarters code-wise (a lot of changes happening
I am working on a ASP.Net project with a team of 3 members. Due
I'm working with java images for the first time and having a problem viewing
The scope of the project I'm working on is being expanded. The application is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.