distance between different points

832
7
04-08-2013 05:50 AM
Lizhang1
New Contributor
I have a question for calculation of different points in a layer and need to export the results of distance matrix in a *.csv document with VBA & ArcObjects. (I Have the map layer of points (vector data) and the attribute table of the points.)
Some one has ever suggested me the interface, but I am still lost, since I am a real beginner and only have some unclear conception. Could anyone help me to write the code that I can copy and use it?
Thanks very much!
0 Kudos
7 Replies
nicogis
MVP Frequent Contributor
if you have an arcinfo license you can use Point Distance http://help.arcgis.com/en/arcgisdesktop/10.0/help/0008/00080000001r000000.htm

Use same fc class for in_features and near_features. You also can supply a radious if you need matrix of points with distance < radius. Remember that if you have 1,000 points, then the output table can contain one million records. If you set a radius you could have many fewer records.
0 Kudos
Lizhang1
New Contributor
I am writing code for distance between 150 points to 2 source points, which are vector data and on two layers. How can I define the source points? how to use IProximityOperator.ReturnDistance for the calculation?

Thanks.
0 Kudos
Lizhang1
New Contributor
I am writing code with VBA for distance between 150 points to 2 source points, which are vector data and on two layers. How can I define the source points? how to use IProximityOperator.ReturnDistance for the calculation?

Thanks.
0 Kudos
Lizhang1
New Contributor
I am using VBA for the code and need to store the calculation result in the existing attribute table or in a new table. I am seeking for help for the code.

Thanks.
0 Kudos
Lizhang1
New Contributor
I am writing code in VBA to calculate distances between 150 points and 2 source points which are in different layers, but I am unclear how to use the array. Could anyone give me a hand? Thanks,
0 Kudos
sameerpuppal
Occasional Contributor
Hi,

If you want euclidean distances of each point to all other points in a Featureclass then same can be done by OD Matrix which is available in Network Analyst. The same can be called programatically too.

Check this link : http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00470000004r000000

Hope this helps, Best Luck


Regards,
Sameer Puppal
GIS Developer
Mahindra Satyam, India
0 Kudos
sameerpuppal
Occasional Contributor
I am writing code with VBA for distance between 150 points to 2 source points, which are vector data and on two layers. How can I define the source points? how to use IProximityOperator.ReturnDistance for the calculation?

Thanks.


Hi,

Also instead of using IproximityOperator, you can directly use a ILine to get distance between two points, you can set from point and to point for a ILine Object and get Length from its property directly.


Regards,
Sameer Puppal
GIS Developer
Mahindra Satyam, India
0 Kudos