Area uses WKT format:
Thank You Anton, can this also be published on the site? API-Reference guide? the new one thats up?
It's generated from the swagger file. Feel free to send a pull request for it.
Area uses wkt, but it is said that a circle with radius is not supported by wkt. How do we draw a circle in the map?
For circle we use some non-standard, but commonly used WKT format:
https://github.com/tananaev/traccar/blob/master/test/org/traccar/geofence/GeofenceCircleTest.java
Also, want to note that polygons with hole not supported, just simple polygon https://github.com/tananaev/traccar/blob/master/test/org/traccar/geofence/GeofencePolygonTest.java
Documentation:
Geofence: object
id: integer
name: string
description: string
area: string
calendarId: integer
attributes: object
Area? is my adress ?
Have you actually tried reading this thread before posting your question?
In this case:
public void testContainsCircle() throws ParseException {
String test = "CIRCLE (55.75414 37.6204, 100)";
GeofenceGeometry geofenceGeometry = new GeofenceCircle();
geofenceGeometry.fromWkt(test);
Assert.assertTrue(geofenceGeometry.containsPoint(55.75477, 37.62025));
Assert.assertTrue(!geofenceGeometry.containsPoint(55.75545, 37.61921));
}
containsPoint
Refers to latitude and longitude ?
and
CIRCLE (55.75414 37.6204, 100)
Refers to circle view?
Circle is a circle obviously. containsPoint
is a Java method.
Bro you are so pro, but we need an example. My thesis is about "location" and i love your job, if you could be more flexible.
Example of circle area:
CIRCLE (55.75414 37.6204, 100)
Example of polygon area:
POLYGON ((66.9494 179.838, 66.9508 -179.8496, 66.8406 -180.0014))
Thanks, now when i try to link a Geofence with a Device i can't send my array geofenceIds integer[], how can i make my body for make my insercion ?
https://github.com/ginppian/borrar/blob/master/Screenshot_2.png
Dear All,
If I want to create a geo-fence using traccar API.
What is the format to be used for the area ?