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

Working on a project at the moment and we have to implement soft deletion
Working on a project that parses a log of events, and then updates a
Working in Eclipse on a Dynamic Web Project (using Tomcat (v5.5) as the app
Working on a project where a sequential set of methods must be run every
Working with dates in ruby and rails on windows, I'm having problems with pre-epoch
Working with a SqlCommand in C# I've created a query that contains a IN
Working on a somewhat complex page for configuring customers at work. The setup is
Working with python interactively, it's sometimes necessary to display a result which is some
Working with TCL and I'd like to implement something like the Strategy Pattern .
Working with an Oracle 9i database from an ASP.NET 2.0 (VB) application using OLEDB.

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.