This content has been marked as final. Show 2 replies
Accuracy depends on your data. What accuracy do you need? Do you need to control your calculations (I know a few businesses where that is of extreme importance)?
Or do you need reliability and ease of implementation? Don't forget that your own function might have/introduce bugs that SDO_GEOM.SDO_DISTANCE doesn't have.
One thing that SDO_DISTANCE cannot do, and you can do when you build your own function, is take the accuracy of the GPS measurement into account (PDOP). At least, if your GPS unit provides you with the DOP's, which it should if accuracy is that important. For example: one of your points is measured with a PDOP of 2.5 meter due to awkward psotioning of satellites. Nothing you can do about that, but a calculation of centimeters becomes rather unnessesary at that point. SDO_DISTANCE does not do anything with that, your own function can.
Well, easiest thing to do is to conduct a test.
I looked at this website: http://www.movable-type.co.uk/scripts/latlong-vincenty.html
The answer to the default functional demo is 969954.114 meters.
Testing with SDO_DISTANCE we get (I converted the DMS values to DD):
Which is pretty similar!!
select sdo_geom.sdo_distance( sdo_geometry(2001,8307,sdo_point_type(-5.71475, 50.0663222222,null),null,null), sdo_geometry(2001,8307,sdo_point_type(-3.07009444444,58.6440222222,null),null,null), 0.05) as dist from dual; -- Result -- 969954.113110585
So, don't bother coding your own Haversine (you would have to add extra parameters to pass in the ellisodal params for non-WGS84 SRIDs...), use what comes out of the box.
Does that answer you question? If so, please award points.