Skip to content
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

Geo-Fences #100

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

Geo-Fences #100

vitalidze opened this issue Mar 3, 2015 · 21 comments
Labels

Comments

@vitalidze
Copy link
Owner

@vitalidze 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
Copy link
Contributor

@bigoss 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
Copy link

@MarceloMJM MarceloMJM commented Mar 3, 2015

will be a great resource .

Att Marcelo.

@Abyss777
Copy link

@Abyss777 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
Copy link
Owner Author

@vitalidze 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
@w32gold
Copy link

@w32gold 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
Copy link

@Abyss777 Abyss777 commented 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?

@vitalidze
Copy link
Owner Author

@vitalidze 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
…ement by users' is checked in Global Settings
@vitalidze
Copy link
Owner Author

@vitalidze vitalidze commented Mar 30, 2015

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

@Abyss777
Copy link

@Abyss777 Abyss777 commented 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
@vitalidze
Copy link
Owner Author

@vitalidze 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
Copy link

@Abyss777 Abyss777 commented Mar 30, 2015

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

@joepr
Copy link

@joepr 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
Copy link
Owner Author

@vitalidze vitalidze commented Apr 3, 2015

@joepr thanks for a good words

@vitalidze
Copy link
Owner Author

@vitalidze 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.