question about calculating distances

726
9
10-30-2011 09:48 AM
michellepop
New Contributor
Hello everyone,
I created an OD matrix for distances between facilities and population centroids. Neither the facilities nor the centroids are located on the street network, but some distance away (e.g., 50-200 m). When I manually verify the distances I obtained in the OD matrix, I get values that are close, but not identical to the values from the matrix. I am not sure how are these distances being calculated? Are they measured from the point on the network that is nearest to the facility to the point of the network that is nearest to the centroid only? I believe the additional distances to the facilities and centroids (the so called "snapping distances") are not considered, is that right?
My points layer and my street layer are in the same projection.
Thank you!
Tags (2)
0 Kudos
9 Replies
RamB
by
Occasional Contributor III
hi,

Ideally they should not differ. And yes, snapping distances are not added (as far as I am sure). Do you have problems with all the pairs ? If not, just have another look at your cutoff distance parameter in your settings for OD matrix. This should not be the reason, but just have a look.

As the documentation suggests, OD matrix is a quick solver and does not take into account shapes. May be there are slight differences in the manual version and OD (batch) versions of the algorithms. I stand under correction.

Probably you should quantify your differences. Are they always differ by same amount, same percentage, may be some peculiar network edge common to all your (error) paths.
0 Kudos
JaySandhu
Esri Regular Contributor
hi,

Ideally they should not differ. And yes, snapping distances are not added (as far as I am sure). Do you have problems with all the pairs ? If not, just have another look at your cutoff distance parameter in your settings for OD matrix. This should not be the reason, but just have a look. .


The OD and all Network Analyst solvers find paths from the location where they snapped on the network. If your point is 30 meters away and you solve on travel time, how do you add the 30 meters to the travel time. So the total path length (in attribute units) is always on the network. It has nothing to do with the CUTOFF which is used to limit how far away you want to compute the distances too.

As the documentation suggests, OD matrix is a quick solver and does not take into account shapes. May be there are slight differences in the manual version and OD (batch) versions of the algorithms. I stand under correction.


Where does the documentation suggest that OD does not take into account shapes? The OD solver and all the Network Analyst solvers compute distances on the actual network. The only thing OD does not return back (for performance reason) is the actual geometry of the path taken. The OD is used when all you want is the network distance and do not care to see the path geometry.

So to answer the original post, OD returns back distances on the network. If you want to add the snapping distance, then first use the GP tool Calculate Locations on your points. This will add the network location fields and also the x,y of the snapped point and distance to the network edge (make sure your projection is set to return the same distance unit as what you are solving on so that you get miles from edge if you are solving to minimize miles or you can convert it later with field calulator). Now create the OD layer and when you do load location, use the network location fields AND map the distance to the Attr_Length (or what ever the name of your distance attribute is). Now when you solve, the distance to the network will be added to the path length returned back after the solve.

Jay Sandhu
0 Kudos
michellepop
New Contributor
Thank you so much Bsimarak and Jay for your prompt answers! I truly appreciate your help! Your answers are very helpful
Jay, thank you for providing me again with the right solution! I will take your advice.
Have a nice day!

The OD and all Network Analyst solvers find paths from the location where they snapped on the network. If your point is 30 meters away and you solve on travel time, how do you add the 30 meters to the travel time. So the total path length (in attribute units) is always on the network. It has nothing to do with the CUTOFF which is used to limit how far away you want to compute the distances too.



Where does the documentation suggest that OD does not take into account shapes? The OD solver and all the Network Analyst solvers compute distances on the actual network. The only thing OD does not return back (for performance reason) is the actual geometry of the path taken. The OD is used when all you want is the network distance and do not care to see the path geometry.

So to answer the original post, OD returns back distances on the network. If you want to add the snapping distance, then first use the GP tool Calculate Locations on your points. This will add the network location fields and also the x,y of the snapped point and distance to the network edge (make sure your projection is set to return the same distance unit as what you are solving on so that you get miles from edge if you are solving to minimize miles or you can convert it later with field calulator). Now create the OD layer and when you do load location, use the network location fields AND map the distance to the Attr_Length (or what ever the name of your distance attribute is). Now when you solve, the distance to the network will be added to the path length returned back after the solve.

Jay Sandhu
0 Kudos
michellepop
New Contributor
Thanks, Srirama,
I will take your advice!

hi,

Ideally they should not differ. And yes, snapping distances are not added (as far as I am sure). Do you have problems with all the pairs ? If not, just have another look at your cutoff distance parameter in your settings for OD matrix. This should not be the reason, but just have a look.

As the documentation suggests, OD matrix is a quick solver and does not take into account shapes. May be there are slight differences in the manual version and OD (batch) versions of the algorithms. I stand under correction.

Probably you should quantify your differences. Are they always differ by same amount, same percentage, may be some peculiar network edge common to all your (error) paths.
0 Kudos
RamB
by
Occasional Contributor III
Hmm, I am still wondering, why should there be a discrepancy in the first place (as originally posted) ? Sorry may be I did not get the message.
0 Kudos
michellepop
New Contributor
Hello again,

I am writing again about the issue I described above. I used the GP tool and calculated locations for the origins. I did the same for destinations.

However, when I try to create the OD matrix, the "distance" field is not shown in the Location Analysis Properties for destinations. Therefore, I can only specify that I need distance measured from the centroid of the origins (facilities) but there is no way to specify that I need distance measured to the centroid of destinations (population points). I am not sure what to do next.

Any help would be greatly appreciated.
0 Kudos
michellepop
New Contributor
Hello again,

I am writing again about the issue I described above. I used the GP tool and calculated locations for the origins. I did the same for destinations.

However, when I try to create the OD matrix, the "distance" field is not shown in the Location Analysis Properties for destinations. Therefore, I can only specify that I need distance measured from the centroid of the origins (facilities) but there is no way to specify that I need distance measured to the centroid of destinations (population points). I am not sure what to do next.

Any help would be greatly appreciated.
0 Kudos
JaySandhu
Esri Regular Contributor
In that case I will suggest that you use the Closest Facility solver instead of the OD. Use the Origins as Incidents and the Destinations will be Facilities and make sure on the Analysis Settings to set the Facilities to Find to the total number of destinations you have.  You should be able to map the "distance" to the Attr_Length on both facilities and destinations.

Jay Sandhu
0 Kudos
michellepop
New Contributor
Hi Jay,

My aim is to create 500, 1000, and 1500 m street networks buffers around centroids of origins (facilities located at a certain distance from the street network).

Therefore, based on your advice, I will first use Calculate Location having Facilities as Origins to get the distance from the centroid of the facility to the nearest network point.

Second, I will create the OD matrix for distances between the nearest network point of origins (facilities) to the nearest network point of destination (population points).

Third, I will use NEAR to get the distance from the nearest point of destinations to the centroid of population point.

Finally, I will add these three distances and then extract the 500, 1000, and 1500 m distances. Does that sound right?

Thank you so much for responding so quickly!
Have a nice day!


In that case I will suggest that you use the Closest Facility solver instead of the OD. Use the Origins as Incidents and the Destinations will be Facilities and make sure on the Analysis Settings to set the Facilities to Find to the total number of destinations you have.  You should be able to map the "distance" to the Attr_Length on both facilities and destinations.

Jay Sandhu
0 Kudos