distance between 2 layer points

3685
16
11-26-2014 11:50 PM
ImaginationImagination
New Contributor

Hello Everyone

Please help me with this

I have Arcmap 9.3

On this i have 2 layer points witch i need to calculate the distance between all the point on layer 0 and other point on layer 2

But i need to tdo this in vba of Arcmap by this logic situation

-get the all the point in layer 0 and storied them  in an array

get all the point in layer 2 and stored them in a nother array

no calculate the distance for each point on layer 0 to each point on layer 2

this is a formula : dist_layerp = Sqr((x2 - x1) ^ 2 + (y2 - y1) ^ 2)

IF the distance between point on layer 0 and point on layer 2 is 50 or - 50 create a field on table with value 0

But the trick is that i need to search  in layer 2 if the point to point is another 50 end then stop it he distance from next point is more then 50

the picture Bellow shows what i need.

Thankyou very much for your help

0 Kudos
16 Replies
SuleymanARSLAN
New Contributor III

Did you try to use "Near", "Point Distance" or "Generate Point Table" tools from toolbox. You can run tools manually or within vba code.

ArcGIS Desktop Help 9.3 - An overview of the Proximity toolset

0 Kudos
ImaginationImagination
New Contributor

i need to user the near point direct from layers

So a need to calculate the distance from point on the line of layer 0 to the near point of layer 2 but need to do this using vba macro

How to eun generate point table from vba code?

0 Kudos
SuleymanARSLAN
New Contributor III
0 Kudos
ImaginationImagination
New Contributor

Thankyou for your help

I will have a look

0 Kudos
ImaginationImagination
New Contributor

Well i looked at the reference.

The problem is that i need to get the coodonate from all point of layer 0 and 2 and then calculate there distance.

I wander is there a way to do this by put all point in a collection or somehow to calculate there distance using vba macro on Arcmap 9.3.1

0 Kudos
SuleymanARSLAN
New Contributor III

The tools "Near", "Point Distance" and "Generate Point Table" are not require coordinates. Just you have to set input features (layer 0) and near features (layer 2)

0 Kudos
ImaginationImagination
New Contributor

On arcmap 9.3.1  tools i cannot fiind generate  point table or point distance or near

Could you please show me a prinscreen or something

0 Kudos
SuleymanARSLAN
New Contributor III
0 Kudos
ImaginationImagination
New Contributor

So that explain why i don't have this utility

SO i guess i need to fiind a way  to do this programabily

Thankyou for your help

0 Kudos