[UW-GIS-L] Calculating distance
Harvey Greenberg
hgreen at u.washington.edu
Mon Feb 26 16:29:20 PST 2007
Assuming that you have line segments that are not necessarily vertical,
I would write a nested loop at the arcedit command line. Conceptually:
for each point, use the show function to set variable to X and Y
set bestyet = 9999
for each line, use the show function to set variable to X1, Y1, X2 and Y2
if Y1 < Y < Y2 or Y1 > Y > Y2
if X1 < X or X2 < X
if (X1<X) and (X2<X) or (algebra shows that the line is to the
west)
do some algebra for point-to-line distance (or export
candidate lines and use the NEAR command)
adjust result if intercept > Y2 or < Y1
if distance < bestyet
save distance and line id
This is tedious to write in aml (or any language), and it will run
slowly (how many points and lines do you have?), but:
if I understand the question correctly
if you want to try this
I could help code up the aml
harvey
Amber L Pearson wrote:
>
> Hello,
> Using vector data, I want to calculate the distance of the nearest
> line to the WEST of a point (between just west of north and just west
> of south). Ideas?
>
> Amber L. Pearson
> 2600 NW 56th Street #5
> Seattle, WA 98107
>
>
>
> _______________________________________________
> Uw-gis-l mailing list
> Uw-gis-l at u.washington.edu
> http://mailman1.u.washington.edu/mailman/listinfo/uw-gis-l
--
hgreen at u.washington.edu 374 Johnson Hall 206-685-7981
http://gis.ess.washington.edu/
Harvey Greenberg
University of Washington
Department of Earth and Space Sciences
Box 351310
Seattle WA 98195-1310
More information about the Uw-gis-l
mailing list