Home PageFacebookRSS News Feed
PocketGPS
Web
SatNav,GPS,Navigation
Pocket GPS World - SatNavs | GPS | Speed Cameras: Forums

Pocket GPS World :: View topic - Integration time... Using STA to submit to PGPSW Database
 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile   Log in for private messagesLog in for private messages   Log inLog in 

Integration time... Using STA to submit to PGPSW Database

 
Post new topic   Reply to topic    Pocket GPS World Forum Index -> Speedtrap Alert (STA)
View previous topic :: View next topic  
Author Message
MaFt
Pocket GPS Staff
Pocket GPS Staff


Joined: Aug 31, 2005
Posts: 15140
Location: Bradford, West Yorkshire

PostPosted: Mon Aug 21, 2023 10:18 am    Post subject: Integration time... Using STA to submit to PGPSW Database Reply with quote

As many of you know I have been working alongside Leo_A to add a number of features to STA that work specifically with the PGPSW Database (eg the 'EXITSPECS' points that disable average speed when you turn off a main road without END camera etc).

Leo has also very kindly created a basic API that we can use to help with submissions to the PGPSW database from PGPSW members. I am now starting to work on this integration and there's a small change you need to make in the app to allow the submissions to be linked to your account.

In Settings - Databases find the PGPSW database and tap it to show the 'Database properties' pop up. On there, please click the "Attach my login to feedback" option. Only PGPSW will see these usernames via a secret key in the API. The data available in the public API will remain anonymous.

The first step of the integration will be for 'seen again' reports for mobiles (and pMobiles) as well as remove requests for all other fixed cameras. Without ticking the box mentioned above will mean that if your remove request is first then we will not be able to link it to your account for the free 1 year subscription.

Further down the line, new camera additions will also be available through STA. At present this is possible but there is no way to link it to your PGPSW user account.

I will update this post when the feature is tested, working, and live.

MaFt
Back to top
View user's profile Send private message Visit poster's website
MaFt
Pocket GPS Staff
Pocket GPS Staff


Joined: Aug 31, 2005
Posts: 15140
Location: Bradford, West Yorkshire

PostPosted: Mon Aug 21, 2023 10:22 am    Post subject: Reply with quote

For now, if you need to make a new submission then create it in STA and before submitting it take a screenshot so you have the coordinates. You can submit these manually on the website.

Some phones (Oppo, OnePlus etc) have an excellent feature where you can swipe the phone with 3 fingers to take a screenshot. The Pixel phones you can tap the 'square' button (or swipe upwards) to show all the currently open apps and tap the 'screenshot' button.

Otherwise the standard 'power + volume down' button press will take a screenshot although this isn't easy when your phone is in a mount.

Regardless of which method you use to log the coordinates of a new camera, make sure you are pulled over/parked and it is safe to carry out the task.
Back to top
View user's profile Send private message Visit poster's website
MaFt
Pocket GPS Staff
Pocket GPS Staff


Joined: Aug 31, 2005
Posts: 15140
Location: Bradford, West Yorkshire

PostPosted: Mon Sep 11, 2023 5:28 pm    Post subject: Reply with quote

OK - phase 1 is complete!

Certain submissions/requests from SpeedTrap Alert will now be used in the main PGPSW database.

So far these are:

- Removal Requests (Report problem: Not here)
- Mobile Seen Again reports (Report problem: Confirm)
- Other change requests (Report problem: Wrong limit / Bad location / Other)

Comments can be added and will be helpful, as always!

'Confirm' of non-mobiles are filtered out and ignored.
'Not here' requests for mobiles are ignored - unless comments are submitted.
Any other changes (Wrong limit, Bad location, Other) will be submitted as a change require and will need comments (otherwise they will be rejected when I process them).

IMPORTANT!
For any submissions (removals, change requests) to result in a free subscription you need to link STA to your PGPSW account and give permission to share your username.

In Settings - Databases find the PGPSW database and tap it to show the 'Database properties' pop up. On there, please click the "Attach my login to feedback" option. Only PGPSW will see these usernames via a secret key in the API. The data available in the public API will remain anonymous and will never show any userid's.
Back to top
View user's profile Send private message Visit poster's website
Leo_A
Regular Visitor


Joined: Jan 10, 2017
Posts: 146

PostPosted: Mon Sep 11, 2023 8:44 pm    Post subject: Reply with quote

Today I'm going to rollout next version that submits new cameras with PGPSW usernames included (https://api.speedtrap-alert.cc/v1/pgpsw/realtime/?interval=P7D)
Back to top
View user's profile Send private message
MaFt
Pocket GPS Staff
Pocket GPS Staff


Joined: Aug 31, 2005
Posts: 15140
Location: Bradford, West Yorkshire

PostPosted: Mon Sep 11, 2023 9:59 pm    Post subject: Reply with quote

Leo_A wrote:
Today I'm going to rollout next version that submits new cameras with PGPSW usernames included (https://api.speedtrap-alert.cc/v1/pgpsw/realtime/?interval=P7D)


Thanks Leo,

This can be a project for later in the week... Been a loooooong day coding today!
Back to top
View user's profile Send private message Visit poster's website
Leo_A
Regular Visitor


Joined: Jan 10, 2017
Posts: 146

PostPosted: Thu Sep 14, 2023 9:33 pm    Post subject: Reply with quote

Version 1.2.11 (code 112) seems to be available.

New in this version: STA attaches PGPSW user name to newly submitted cameras.

Tap on speedo background widget or green FAB-button



and next confirmation



result in the following output of this
https://api.speedtrap-alert.cc/v1/pgpsw/realtime/?interval=P1D
endpoint:

Code:

{
   "type": "FeatureCollection",
   "features": [
      {
         "type": "Feature",
         "properties": {
            "id": "935e2541-a977-4569-9bd7-cca309c7b80a",
            "type": 1,
            "speed": 0,
            "dir": 270,
            "dirType": 1,
            "liveUntil": "2023-09-24T21:42:42.513",
            "likes": 1,
            "dislikes": 0,
            "createdAt": "2023-09-10T21:42:42.513",
            "author": "Leo_A"
         },
         "geometry": {
            "type": "Point",
            "coordinates": [
               0.497926,
               50.84552
            ]
         }
      }
   ]
}


This is GeoJson format. All fields listed above always present.

"type" always has "FeaturesCollection" value.
"features" is always an array.

features[i].type is always "Feature";

features[i].properties according to the GeoJson specification is a set of arbitrary key-value pairs;

features[i].properties.id : unique identifier (GUID);

features[i].properties.type : speed camera type (1 - fixed, 2 - redlight, ... , 5 - mobile, .. etc);

features[i].properties.speed : 0 - unknown, otherwise speed from OSM;

features[i].properties.dir : movement direction as usual (0 North, 90 East, etc);

features[i].properties.dirType : 1 - single, if a user selects "To me" or "Opposite" (then "dir" above is "move_dir"+180), 2 - both directions;

features[i].properties.liveUntil - UTC-time when submitted point expires (mobiles expire in 3 hours, fixed cameras in 14 days if no one "liked" them), every thumbUp/thumbDown report changes this time;

features[i].properties.likes/dislikes - number of thumbUp/thumbDown reports;

features[i].properties.createdAt - UTC-time of submission;

features[i].properties.author - null if a user didnt grant STA to send his name or when endpoint request is unauthorized.

features[i].geometry.type - always "Point"

features[i].geometry.coordinates - is the array with longitude and latitude.

Submitted points always appear in STA while current time is less than features[i].properties.liveUntil.

The endpoint currently returns points submitted from phones with "en-GB" or "en-US" languages set.

Endpoint interval parameter - selects points whose liveUntil property is greater or equal than current UTC minus interval
Back to top
View user's profile Send private message
MaFt
Pocket GPS Staff
Pocket GPS Staff


Joined: Aug 31, 2005
Posts: 15140
Location: Bradford, West Yorkshire

PostPosted: Mon Oct 02, 2023 6:57 pm    Post subject: Reply with quote

Leo, could there be an option for Average Speed Cameras on the submission? Or a way to add a note to the submission?

At present the only way is to submit a camera, then go back to the map, tap the new camera, and add information that way.
Back to top
View user's profile Send private message Visit poster's website
Leo_A
Regular Visitor


Joined: Jan 10, 2017
Posts: 146

PostPosted: Thu Oct 05, 2023 7:36 pm    Post subject: Reply with quote

No such option currently.
The reason of that was the fact that every added SPECS requires second, finishing point for correct work. User may forget to add it, leave the track earlier, etc. Generally, submitting avg. section from the app while driving requires much more efforts from a user.

My suggestion: I'll add SPECS icon to the blue report window, submitted point will have type 1, but with the comment "SPECS". Then after filtering out such points on map, you'll decide where is the start, mids and finish. What do you think ?
Back to top
View user's profile Send private message
MaFt
Pocket GPS Staff
Pocket GPS Staff


Joined: Aug 31, 2005
Posts: 15140
Location: Bradford, West Yorkshire

PostPosted: Fri Oct 06, 2023 3:29 pm    Post subject: Reply with quote

Hi Leo, yes, I understand your reasoning and needing to keep it as simple as possible for the driver.

Leo_A wrote:
My suggestion: I'll add SPECS icon to the blue report window, submitted point will have type 1, but with the comment "SPECS". Then after filtering out such points on map, you'll decide where is the start, mids and finish. What do you think ?


That would work as I manually check through the submissions before they even get to the 'pending' database for checking.

Thanks again!
Back to top
View user's profile Send private message Visit poster's website
MaFt
Pocket GPS Staff
Pocket GPS Staff


Joined: Aug 31, 2005
Posts: 15140
Location: Bradford, West Yorkshire

PostPosted: Fri Oct 06, 2023 8:24 pm    Post subject: Reply with quote

Would the 'comment' be a new field as this set of data doesn't currently have a field for user comments?
Back to top
View user's profile Send private message Visit poster's website
Leo_A
Regular Visitor


Joined: Jan 10, 2017
Posts: 146

PostPosted: Sat Oct 07, 2023 10:56 pm    Post subject: Reply with quote

MaFt wrote:
Would the 'comment' be a new field as this set of data doesn't currently have a field for user comments?


Yes, the new field.

features[i].properties.fieldName

What the "fieldName" is, I'll write little later.[/b]
Back to top
View user's profile Send private message







Posted: Today    Post subject: Pocket GPS Advertising

Back to top
Display posts from previous:   
Post new topic   Reply to topic    Pocket GPS World Forum Index -> Speedtrap Alert (STA) All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Make a Donation



CamerAlert Database

Click here for the PocketGPSWorld.com Speed Camera Database

Download Speed Camera Database
22.051 (01 May 24)



WORLDWIDE SPEED CAMERA SPOTTERS WANTED!

Click here to submit camera positions to the PocketGPSWorld.com Speed Camera Database


12mth Subscriber memberships awarded every week for verified new camera reports!

Submit Speed Camera Locations Now


CamerAlert Apps



iOS QR Code






Android QR Code







© Terms & Privacy


GPS Shopping