Select to view content in your preferred language

distance between 2 layer points

4584
16
11-26-2014 11:50 PM
Deactivated User

Hello Everyone

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

Tags (1)
16 Replies
Deactivated User

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

Deactivated User

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?

Deactivated User

Have a look following samples;

Additionally you may create a geoprocessing model to simplify your work.

Deactivated User

Thankyou for your help

I will have a look

Deactivated User

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

Deactivated User

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)

Deactivated User

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

Deactivated User

I think it requires ArcInfo License.

Deactivated User

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