Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Procedure for locating nearest site on X & Y Axis
Message
De
04/08/2001 20:15:07
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00539725
Message ID:
00539861
Vues:
10
>I have a situation where I have X-Axis and Y-Axis coordinates for various sites in a geographical region. From one of those sites, I need to create a list of the other sites, beginning with the nearest one, and continuing out with the next nearest one, and so on, in that order.
>
>I am using a set of cursors, and manipulating them into a table that I actually display, but the final sort order is not quite there. If I manually measure some of the distances on the map as compared to the resulting list, they are still a little jumbled.
>
>Has anyone ever created a procedure that will do anything close to this? I am almost out of ideas, and need some help. ANY suggestions would be greatly appreciated.
>
>Thanks in advance...

The other answers to your question apparently used Pythagoras Theorem. Now, since we actually live on a sphere, this formula is not correct for large distances. I mean, the United States is a huge country.

You can get the correct distance formula in a text on spherical trigonometry.

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform