Page 1 of 1

Geofencing

Posted: March 9th, 2023, 5:06 am
by Xavi
How best can control the EA map boundaries in CSpro.. ,help me with an example. I want the interview not to interview household beyond the EAmap boundaries.

Re: Geofencing

Posted: March 9th, 2023, 7:48 am
by htuser
I worked on this issue years ago and with Josh's help, we also had an implementation in CSPro. Please take a look on this post: viewtopic.php?p=10501
I also think that another CSProuser, Arshad, published an implementation based on above post.

However, because CSPro doesn't support using dictionary items, records alias (or dictionary symbol that are unknow until the runtime) in logic, It's impossible for me to publish a ready to use/standalone lib that anyone can use in their logics.
Hope this help you.
Best,

Re: Geofencing

Posted: March 9th, 2023, 10:48 am
by khurshid.arshad
Dear
Please go through this tutorial.
https://youtu.be/cKnsiMp-kq4

Maybe it will work for you.
Best.
a.

Re: Geofencing

Posted: March 11th, 2023, 12:00 pm
by htuser
The way that I implemented it is different from Arshad and even the way that Josh implemented the demo.
The reason is, since 2016, I'm thinking on Easy to use, ready to use and standalone CSPro libraries.

So, for geofencing, my implementation follow these steps:
a) Transform AOI polygon in points It's possible to use ArcGIS and QGIS tools for this. However, for open encoding GIS format such as Geojson, KML, it's possible to use a scripts written in CSPro logic or/and Javascript to extract points from polygons.
b) Create a CSPro Dictionary and store these points in CSDB/CSDBE: This way is more convenient because it allow us to change AOI and easily smart sync them as points to CSEntry apps.
c) Recreate polygons on the fly using approach that Josh and I described. Because I'm more at ease with SQL, I'm using it rather than Josh's approach;
d) Array of Points to Geojson I Implemented some CSPro functions able to convert any array of X,Y points (respecting some rules) to a Geojson polygon. So, users can visualize them on dynamic mapping features embed in CSEntry apps.

Years ago, I discussed with the CSPro Developer Team about the need to have in CSPro a support for dictionary records and items that are unknow until the runtime,
viewtopic.php?f=1&t=3083
viewtopic.php?f=1&t=3771
viewtopic.php?f=1&t=3641
that's Greg called "ToSymbol function".

Greg already implement something like this for user defined functions using"Runtime binding".
However, we're still wait for the "ToSymbol function".
When, this limitation is solved for dictionary symbols, I'll do my best to submit to CSProusers some easy to use code sources for solving some issues.

Best