-
Notifications
You must be signed in to change notification settings - Fork 31
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
[Geofencing] Support for polygon area type #194
Comments
As discussed during the meeting, some considerations:
|
Sorry to be late on this one but from my perspective the second bullet point mentioned by @jlurien is critical & must be solved before to move forward with the PR. |
I would allow implementers only to implement one of the available area types. If an unsupported area type is requested by the client, the implementer could return 501 or 422. |
Even if a implementation supports a polygon, it will likely not support any kind of polygon, e.g. a polygon as big as Europe, Moreover, there are already error scenarios with Circles that we have not detailed in the spec, e.g. if the circle is in the ocean or in another country, which is the expected behaviour when requesting a subscription? This has been mentioned in #133 So in general, we have to define the behaviour when the geofence area is not acceptable for the implementation, and there may be many reason for that: geometry not supported (if we allow polygons), area too big or small, location not supported (out of the network coverage, lack of precision), etc. |
We are going to implement the validation of the max size of the polygon by retrieving its two furthest points maybe additionally by calculation the area of the polygon (distance check for points will not allow thin long stripes as area). We cannot make it a part of specification like the max radius for circle areas but at least as comment in specification
Would be a usage of http error 405 or 422 a proper case for it?
Done in the current pull request
For me it's a separate use case |
405 is more appropriate for cases where the combination of the api URI and the http method is not defined in the api spec. |
422 is the error code that is being established for cases where the input values are not acceptable, due to server-side logic. It could serve as response for inputs which are syntactically correct but semantically not valid. |
Problem description
Additionally to circles the Geofencing API should support polygon type areas. Circle type is rarely used as geofence. Usually a geofence describes a shape of an (often human built) geographical object like factories, buildings, city and country areas.
Possible evolution
Add polygon areas. The new datatype can be based on Geojson scheme (sorted array of 3DPoint-s) but using 2D geo type Point.
Minimal number of points in the array is naturally set to 3. Maximal number can be restricted to 16 in order to avoid possible performance issues when calculating intersections between location area and geofence for triggering entering/leaving events.
The array of geo points can be non-closed (first and last point are meant to be connected by last edge and should not be the same point) and required to be sorted. In this case the implementation should validate the polygon for edge intersections.
The text was updated successfully, but these errors were encountered: