Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define API for validating specific problem geolocation #38

Open
peterwtux opened this issue Apr 8, 2014 · 1 comment
Open

Define API for validating specific problem geolocation #38

peterwtux opened this issue Apr 8, 2014 · 1 comment

Comments

@peterwtux
Copy link

We use /location.xml?long=-x&lat=y to allow clients to test whether we will accept tickets for a specific geolocation. Like /boundaries.FMT, this allows clients to quickly give feedback on a point and keep the customer from wasting time entering more info about a point where we cannot provide service. Sample output:

Good point:

<response>
<location_found>true</location_found> (boolean; indicates we're confident where the point is)
<jurisdictions> (array of relevant jurisdictions)
<jurisdiction>
<jurisdiction_id>someplace.gov</jurisdiction_id>
<our_jurisdiction>true</our_jurisdiction> (we will accept tickets for this jurisdiction)
<location_ok>true</location_ok> (yes, for this location)
</jurisdiction>
</jurisdictions>
</response>

Bad point:

<response>
<jurisdictions></jurisdictions>
</response>

@peterwtux
Copy link
Author

I'd like to suggest extending this in three ways:

  1. allow the jurisdiction response object to include an optional "address_string" value (to allow this method to be used as a reverse geocoder)
  2. allow the jurisdiction response object to include an optional "error_description" attribute
  3. accept an optional input argument service_code

Also I suggest extending GET /services/[service_code].[format] to include an optional "validate_location" boolean response attribute of the service_definition element. If true, validate_location indicates that the client should use /location.xml?long=-x&lat=y&service_code=z to validate a specific location for that specific service code before trying to create a service request for that service code (and that the service might reject requests for locations that might be acceptable for other service codes).

Any non-empty error_description should be shown to the client for any jurisdiction element where our_jurisidiction is true, to explain why the location is being rejected.

Any non-empty address_string should be suggested to the client for any jurisdiction element where location_ok is true.

This would allow more intelligent handling of requests, whether it's for purely spatial reasons like only accepting pothole requests for roadway locations maintained by the jurisdiction, or for other reasons like during a winter storm not accepting snow removal requests on public streets that have not yet been plowed and are not expected to be passable yet.

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

No branches or pull requests

1 participant