Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help Converting V&H Coordinates to Longitude and Latitude

552 views
Skip to first unread message

writ...@gate.net

unread,
Dec 14, 1994, 11:24:07 PM12/14/94
to
In <telecom1...@eecs.nwu.edu>, C. Edward Chow <ch...@quandary.harpo.
uccs.edu> writes:

> I am working on a project that needs to convert switching nodes'
> locations expressed in terms of V&H coordinates to those in
> Longitude and Latitude coordinates. I checked with telecommunications
> references in the library but can not find the definition of telephone
> network V&H coordinates. Can someone help pointing to the right
> references or explain it? Thanks.

As I recall the V&H system is based on the overlay of an orthogonal
grid on a equal area projection of North America. This map projection
results in equal map distance between all points that are equal by
great circle distance. The grid is rotated about 30% from the map
north/south. As I recall the numeric values are such that 16 bit fixed
point arithmetic is convenient for calculations of distance which work
out to abount .1 mile.

As you probably know by now you will need to know the exact type of
equal area projection used by the system and its reference points. The
conversion is trivial from V&H to map space and a bit complex from map
space to Lat & Log.

I saw a licensed program once to do this but unfortunately I can't
remember where and in any case the license terms were Dracoian.

You may find the an article on the system in a very old issue of the Bell
System Technical Journal.

Sounds like a good project for a student to put in the public domain.

Hope this helps.


Wally Ritchie Ft. Lauderdale, Florida

Gordon Torrie

unread,
Dec 19, 1994, 10:35:29 AM12/19/94
to
C. Edward Chow <ch...@quandary.harpo.uccs.edu> writes:

> I am working on a project that needs to convert switching
> nodes' locations expressed in terms of V&H coordinates to those
> in Longitude and Latitude coordinates. I checked with
> telecommunications references in the library but can not find
> the definition of telephone network V&H coordinates. Can
> someone help pointing to the right references or explain it?

Here are four messages which have appeared in comp.dcom.telecom in the
past and which describe how to perform the V&H <=> Lat./Long.
conversions including source code routines in C and Fortran.


From: Thomas B. Libert <t...@comsol.com>
Subject: Re: H & V Distance Computing Algorithm Wanted
Date: Sun, 26 Sep 93 14:43:23 EDT
Reply-To: t...@comsol.com
Organization: Computing Solutions Inc., Ann Arbor, Michigan
X-Telecom-Digest: Volume 13, Issue 666, Message 8 of 16

The H & V numbers are computed from the Donald Elliptical projection,
a two-point equidistant projection designed by Jay K. Donald of AT&T
around 1956. The projection allows you to use the simple cartesian
distance formula to compute a reasonably good approximation for the
true distance. Just compute sqrt((h2 - h1)^2 + (v2 - v1)^2), and
multiply by a scale factor (ten miles? something like that.)


From: StuJe...@cup.portal.com
Subject: Re: H & V Distance Computing Algorithm Wanted
Date: Sun, 26 Sep 93 22:33:32 PDT
X-Telecom-Digest: Volume 13, Issue 666, Message 9 of 16

Jimmy Gauvin (ji...@cerberus.ulaval.ca) writes:

> Can somebody please tell me how to calculate the distance between two
> NPA-NXXs given their H & V coordinates?

The following is the answer in two forms:

1. as a text statement:

D = Square Root of (((V1 - V2)squared + (H1 - H2)squared)/10) where D
is in miles and V and H are values in the V and H Coordinate System.

For example the distance from San Diego ( 9462 7632)
to San Franciso (8493 8717) is: 460.02,
to Sacramento (8303 8581) is: 473.70,
to Los Angles (9213 7878) is: 110.69.

2. as a C program:
/*
* This program computes distance in miles between
* two points given their V and H coordinates.
*
*/

#include <stdio.h>
#include <math.h>

main()
{
float D;
int V1, V2, H1, H2;

while ( 1 == 1)
{

printf( "enter V and H for first point:\n" );
scanf( "%i%i", &V1, &H1 );
printf( "enter V and H for second point:\n" );
scanf( "%i%i", &V2, &H2 );

D = sqrt((pow ((V1-V2), 2) + pow ((H1-H2), 2) ) / 10 );

printf( "Distance in miles = %7.2f \n", D);
printf (" \n");

}
}

------------- tear here ----------------

Good luck,
Stuart Jeffery 415-966-8199


Subject: V & H FORTRAN Routines
Date: Jul 01 1990
From: Mike....@f27.n285.z1.fidonet.org

The following routines were mentioned by Jim Riddle in a recent Digest
article. The response has already been substantial; however, Jim has
no easy way of sending files through the Internet.

Since several people have already responded, perhaps you couuld run
them in the Digest or mention they are available wherever you put them
in the archives?

C TO CONVERT EITHER EARTH-CENTERED TO LAT/LON OR VICE VERSA
SUBROUTINE M2CONV (OPT,NUMPTS,LATS,LONS,XLAIST,YLIST,ZLIST)
INTEGER*4 OPT,NUMPTS,I
REAL*8 LATS(NUMPTS),LONS(NUMPTS),THETA,PHI,DTR
REAL*8 XLIST(NUMPTS),YLIST(NUMPTS),ZLIST(NUMPTS)
PI=3.141592653589793238462643
DTR=PI/180.
IF (OPT .EQ. 1) THEN
DO FOR I = 1,NUMPTS
THETA = LONS(I) * DTR
PHI = (90.0D+0 - LATS(I)) * DTR
XLIST(I) = DCOS(THETA) * DSIN(PHI)
YLIST(I) = DSIN(THETA) * DSIN(PHI)
ZLIST(I) = DCOS(PHI)
ENDDO
ELSEIF (OPT .EQ. 2) THEN
DO FOR I = 1,NUMPTS
LATS(I) = 90.0D+0 - DACOS(ZLIST(I)) / DTR
IF (XLIST(I) .EQ. 0.0D+0) THEN
IF (YLIST(I) .LT. 0.0D0+0) THEN
LONS(I) = -90.0D+0
ELSE
LONS(I) = 90.0D0+0
ENDIF
ELSE
LONS(I) = DATAN(YLIST(I)/XLIST(I)) / DTR
IF (XLIST(I) .LT. 0.0D0+0) THEN
IF (YLIST(I) .LT. 0.0D0+0) THEN
LONS(I) = LONS(I) - 180.0D0+0
ELSE
LONS(I) = LONS(I) + 180.0D0+0
ENDIF
ENDIF
ENDIF
ENDDO
ENDIF
END

SUBROUTINE LLAXYZ(LAT,LON,ALT,Y,Y,Z)
C SUBROUTINE TO CALCULATE ECI FROM LAT/LON/ALT
C
C RE IS RADIUS OF THE EARTH
C RE = 3437.5 NAUTICAL MILES MORE OR LESS
C 1 NAUTICAL MILE = 1852 METERS (EXACT)
C 1 STATUTE MILE = 1609.344 METERS (EXACT)
C SUBROUTINE _DOES_ REQUIRE ALTITUDE -- CHECK THE LOCAL AIRPORT (!)
C INPUT REQUIRED IS LAT, LON, ALT OF POINT AND RETURNS X, Y, Z
C
REAL LAT,LON,ALT
RE = 3437.75
C RE = 3437.75 * 1.852 FOR KILOMETERS
C RE = 3437.75 * 1.852/1609.344 FOR STATUTE MILES
C ON MOST MACHINES YOU MAY WANT TO GO DOUBLE PRECISION, BY THE WAY
RANGE = RE + ALT
CLAT = COS(LAT)
SLAT = SIN(LAT)
CLON = COS(LON)
SLON = SIN(LON)
Z = RANGE * SLAT
X = RANGE * CLAT * CLON
Y = RANGE * CLAT * SLON
RETURN
END

C CONVERTS LAT AND LONG TO EUCLIDEAN COORDINATES
SUBROUTINE M2EUCL
REAL*4 DEGRAD, PI, ECLX(N), ECLY(N), ECLZ(N)
REAL*4 LOND(N), LATD(N)
INTEGER*4 NUMPTS,I
PI=3.141592653589793238462643
DEGRAD = PI/180.
DO FOR I = 1,NUMPTS
ECLX(I) = COS(LOND(I)*DEGRAD)*COS(LATD(I)*DEGRAD)
ECLY(I) = SIN(LOND(I)*DEGRAD)*COS(LATD(I)*DEGRAD)
ECLZ(I) = SIN(LATD(I)*DEGRAD)
ENDDO
RETURN
END

SUBROUTINE M2DIST(XPT,YPT,ZPT,NUMLST)
INTEGER*4 NUMLST,N,INDEX
C CALCULATE DISTANCES (GREAT CIRCLE) FROM A LIST OF POINTS TO
C A FOCAL POINT
C XPT, YPT, ZPT ARE X, Y, Z COORDINATES OF THE FOCAL POINT
C XLST, YLST, ZLST ARE LISTS OF X, Y AND Z COORDINATES
C RADIUS IS RADIUS OF THE EARTH
REAL*4
XPT,YPT,ZPT,CSQRED,CTHETA,XLST(N),YLST(N),ZLST(N),DLST(N)
DO FOR INDEX = 1, NUMLST
CSQRED = (XLST(INDEX) - XPT)**2 + (YLST(INDEX) - YPT)**2 +
1 (ZLST(INDEX) - ZPT)**2
CTHETA = 1.0 - CSQRED/2.0
DLST(INDEX) = ACOS(CTHETA) * RADIUS
ENDDO
RETURN
END

--- Ybbat (DRBBS) 8.9 v. 3.11 r.3
[1:285/27@fidonet] The Inns of Court 402/593-1192 (1:285/27.0)


Subject: Comments For V & H FORTRAN Routines
Date: Jul 01 1990
From: Mike....@f27.n285.z1.fidonet.org

[Moderator's Note: This message was intended to accompany the V&H
Fortran routines which appeared in Digest # 458 early Wedensday.
Unfortunately it was delayed in transmission and arrived here
later. PT]

The file in the accompanying message contains the routines I
mentioned. It contains several Fortran subroutines which should be
quasi-obvious to implment. If you don't code Fortran, you can
probably understand then from either BASIC or Pascal; if you can't
comprehend the math involved, then you may be in over your head
already.

When using the coordinate system, it is NOT necessary that you have
the same X-Y grid as the phone company so long as you are using
statute miles, nautical miles, furlongs, picometers or whatever
consistent with their distancing measurement. The most convienent way
to do it is probably to use real-Earth latitudes and longtitudes and
PAY ATTENTION TO WHICH ROUTINES USE DEGREES AND WHICH ARE IN RADIANS.

If you really want a polished, finished product, I really can't comply
as I am under some conflict of interest restrictions (sounds nebulous
because it is).

Thanks for the bevy of responses I received.

Jim R.

--- Ybbat (DRBBS) 8.9 v. 3.11 r.3
[1:285/27@fidonet] The Inns of Court 402/593-1192 (1:285/27.0)

--- Through FidoNet gateway node 1:16/390
Mike....@f27.n285.z1.fidonet.org

----------------

gor...@torrie.org Gord Torrie

Eric Ziemer

unread,
Dec 20, 1994, 12:31:42 AM12/20/94
to
writ...@gate.net wrote:

> In <telecom1...@eecs.nwu.edu>, C. Edward Chow <ch...@quandary.harpo.

> uccs.edu> writes:

>> I am working on a project that needs to convert switching nodes'
>> locations expressed in terms of V&H coordinates to those in
>> Longitude and Latitude coordinates. I checked with telecommunications
>> references in the library but can not find the definition of telephone
>> network V&H coordinates. Can someone help pointing to the right

>> references or explain it? Thanks.

> As I recall the V&H system is based on the overlay of an orthogonal
> grid on a equal area projection of North America. This map projection
> results in equal map distance between all points that are equal by
> great circle distance. The grid is rotated about 30% from the map
> north/south. As I recall the numeric values are such that 16 bit fixed
> point arithmetic is convenient for calculations of distance which work
> out to abount .1 mile.

: As you probably know by now you will need to know the exact type of
: equal area projection used by the system and its reference points. The
: conversion is trivial from V&H to map space and a bit complex from map
: space to Lat & Log.

The formulas that I've seen all convert L&L to some units not
identical with V&H. They also required an elevation (radius vector)
as a third element. The X, Y, Z formulas I found were:
X=RAD * COS(LAT) * COS(LONG)
Y=RAD * COS(LAT) * SIN(LONG)
Z=RAD * SIN(LAT)
Where RAD=radius of the earth plus the location altitude (in the same
units, of course). The radius used was 3956.1 miles, I believe.

Eric R. Ziemer zie...@tmn.com
or zie...@mcs.com Chicago, IL

Clarence Dold

unread,
Dec 20, 1994, 4:02:17 PM12/20/94
to
BelCore sells the V&H to Long/Lat routines, as executables for the
IBM-PC, as well as source (but it doesn't say what language), for
$250.

The V&H tables themselves, along with other valuable info, is on a
CDROM, for $700.

I'm not sure if you have to be a carrier to buy this stuff.
Bellcore Traffic Routing Administration
(201) 740-7500


Clarence A Dold - do...@rahul.net
- Pope Valley & Napa CA.

0 new messages