Skip to content
This repository has been archived by the owner on Nov 7, 2018. It is now read-only.

Querying for a school by name and returning location.lon does not work #227

Open
hollyallen opened this issue Oct 8, 2015 · 5 comments
Open

Comments

@hollyallen
Copy link
Contributor

When querying for a school by name and wanting to get the location.lon value, the result in an error. Other return values, such as school id, work as expected.

Based on this user report: http://opendata.stackexchange.com/questions/6169/unable-to-get-lat-long-in-api-call

I am trying to get the latitude and longitude for different schools, and keep getting an error. Location is at the root, and I am able to get ids which are also at the root, so I'm not sure what I'm doing wrong.

This does not work: https://api.data.gov/ed/collegescorecard/v1/schools?_fields=location.lon&school.name=pepperdine&api_key=**********

but this does: https://api.data.gov/ed/collegescorecard/v1/schools?_fields=id&school.name=pepperdine&api_key=***********

@yozlet
Copy link
Contributor

yozlet commented Oct 14, 2015

Apparently we explicitly exclude the location fields from the field_types() method which is why that error's coming up. (And we also explicitly add a geo_point type for location whether or not such a field is in the dataset.)

@ultrasaurus: Any idea why we explicitly exclude those fields?

@slhaines
Copy link
Contributor

Is it because their searches are not yet adapted to the dot notation: location.lat and location.lon?

@yozlet
Copy link
Contributor

yozlet commented Oct 14, 2015

@slhaines: No, they're querying the right way, but we're effectively not allowing that for some reason. Also, just using _fields=location causes some weird errors in the tests. Will investigate further.

@ultrasaurus
Copy link
Contributor

location was implemented as a special case -- the name is hard-coded to "location" and geocoding is handled special for this one field.

@yozlet
Copy link
Contributor

yozlet commented Feb 2, 2016

Since it may take us a while to get around to fixing, have documented in #283.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants