-
Notifications
You must be signed in to change notification settings - Fork 558
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
Dividing a region into geofences #164
Comments
Hi Salfi, It shouldn't matter the size of the fence, just the complexity and the number of operations that it has to perform. A geofence is similar to a SET followed by a NEARBY, INTERSECTS, or WITHIN query on the defined fence area. For a complex geofence such as a country, it's ideal to use a GeoJSON object with a defined "bbox": For example: Is better than: This is because the "bbox" won't need to be recalculated after each SET command. If what you are interested crossing between geofences such as: Then it could be worthwhile to reduce the fences down to a minimal threshold: put a boxes around those too: and use the DETECT enter option when defining both fences. Here's some examples based on the images above:
These are just some ideas based on assumptions. I'm sure you application will differ quite a bit. Also roaming fences will increase the number of operations and notifications quite a bit. So you may want to do some basic testing on your side to see what throughput you get. The original geojson which I created at http://geojson.io Bolivia{
"type": "Polygon",
"bbox": [-63.325195,-21.983801,-57.612304,-18.458768],
"coordinates": [[
[-63.325195,-21.983801],
[-62.819824,-21.983801],
[-62.644042,-22.309425],
[-62.292480,-21.063997],
[-62.314453,-20.529933],
[-61.918945,-20.076570],
[-61.765136,-19.642587],
[-60.380859,-19.373340],
[-59.985351,-19.290405],
[-59.084472,-19.269665],
[-58.117675,-19.849393],
[-58.117675,-20.220965],
[-57.810058,-19.993998],
[-58.029785,-19.663280],
[-57.612304,-18.458768],
[-63.325195,-18.458768],
[-63.325195,-21.983801]
]]
} Paraguay{
"type": "Polygon",
"bbox": [-62.644042,-22.309425,-57.857675,-19.269665],
"coordinates": [[
[-57.957675,-22.109425],
[-62.644042,-22.309425],
[-62.292480,-21.063997],
[-62.314453,-20.529933],
[-61.918945,-20.076570],
[-61.765136,-19.642587],
[-60.380859,-19.373340],
[-59.985351,-19.290405],
[-59.084472,-19.269665],
[-58.117675,-19.849393],
[-58.117675,-19.849393],
[-58.117675,-20.220965],
[-57.857675,-21.049393],
[-57.957675,-22.109425]
]]
}
---
|
@amorskoy I would love to hear more details about your POC and the application. If you have some time in the future. :) |
@Salafi-Farooq I'm closing this issue for now. Please feel free to reopen if you have further questions. Thanks! |
@tidwall How does one go about geofencing a city? |
@tidwall Given a location specified as a lat/lon pair, how do I find which of many tens of thousands of geofences this location falls into using tile38? |
Hey this is some tremendous software system for geospatial stuff.
I have a use-case wherein I need to divide a given geographical area, which can range from small region of few kilometers to a country, into geofences (static + roaming). How do you think I should proceed with this using tile38?
The text was updated successfully, but these errors were encountered: