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

  • Home
  • SEARCH
  • 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 7218915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T21:32:54+00:00 2026-05-28T21:32:54+00:00

I have an application which reads in gridded coordinate data with values (i.e. lat,

  • 0

I have an application which reads in gridded coordinate data with values (i.e. lat, lon, value) and then plots this data on a map. The map that is drawn uses a lambert conformal conic projection and therefore all the coordinate data has to be converted from lat/lon to easting/northing. This all works great, however there is a noticeable performance issue when reading in several data files. Since all the data files contain the same set of points (although not necessarily in the same order) I’m thinking some sort of lookup table would be useful for the coordinate conversions. However I’ve never used lookup tables before and am having some trouble figuring out the design.

In a nutshell – any suggestions on the fastest way to take a lat/lon coordinate pair (float values) and look up the corresponding E/N pair (float values) assuming there is a 1:1 relationship between the coordinate pairs, no missing values, etc?

Since the lat/lon are float values I can’t use them as array indices (ex: lookup_array[lat][lon]) obviously so this is really where I’m getting the most tripped up.

Note: this solution can be in either C or C++, whichever has the optimal solution.

  • 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-28T21:32:55+00:00Added an answer on May 28, 2026 at 9:32 pm

    Because the space of possible lat/longs is large, I don’t think it’s feasible to build the whole table beforehand. However, you could remember the result of each transformation in (say) a hash table. Then each time you go to make a transformation, you first check to see if it’s in the table. If it isn’t, you do the calculation and store it in the hash table for next time.

    However, it’s not a good idea to use floats as keys in any lookup based data structure (see this question). In the case of lat/long data, if your input is in a consistent format, then you could avoid this problem by using strings as keys (and if it isn’t, then you could use sprintf() or similar to make a lat/long string in a consistent format down to a given precision).

    If you’d like an out of the box hash table implementation for C++, have a look at std::unordered_map and this wikipedia article.

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

Sidebar

Related Questions

I have a silverlight application which reads data from a db and displays them
Imagine I have some application, which reads and writes data to Google Tasks and
I have a Cocoa application which reads and saves data in a sole file.
I have a Delphi application which reads data from an excel spreadsheet using code
I have an application which works with sockets and reads / writes data. It
I have created an application which uses a System.Net.Sockets.Socket and reads data asynchronously. Everything
I have created a small application which opens,reads and creates Excel files. The app
I have an ASP.NET web application which does the following: Reads an Excel file.
I have an application which extracts data from an XML file using XPath. If
I have a server application which reads messages off a queue and writes them

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.