2

Does st_hausdorffdistance just look at discreet points used to construct a line segment or does it compare two line segments as a continuous set of points?

Also, the points used to construct my line segments are in degrees so the result of st_hausdorffdistance returns a number in degrees as well which is not really sensical.

How can I convert that to meters?

2

From ST_HausdorffDistance in PostGIS documentation and Hausdorff distance at Wikipedia, the Hausdorff Distance is a measure of similarity of two shapes. I think that it returns the greatest difference between a node in one feature from another feature (anywhere on that feature's boundary, I think).

The distance probably isn't that importance, but the relative distances are. Regardless, if you want it in meters, you could to a transform into a different coordinate system first, then do the st_hausdorffdistance on that. Something like:

select st_hausdorffdistance(ST_Transform(geom1,28355), ST_Transform(geom2,28355)) from table
|improve this answer|||||
  • This has me thinking that maybe hausdorff isn't the best tool. I'm trying to find a way of determining how similar two line segments are. If I understand correctly how this works, a single point in a trajectory that is way off may make it look like the two trajectories are dissimilar when in fact that one point may just be an extreme case and while all the other points are close. – Przemek Lach Nov 13 '14 at 22:50
  • Hausdorff is exactly about worst case. – BradHards Nov 13 '14 at 23:58
  • So is there an alternative for determining similarity? The few threads that I've found which talk about similarity suggest hausdorff. – Przemek Lach Nov 13 '14 at 23:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.