Jump to content

Recommended Posts

19 hours ago, david_navigator said:

Amazing how doing something different often brings alternative solutions to the forefront. 

I solve most of my problems in the shower. Eureka!

  • Like 4

Share this post


Link to post

Adress data can be much chaotic data in general, including typo's, exchanged fields, etc.
Thats why a hash value is maybe problematic too, if you want to work with the data.

Have you considered to reverse GeoCode the data in a single batch run, and add lon/lat to your database ?

Maybe that could make more sense for you, but could allow several "same" addresses of coarse.

Share this post


Link to post
On 2/2/2021 at 3:12 PM, Rollo62 said:

Have you considered to reverse GeoCode the data in a single batch run, and add lon/lat to your database ?

There can be several addresses in a house and they all have the same geodata.

Share this post


Link to post

If you want to get hash of an object by key fields, it is convenient to serialize these fields, e.g. in TMemoryStream or even string.
Then use reliable hash function, for example SHA-3.
Fields can be numbered, empty values can be skipped
'1:France;3:Paris'.

 

For strings, a function that takes string length in characters into account when calculating the hash is useful.
For floating point numbers, it is better to use an algorithm that hashes the exponent and the mantissa of the number separately.
If it's an object or a record, sometimes it makes sense to write your own function that hashes selected key fields of the object.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×