Open RamRaider opened 7 years ago
Yes, limiting and radius and paging are all things that need doing. There's no support for radius at present, although theoretically it's just a case of using ST_Distance_Sphere in this case it's a little more complicated.
In the meantime, so you can keep your resultsets small you could go to https://data.gov.uk/data/api/health#sql
and try the following query
select * from hospitals
order by ST_Distance(LatLong, ST_SetSRID(ST_MakePoint(52.64105830207872, 1.032092571258545), 4326))
limit 10;
If you then click download as json you should have the URL to use. Obviously it isn't as useful as radius, but it might help you progress in the meantime.
:) Brilliant - thanks for the useful response and code! I shall give the example sql a try and see how I get on with that approach
It appears that ALL results are returned from queries such as
which seems pointless as the returned data is much larger than it needs to be. Is there or can there be a distance limiting parameter - ie
etc??
In the API documentation it states there is the ability to query the database directly by crafting the sql and appending to the endpoint url - but it is unclear how one would use this approach to achieve the desired distance limit mentioned.