Contact us Login VIEW DEMO FREE TRIAL

upload(…)

Import geofences from KML file.

required subuser rights: zone_update

MUST be a POST multipart request (multipart/form-data), with one of the parts being a KML file upload (with the name “file”).

parameters:

name description type
file A KML file upload containing geofences data File upload
default_radius default radius for circle and route geofences, meters, min 20, default 150 Int
dry_run if true returns ready to create geofences or creates it and returns list of IDs otherwise, default true Boolean

return:

dry_run=true

{
  "success": true,
  "list": [
    {
      "id": null,
      "label": "Simple line 1",
      "address": "",
      "color": "27A9E3",
      "points": [
        {
          "lat": 37.818844,
          "lng": -122.366278,
          "node": true
        },
        {
          "lat": 37.819267,
          "lng": -122.365248,
          "node": false
        },
        {
          "lat": 37.819861,
          "lng": -122.36564,
          "node": false
        },
        {
          "lat": 37.819429,
          "lng": -122.366669,
          "node": true
        }
      ],
      "radius": 150,
      "type": "sausage"
    }
  ]
}

dry_run=false

{
  "success": true,
  "list": [
    1,
    2
  ]
}

errors:

  • 233 – No data file (if file part is missing)
  • 234 – Invalid data format

From Placemark with Point geometry will be created circle geofence with radius=default_radius.

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
    <Document>
        <name>Points</name>
        <Placemark>
            <name>named point</name>
            <Point>
                <coordinates>
                    -122.366278,37.818844,30
                </coordinates>
            </Point>
        </Placemark>       
    </Document>
</kml>

From Placemark with LineString geometry will be created route geofence with radius=default_radius.

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
    <Document>
        <name>Simple line</name>
        <Placemark>
            <LineString>
                <coordinates>
                    -122.366278,37.818844,30
                    -122.365248,37.819267,30
                    -122.365640,37.819861,30
                    -122.366669,37.819429,30
                </coordinates>
            </LineString>
        </Placemark>
    </Document>
</kml>

From Placemark with Polygon geometry will be created polygon geofence.
Polygons with holes are not supported. In that case only the outer boundary will be imported and the inner boundary, holes, ignored.

<kml xmlns="http://www.opengis.net/kml/2.2">
    <Document>
        <name>Simple polygon</name>
        <Placemark>
            <name>hollow box</name>
            <Polygon>                
                <outerBoundaryIs>
                    <LinearRing>
                        <coordinates>
                            -122.366278,37.818844,30
                            -122.365248,37.819267,30
                            -122.365640,37.819861,30
                            -122.366669,37.819429,30
                            -122.366278,37.818844,30
                        </coordinates>
                    </LinearRing>
                </outerBoundaryIs>                
        </Placemark>
    </Document>
</kml>

From Placemark with MultiGeometry geometry will be created several geofences.
If Placemark.name defined it will be used as geofence name with respect of hierarchy of Folder and Document.

If you have more questions please contact our support team

Contacts

USA: +1 858 815 9045

Mexico: +52 334 1642158

UK: +44 808 1641499

Germany: +49 1573 5988250

Russia: +7 495 223 0427

Log in

Login

[clean-login]

CLOSE
Register

[clean-login-register]

CLOSE
Loading...