Simple Hashing Function for City Coordinates

  • Thread starter Thread starter pbialos
  • Start date Start date
  • Tags Tags
    Function
Click For Summary
SUMMARY

This discussion focuses on creating a simple hashing function for city coordinates to effectively map them to a hash table. The participants suggest converting coordinates into natural numbers and utilizing a common hash function. Additionally, they highlight the importance of understanding the distribution of coordinates, particularly whether the density is greatest at the city center or uniformly distributed. For varying densities, converting coordinates to polar form and applying a linearizing function is recommended.

PREREQUISITES
  • Understanding of hash tables and their operations
  • Familiarity with coordinate systems, specifically Cartesian and polar coordinates
  • Basic knowledge of hashing functions and their implementations
  • Experience with numerical methods for linearization
NEXT STEPS
  • Research how to implement a hash function for geographic coordinates
  • Learn about polar coordinate transformations and their applications
  • Explore linearization techniques for varying density distributions
  • Investigate common hashing algorithms and their performance characteristics
USEFUL FOR

Software developers, data scientists, and anyone involved in geographic data processing or hash table implementations will benefit from this discussion.

pbialos
Hi folks! I am working on a problem where there is a hash table involved. I have randomly distributed coordinates over a city as keys and i need a hash function to convert those coordinates to the positions of my array(hash table).I thought that maybe i could use a function to convert my coordinates to natural numbers and then using a common hash function. I am just a beginner, and my project is not very important, so most of all i need a simple solution.

Any help would be much appreciated.
Paul.
 
Engineering news on Phys.org
When you say the coordinates are random, what does that mean? Is the density of the points to be hashed greatest at the city centre, and decreasing gradually further away, or (less likely) is the density constant out to some limit, and then an abrupt stop?

The distribution makes a difference to what would be the ideal hashing function, but maybe that doesn't matter - how many coordinates do you have to deal with?

If the density varies with distance from the city centre, you might wish to convert the coordinates into polar form and then apply a linearising (inverse) function to the radius coordinate before hashing the bearing/distance pair.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 19 ·
Replies
19
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
1
Views
2K