Geo-Fences #100

Closed
vitalidze opened this Issue Mar 3, 2015 · 21 comments

Comments

Projects
None yet
6 participants
@vitalidze
Owner

vitalidze commented Mar 3, 2015

This feature has been requested many times. So I started developing it. Here is how I am going to create first version of this functionality:

  1. Add tab panel at the bottom of devices/vehicles list. First (default) tab is 'Devices' with current table, second will be 'Geo-fences' with list of geofences. Top buttons 'Add/Edit/Delete...' are applied to the objects selected in current active tab.

When geo-fence is selected in list map will scroll to make it visible (like it's working now for devices/vehicles).

  1. There will be three types of geofences:
  • line (with width in meters)
  • circle (with radius in meters)
  • polygon

Each geofence will have name, which will be shown on map. Then it will have a description and color.

  1. Geo-fences will be shown on a separate layer in map.

  2. Each device may be assigned one or multiple geo-fences. Then when it enters/exits geo-fence an event will be recorded and notification sent.

This is it. Once it's all done I will put it into latest release.

vitalidze added a commit that referenced this issue Mar 3, 2015

@bigoss

This comment has been minimized.

Show comment
Hide comment
@bigoss

bigoss Mar 3, 2015

Contributor

Yes !

Just discovered your website
When I first used tracer back in September there was no hope for geofence etc
I have no skills to write something like this so I have just started switching from Traccar to OpenGTS just for geofences.
Having geofences would be a very important feature !
OpenGTS is easier to edit with nicely commented setting entries , separate config files, I18n etc etc, but it's frontend is confusing for users. Ideas like no map on login and all menus created for vehicles in mind
To make it usable for my needs it would require a lot of work to adapt it.
I would choose traccar if it has geofence with email notification.

Regards

Jaroslaw

Contributor

bigoss commented Mar 3, 2015

Yes !

Just discovered your website
When I first used tracer back in September there was no hope for geofence etc
I have no skills to write something like this so I have just started switching from Traccar to OpenGTS just for geofences.
Having geofences would be a very important feature !
OpenGTS is easier to edit with nicely commented setting entries , separate config files, I18n etc etc, but it's frontend is confusing for users. Ideas like no map on login and all menus created for vehicles in mind
To make it usable for my needs it would require a lot of work to adapt it.
I would choose traccar if it has geofence with email notification.

Regards

Jaroslaw

@MarceloMJM

This comment has been minimized.

Show comment
Hide comment
@MarceloMJM

MarceloMJM Mar 3, 2015

will be a great resource .

Att Marcelo.

will be a great resource .

Att Marcelo.

@Abyss777

This comment has been minimized.

Show comment
Hide comment
@Abyss777

Abyss777 Mar 6, 2015

It's perfect to have interface to manage Geo-Fences.

But I think better place for events and notifications on the server side.
Have you thought about moving this functionality to the server side?

Abyss777 commented Mar 6, 2015

It's perfect to have interface to manage Geo-Fences.

But I think better place for events and notifications on the server side.
Have you thought about moving this functionality to the server side?

@vitalidze

This comment has been minimized.

Show comment
Hide comment
@vitalidze

vitalidze Mar 6, 2015

Owner

I thought about it. For now it's easier to manage this on web UI side. I don't interfere with traccar backend development and there are no active development in original traccar-web project too, which makes it easier to support for me. Then to install my modified version it requires only updating single .war file.

I want to wait until it is developed by Anton Tananaev on backend side (since from my understanding he is planning to have a single project) and then will update my code accordingly.

Owner

vitalidze commented Mar 6, 2015

I thought about it. For now it's easier to manage this on web UI side. I don't interfere with traccar backend development and there are no active development in original traccar-web project too, which makes it easier to support for me. Then to install my modified version it requires only updating single .war file.

I want to wait until it is developed by Anton Tananaev on backend side (since from my understanding he is planning to have a single project) and then will update my code accordingly.

vitalidze added a commit that referenced this issue Mar 6, 2015

vitalidze added a commit that referenced this issue Mar 8, 2015

vitalidze added a commit that referenced this issue Mar 24, 2015

vitalidze added a commit that referenced this issue Mar 24, 2015

vitalidze added a commit that referenced this issue Mar 27, 2015

vitalidze added a commit that referenced this issue Mar 28, 2015

vitalidze added a commit that referenced this issue Mar 28, 2015

@vitalidze

This comment has been minimized.

Show comment
Hide comment
@vitalidze

vitalidze Mar 29, 2015

Owner

Just released first beta-version of geo-fences functionality. Updated demo version and written news. So, anyone can see and test what is done at this point. Any feedback is welcome.

As I said in news, please note that notifications are not yet implemented.

Owner

vitalidze commented Mar 29, 2015

Just released first beta-version of geo-fences functionality. Updated demo version and written news. So, anyone can see and test what is done at this point. Any feedback is welcome.

As I said in news, please note that notifications are not yet implemented.

@MarceloMJM

This comment has been minimized.

Show comment
Hide comment
@MarceloMJM

MarceloMJM Mar 29, 2015

Hello vitalidze very good your work.
here only creates geo -fence the administrator and manager , the common User does not appear the option to add .

Hello vitalidze very good your work.
here only creates geo -fence the administrator and manager , the common User does not appear the option to add .

@vitalidze

This comment has been minimized.

Show comment
Hide comment
@vitalidze

vitalidze Mar 29, 2015

Owner

I think you have disabled device management for users in Settings >> Global (check box 'Disallow users to manage devices:'), right now it affects geo-fences too.

Owner

vitalidze commented Mar 29, 2015

I think you have disabled device management for users in Settings >> Global (check box 'Disallow users to manage devices:'), right now it affects geo-fences too.

@MarceloMJM

This comment has been minimized.

Show comment
Hide comment
@MarceloMJM

MarceloMJM Mar 29, 2015

Yes the option to users to manage devices is active.
have some means of geo -fence not be interrupted with the option enabled ?
Thank you .

Yes the option to users to manage devices is active.
have some means of geo -fence not be interrupted with the option enabled ?
Thank you .

@vitalidze

This comment has been minimized.

Show comment
Hide comment
@vitalidze

vitalidze Mar 29, 2015

Owner

Well, I agree, this should not affect geo-fences. Will fix in near future. However, if a user is 'read-only' then he won't be able to manage geo-fences.

Owner

vitalidze commented Mar 29, 2015

Well, I agree, this should not affect geo-fences. Will fix in near future. However, if a user is 'read-only' then he won't be able to manage geo-fences.

@w32gold

This comment has been minimized.

Show comment
Hide comment
@w32gold

w32gold Mar 30, 2015

Hello Sir,
If a vehicle is outside the geofence, will it send any notifications?
Thank you.

On Sun, Mar 29, 2015 at 10:52 PM, Vitaly Litvak notifications@github.com
wrote:

Well, I agree, this should not affect geo-fences. Will fix in near future.
However, if a user is 'read-only' then he won't be able to manage
geo-fences.


Reply to this email directly or view it on GitHub
#100 (comment)
.

w32gold commented Mar 30, 2015

Hello Sir,
If a vehicle is outside the geofence, will it send any notifications?
Thank you.

On Sun, Mar 29, 2015 at 10:52 PM, Vitaly Litvak notifications@github.com
wrote:

Well, I agree, this should not affect geo-fences. Will fix in near future.
However, if a user is 'read-only' then he won't be able to manage
geo-fences.


Reply to this email directly or view it on GitHub
#100 (comment)
.

@vitalidze

This comment has been minimized.

Show comment
Hide comment
@vitalidze

vitalidze Mar 30, 2015

Owner

@w32gold As I have said at the beginning of this thread (in point 4) there will be two types of notifications - one when device enters geo-zone and one when device leaves it.

Owner

vitalidze commented Mar 30, 2015

@w32gold As I have said at the beginning of this thread (in point 4) there will be two types of notifications - one when device enters geo-zone and one when device leaves it.

@w32gold

This comment has been minimized.

Show comment
Hide comment
@w32gold

w32gold Mar 30, 2015

Noted. Thank you for the very nice work.

On Mon, Mar 30, 2015 at 2:32 PM, Vitaly Litvak notifications@github.com
wrote:

@w32gold https://github.com/w32gold As I have said at the beginning of
this thread (in point 4) there will be two types of notifications - one
when device enters geo-zone and one when device leaves it.


Reply to this email directly or view it on GitHub
#100 (comment)
.

w32gold commented Mar 30, 2015

Noted. Thank you for the very nice work.

On Mon, Mar 30, 2015 at 2:32 PM, Vitaly Litvak notifications@github.com
wrote:

@w32gold https://github.com/w32gold As I have said at the beginning of
this thread (in point 4) there will be two types of notifications - one
when device enters geo-zone and one when device leaves it.


Reply to this email directly or view it on GitHub
#100 (comment)
.

@Abyss777

This comment has been minimized.

Show comment
Hide comment
@Abyss777

Abyss777 Mar 30, 2015

I've tested a bit geo-fenses.
If i create poligon with more then some points I get error:

INFO   | jvm 1    | 2015/03/30 12:02:50 | Caused by:
INFO   | jvm 1    | 2015/03/30 12:02:50 | org.h2.jdbc.JdbcSQLException: Value too long for column "POINTS VARCHAR(255)": "'60.566372424366314 56.81841776376451,60.56603714823956 56.81854694380042,60.566329509021784 56.8188023666507,60.5$

Do i need create separate issue or we will discuss problems here while it is in beta state?

I've tested a bit geo-fenses.
If i create poligon with more then some points I get error:

INFO   | jvm 1    | 2015/03/30 12:02:50 | Caused by:
INFO   | jvm 1    | 2015/03/30 12:02:50 | org.h2.jdbc.JdbcSQLException: Value too long for column "POINTS VARCHAR(255)": "'60.566372424366314 56.81841776376451,60.56603714823956 56.81854694380042,60.566329509021784 56.8188023666507,60.5$

Do i need create separate issue or we will discuss problems here while it is in beta state?

@vitalidze

This comment has been minimized.

Show comment
Hide comment
@vitalidze

vitalidze Mar 30, 2015

Owner

@Abyss777 thanks for testing. Let's put all issues here while it is in beta. Unfortunately you will have to update existing database table yourself because length is not updated automatically by hibernate. You have two options here:

  1. Run ALTER TABLE ALTER COLUMN (http://www.h2database.com/html/grammar.html#alter_table_alter_column), something like this might work:

for H2 (default DB in traccar):

ALTER TABLE geofences ALTER COLUMN points VARCHAR(2048)

for MySQL:

ALTER TABLE geofences MODIFY COLUMN points VARCHAR(2048);
  1. Drop existing table and then restart server with new version (not yet released) so it will recreate the table with new default points column length (2048 = ~60 points):
// stop server
DTOP TABLE geofences
// start server
Owner

vitalidze commented Mar 30, 2015

@Abyss777 thanks for testing. Let's put all issues here while it is in beta. Unfortunately you will have to update existing database table yourself because length is not updated automatically by hibernate. You have two options here:

  1. Run ALTER TABLE ALTER COLUMN (http://www.h2database.com/html/grammar.html#alter_table_alter_column), something like this might work:

for H2 (default DB in traccar):

ALTER TABLE geofences ALTER COLUMN points VARCHAR(2048)

for MySQL:

ALTER TABLE geofences MODIFY COLUMN points VARCHAR(2048);
  1. Drop existing table and then restart server with new version (not yet released) so it will recreate the table with new default points column length (2048 = ~60 points):
// stop server
DTOP TABLE geofences
// start server

vitalidze added a commit that referenced this issue Mar 30, 2015

vitalidze added a commit that referenced this issue Mar 30, 2015

vitalidze added a commit that referenced this issue Mar 30, 2015

For #100 - allow geo-fences management even if 'disallow device manag…
…ement by users' is checked in Global Settings
@vitalidze

This comment has been minimized.

Show comment
Hide comment
@vitalidze

vitalidze Mar 30, 2015

Owner

Just released version with several bugfixes/improvements. Updated demo version and written news.

Owner

vitalidze commented Mar 30, 2015

Just released version with several bugfixes/improvements. Updated demo version and written news.

@Abyss777

This comment has been minimized.

Show comment
Hide comment
@Abyss777

Abyss777 Mar 30, 2015

Unfortunately you will have to update existing database table

Tip for linux users

echo "ALTER TABLE geofences ALTER COLUMN points VARCHAR(2048)" > ~/update.sql
java -cp /opt/traccar/lib/h2*.jar org.h2.tools.RunScript -url jdbc:h2:/opt/traccar/data/database -user sa -script ~/update.sql

Unfortunately you will have to update existing database table

Tip for linux users

echo "ALTER TABLE geofences ALTER COLUMN points VARCHAR(2048)" > ~/update.sql
java -cp /opt/traccar/lib/h2*.jar org.h2.tools.RunScript -url jdbc:h2:/opt/traccar/data/database -user sa -script ~/update.sql
@vitalidze

This comment has been minimized.

Show comment
Hide comment
@vitalidze

vitalidze Mar 30, 2015

Owner

@Abyss777 thanks for sharing.

P.S. hope some day I will come to the manual database management instead of letting hibernate library handle this task.

Owner

vitalidze commented Mar 30, 2015

@Abyss777 thanks for sharing.

P.S. hope some day I will come to the manual database management instead of letting hibernate library handle this task.

@Abyss777

This comment has been minimized.

Show comment
Hide comment
@Abyss777

Abyss777 Mar 30, 2015

in wishlist: display current geo-fence in mobile version, like in popup.

in wishlist: display current geo-fence in mobile version, like in popup.

@joepr

This comment has been minimized.

Show comment
Hide comment
@joepr

joepr Apr 3, 2015

Hello Vitalidze

Just wanted to say that I appreciate your time and effort on sharing with us your code. I have a gps tracker that is not supported by open gts however it is with traccar. I wanted to have the option of geo fences for my project. Having this will definitely handle my needs. Once again Thanks!

joepr commented Apr 3, 2015

Hello Vitalidze

Just wanted to say that I appreciate your time and effort on sharing with us your code. I have a gps tracker that is not supported by open gts however it is with traccar. I wanted to have the option of geo fences for my project. Having this will definitely handle my needs. Once again Thanks!

vitalidze added a commit that referenced this issue Apr 3, 2015

@vitalidze

This comment has been minimized.

Show comment
Hide comment
@vitalidze

vitalidze Apr 3, 2015

Owner

@joepr thanks for a good words

Owner

vitalidze commented Apr 3, 2015

@joepr thanks for a good words

@vitalidze

This comment has been minimized.

Show comment
Hide comment
@vitalidze

vitalidze Apr 3, 2015

Owner

Finally, I have finished everything that I planned regarding this function. Written news, updated latest and demo versions. All bugs and feature requests regarding geo-fences should now be submitted in separate issues.

Owner

vitalidze commented Apr 3, 2015

Finally, I have finished everything that I planned regarding this function. Written news, updated latest and demo versions. All bugs and feature requests regarding geo-fences should now be submitted in separate issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment