Paul, any chance that you are working in an org with a Namespace (e.g. a Managed Package development org)? I created an identically-named geolocation field (Location__c) on the Account object in my org, and ran the following query, but it only worked when I prepended the namespace prefix (e.g. SFDC auto-namespace-prepending logic is not working, I guess):
List<Account> accs = [select Location__Latitude__s, Location__Longitude__s, Name
from Account
where DISTANCE(namespace__Location__c,GEOLOCATION(-0.15971300,51.46643590),'km')<=5];
Again, this only worked when I used namespace__Location__c, NOT Location__c.
As far as your syntax and use of the field, I believe that you are using it correctly. Here is some information from jcai posted on the engineering blog after the feature came out in Pilot in Summer 12:
Unfortunately, no official doc is available for pilot. Usage is
actually quite simple.
You add location field just like any other custom field.
two functions are provided:
LOCATION(lat, lng), and DISTANCE(loc1, loc2, “km”/”mi”)
component reference suffix is __s, for example, if you have a loc
field,
you can use loc__Latitude__s, and loc__Longitude__s to get the
latitude and longitude of the loc field in formula and in SOQL/Apex
Some caveats for pilot release
ORDER BY is not supported
SELECT works on component levels only, i.e., SELECT loc__Latitude__s FROM object works, but SELECT loc__c FROM object does
not
DISTANCE function in WHERE clause needs to be strictly in the format of
DISTANCE(loc__c, GEOLOCATION(<lat>, <lng>), "mi"/"km") in which loc__c
is the field of the object, and GEOLOCATION(<lat>, <lng>) is the
literal form of a geo location point