I have a bunch of objects which have associated Eastings and Northings in format OSGB36
for example:
265397 869562
547297 179002
If I have a starting Easting and Northing, and wanted to find related objects within X km is it possible to compute a Start/End Northing and Start/End Easting range that I can search for programatically?
I am using C#.
I.e. searching for objects using pseudo-code :
Easting >= 265390 && Easting <= 265400 &&
Northing >= 869560 && Northing <= 869564
would this find nearby objects? What resolution do these coordinates operate to? I can operate in miles or km, just need to know the scale - if such a thing is possible.
Sorry this is new to me.
Answer
See National Grid Reference Converter for help on the precision of OSGB map references.
If you just use a search range to create a box surrounding your query point, as indicated by
(east_QP - range) <= east <= (east_QP + range)
(north_QP - range) <= north <= (north_QP + range)
a variation on your pseudo code, it is fast but biased.
If you "create a circle" around your query point
hypot ((east_QP - east), (north_QP - north)) <= range
where hypot()
computes distance, it is a tiny bit slower but less biased as it cuts out the box corners.
No comments:
Post a Comment