User avatar
Fredrik
Posts: 1152
Joined: Fri Mar 02, 2007 1:04 pm
Location: Sweden
Contact: Website

GUIDE: Import geofences from KML files

Mon Sep 02, 2013 9:30 pm

Note: for an updated version of this and other articles, we recommend you to check our knowledge base here

GUIDE: Import Geofences from KML/KMZ files

How to install

Make sure all plugins are green under SiteAdmin -> Plugins.

The privilege controlling access to the feature is called _ImportGeofence, found under Geofences in SiteAdmin App Privileges. By default it is enabled for the Administrator role.


Usage

1. Login to your Vehicle Tracker application.
2. Open the "Geofences" tab.
3. In the drop-down menu left hand side, just below the "new circle" and "new polygon" commands you should now find the "import geofence" option.
geofence_tab.png
geofence_tab.png (4.04 KiB) Viewed 5055 times

Selecting it the following dialog shows up:
new_tag.png
new_tag.png (28 KiB) Viewed 5055 times

From the top:

Choose KML file
Here you chose a file. You can choose any file as long as it is KML/KMZ format.
At the moment only polygons are supported.
Polygons with holes are not supported. In that case only the outer boundary will be imported and the inner boundary, holes, ignored.
Self intersecting polygons are also not supported and will be skipped (same rules as when you create polygons in the editor).

Geofence Tag
Here you can create a new geofence tag right away, or, if you click the "Existing tag" button, choose an existing tag to add the imported fences to.
If you select a file the field defaults to the filename, or you can simply leave it blank.

Create a tag based on document name
True/false selector (default True). When enabled creates a tag with same name as the KML document, which is then added to all geofences in the document.

Create a tag for each (named) polygon
True/false selector (default True).
This is most useful if your KML uses s.c multi geometry.
I.e. in KML you can define geometry placemarks which contains several geometrical representations.
Example: "My neighbourhood" which contains polygons resembling many individual buildings. Using this flag all of those buildings will be grouped under the "My neighbourhood" tag.
(Each geofence polygon will be named "My neighbourhood (1)", "My neighbourhood (2)" etc though).

The key to understanding and using GpsGate geofences is the tag feature.

Once you have selected a file and are pleased with your settings click the "Upload" button.

When the upload is finished you will get either an "OK" or a "Warning" message containing number of polygons imported or names of the polygons that were rejected for example.


Known issues and limitations

- If you get a "File size too large" error it is because you hit a limit in your IIS setting, typically 4 Mb.
You can increase the limit by editing your web.config file. See for example http://stackoverflow.com/questions/288612/how-to-increase-the-max-upload-file-size-in-asp-net
- But first you might consider compressing your KML to KMZ format!

- If you have a very large KML file (many polygons) or a slow server you might experience a timeout, typically 120s or so.

-The geofence name limit is 128 characters.
-The limit for "custom ID" is 64 characters. If you don't specify an ID in your KML file, the ID will be set to the same as the geofence name, i.e. if the name is 128 characters long the import will not work since the custom ID will be too big.

You can either:
-add an ID to each geofence in your KML file: `<Placemark id="CUSTOM_ID">`. And the custom ID must be unique. It is used to know which geofence to update/replace instead of creating copies every time you import the same file.
-Or, you are limited to 64 characters in the current implementation.


Regards,
Fredrik Blomqvist

GpsGate Support

piter197
Posts: 826
Joined: Sun Jan 09, 2011 3:32 am

RE: GUIDE: Import geofences from KML files

Tue Sep 03, 2013 3:53 pm

Hi Support,

After updating Patch.3840 into version 3.1.0.5091 I found that track drawn and alarm beacon on the track drawn will not move when panning map.

If zoom-in and zoom-out than the track drawn will move accordingly.

Please check. Thank you.

Best Regards,
piter197

User avatar
Fredrik
Posts: 1152
Joined: Fri Mar 02, 2007 1:04 pm
Location: Sweden
Contact: Website

RE: GUIDE: Import geofences from KML files

Tue Sep 03, 2013 7:17 pm

We've identified the problem. An updated Patch.3840 will be released shortly!

Thanks for reporting

Regards,
Fredrik Blomqvist

GpsGate Support

User avatar
Fredrik
Posts: 1152
Joined: Fri Mar 02, 2007 1:04 pm
Location: Sweden
Contact: Website

RE: GUIDE: Import geofences from KML files

Tue Sep 03, 2013 7:54 pm

Please update with new Beta Patch.3840 v3.1.0.5098 and tracks should work again.

Regards,
Fredrik Blomqvist

GpsGate Support

piter197
Posts: 826
Joined: Sun Jan 09, 2011 3:32 am

RE: GUIDE: Import geofences from KML files

Wed Sep 04, 2013 1:20 am

I have update and it solved the problem.

Thank you.

Best Regards,
piter197

mccoe
Posts: 2
Joined: Mon May 12, 2014 2:33 pm
Location: Austria

RE: GUIDE: Import geofences from KML files

Mon May 12, 2014 9:24 pm

Interesting function.

Under which repository do I find this Patch.3840? I checked updates and beta, however to no avail.

Many thanks for a suggestion.

User avatar
Fredrik
Posts: 1152
Joined: Fri Mar 02, 2007 1:04 pm
Location: Sweden
Contact: Website

RE: GUIDE: Import geofences from KML files

Mon May 12, 2014 9:59 pm

If you're using GpsGate Server 4.0 it is already included, you just need to enable it.
Check: SiteAdmin->YourApp->Privileges->Geofence->_ImportGeofence.
And also the corresponding: VehicleTracker->Role->Privileges->Geofence->_ImportGeofence.

(Patch.v4 is the "new 3840", starting with v4 release).

Regards,
Fredrik Blomqvist

GpsGate Support

Ange
Posts: 1
Joined: Fri Sep 23, 2016 6:52 pm

Re: GUIDE: Import geofences from KML files

Fri Sep 23, 2016 6:54 pm

Hi, how do I remove geofences that I have imported (except for clicking each one and selecting remove individually)?

User avatar
johan
GpsGate
Posts: 14660
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

Re: GUIDE: Import geofences from KML files

Fri Sep 23, 2016 9:15 pm

When you remove a Geofence Tag, you get an option to remove all geofences inside the Geofence Tag as well.
Regards,
Johan

GpsGate Support

Return to “GpsGate Server - How to setup and use”