Open CPN AIS Integration into QGIS The Next CEO of Stack OverflowWriting data into Esri *.mdb personal geodatabase using QGIS?AIS directly on QGISInstalling QGIS with GRASS plugin on Ubuntu?QGIS Processing - Edge ExtractionVessel Tracking service in qgis or standalonePlotting Density Maps with AIS DataOverlap Analysis of two rasters (heat maps) in QGIS?extshape arrows to show ais vessels. MultiLinestring alternativeLine network integration analysis in QGISHow to create an outline of a ship given the geom of the GPS aerial, ship dimensions, true heading
Inappropriate reference requests from Journal reviewers
If/When UK leaves the EU, can a future goverment conduct a referendum to join the EU?
FBX seems to be empty when imported into Blender
Giving the same color to different shapefiles in QGIS
Which tube will fit a -(700 x 25c) wheel?
Why has the US not been more assertive in confronting Russia in recent years?
Different harmonic changes implied by a simple descending scale
What's the best way to handle refactoring a big file?
I believe this to be a fraud - hired, then asked to cash check and send cash as Bitcoin
Why didn't Khan get resurrected in the Genesis Explosion?
Is it ever safe to open a suspicious html file (e.g. email attachment)?
Cannot send `--` into tmux panes from vim
Return the Closest Prime Number
Why don't programming languages automatically manage the synchronous/asynchronous problem?
How to make a variable always equal to the result of some calculations?
How to start emacs in "nothing" mode (`fundamental-mode`)
Bold, vivid family
What flight has the highest ratio of time difference to flight time?
Is it professional to write unrelated content in an almost-empty email?
Are there any limitations on attacking while grappling?
Written every which way
Is HostGator storing my password in plaintext?
Is there a way to save my career from absolute disaster?
Can we say or write : "No, it'sn't"?
Open CPN AIS Integration into QGIS
The Next CEO of Stack OverflowWriting data into Esri *.mdb personal geodatabase using QGIS?AIS directly on QGISInstalling QGIS with GRASS plugin on Ubuntu?QGIS Processing - Edge ExtractionVessel Tracking service in qgis or standalonePlotting Density Maps with AIS DataOverlap Analysis of two rasters (heat maps) in QGIS?extshape arrows to show ais vessels. MultiLinestring alternativeLine network integration analysis in QGISHow to create an outline of a ship given the geom of the GPS aerial, ship dimensions, true heading
Can AIS marine traffic live vessel data be integrated into QGIS?
I understand this could be possible using an OpenCPN plugin and Grass.
qgis ais
add a comment |
Can AIS marine traffic live vessel data be integrated into QGIS?
I understand this could be possible using an OpenCPN plugin and Grass.
qgis ais
add a comment |
Can AIS marine traffic live vessel data be integrated into QGIS?
I understand this could be possible using an OpenCPN plugin and Grass.
qgis ais
Can AIS marine traffic live vessel data be integrated into QGIS?
I understand this could be possible using an OpenCPN plugin and Grass.
qgis ais
qgis ais
edited Aug 16 '18 at 14:44
PolyGeo♦
53.8k1781245
53.8k1781245
asked Aug 16 '18 at 8:21
RichiniRichini
62
62
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Sorry for this late answer but want to share this if you still need it. I used Vesselfinder, fairly the same to MarineTraffic, and I think I accomplished what you are trying to achieve.
I used a python script (with psycopg2 extension) that received the information via an API from Vesselfinder. The script saved the data in a PostgreSQL database (with PostGIS extension) and in QGIS a PostgreSQL/PostGIS database is accessible via the database manager. Every time the script runs (i used a Loop Bat. file, to let it run every 5 min) the data is updated en immediately visible in QGIS.
this is the python code to get data and store it in a db.
# Import libraries
import requests
import pprint
import json
import sys
import psycopg2
import datetime
# Make database connection
conn = psycopg2.connect("dbname=YOURDBNAME user=YOURUSERNAME password=YOURPASSWORD")
# Get cursor
cur = conn.cursor()
# Define headers
headers = 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
'Accept-Encoding': 'none',
'Accept-Language': 'en-US,en;q=0.8',
'Connection': 'keep-alive'
# Build URL
url = 'YOUR VESSELFINDER/MARINETRAFFIC API URL
# Execute HTTP request
print('Get vessel positions from ' + str(url))
response = requests.get(url, headers=headers)
# Get result and store in database (point in 4326, convert date 2019-02-01 06:29:43 UTC)
# Update scheepstrack
if response.status_code == 200 :
print ('Request OK')
if len(response.json()) > 0 :
i = 0
while i < len(response.json()):
YOURCOLLUMNAME = str(response.json()[i]['AIS']['NAME'])
YOURCOLLUMNAME = int(response.json()[i]['AIS']['MMSI'])
YOURCOLLUMNAME = float(response.json()[i]['AIS']['LATITUDE'])
YOURCOLLUMNAME = float(response.json()[i]['AIS']['LONGITUDE'])
YOURCOLLUMNAME = datetime.datetime.strptime(str(response.json()[i]['AIS']['TIMESTAMP'][:-4]), '%Y-%m-%d %H:%M:%S')
# Insert new position
insert_stmt = 'insert into YOURDBNAME ( YOURCOLLUMNAME, YOURCOLLUMNAME, "YOURCOLLUMNAME", "YOURCOLLUMNAME" ) values ( %s, %s, ST_SetSRID(ST_MakePoint(%s, %s),4326), %s )'
cur.execute ( insert_stmt, ( YOURCOLLUMNAME, YOURCOLLUMNAME, YOURCOLLUMNAME, YOURCOLLUMNAME, YOURCOLLUMNAME ) )
This will create a real-time feed of you vessel(s)
Hope this is still to some use to you or somebody else that reads this.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "79"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f292959%2fopen-cpn-ais-integration-into-qgis%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sorry for this late answer but want to share this if you still need it. I used Vesselfinder, fairly the same to MarineTraffic, and I think I accomplished what you are trying to achieve.
I used a python script (with psycopg2 extension) that received the information via an API from Vesselfinder. The script saved the data in a PostgreSQL database (with PostGIS extension) and in QGIS a PostgreSQL/PostGIS database is accessible via the database manager. Every time the script runs (i used a Loop Bat. file, to let it run every 5 min) the data is updated en immediately visible in QGIS.
this is the python code to get data and store it in a db.
# Import libraries
import requests
import pprint
import json
import sys
import psycopg2
import datetime
# Make database connection
conn = psycopg2.connect("dbname=YOURDBNAME user=YOURUSERNAME password=YOURPASSWORD")
# Get cursor
cur = conn.cursor()
# Define headers
headers = 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
'Accept-Encoding': 'none',
'Accept-Language': 'en-US,en;q=0.8',
'Connection': 'keep-alive'
# Build URL
url = 'YOUR VESSELFINDER/MARINETRAFFIC API URL
# Execute HTTP request
print('Get vessel positions from ' + str(url))
response = requests.get(url, headers=headers)
# Get result and store in database (point in 4326, convert date 2019-02-01 06:29:43 UTC)
# Update scheepstrack
if response.status_code == 200 :
print ('Request OK')
if len(response.json()) > 0 :
i = 0
while i < len(response.json()):
YOURCOLLUMNAME = str(response.json()[i]['AIS']['NAME'])
YOURCOLLUMNAME = int(response.json()[i]['AIS']['MMSI'])
YOURCOLLUMNAME = float(response.json()[i]['AIS']['LATITUDE'])
YOURCOLLUMNAME = float(response.json()[i]['AIS']['LONGITUDE'])
YOURCOLLUMNAME = datetime.datetime.strptime(str(response.json()[i]['AIS']['TIMESTAMP'][:-4]), '%Y-%m-%d %H:%M:%S')
# Insert new position
insert_stmt = 'insert into YOURDBNAME ( YOURCOLLUMNAME, YOURCOLLUMNAME, "YOURCOLLUMNAME", "YOURCOLLUMNAME" ) values ( %s, %s, ST_SetSRID(ST_MakePoint(%s, %s),4326), %s )'
cur.execute ( insert_stmt, ( YOURCOLLUMNAME, YOURCOLLUMNAME, YOURCOLLUMNAME, YOURCOLLUMNAME, YOURCOLLUMNAME ) )
This will create a real-time feed of you vessel(s)
Hope this is still to some use to you or somebody else that reads this.
add a comment |
Sorry for this late answer but want to share this if you still need it. I used Vesselfinder, fairly the same to MarineTraffic, and I think I accomplished what you are trying to achieve.
I used a python script (with psycopg2 extension) that received the information via an API from Vesselfinder. The script saved the data in a PostgreSQL database (with PostGIS extension) and in QGIS a PostgreSQL/PostGIS database is accessible via the database manager. Every time the script runs (i used a Loop Bat. file, to let it run every 5 min) the data is updated en immediately visible in QGIS.
this is the python code to get data and store it in a db.
# Import libraries
import requests
import pprint
import json
import sys
import psycopg2
import datetime
# Make database connection
conn = psycopg2.connect("dbname=YOURDBNAME user=YOURUSERNAME password=YOURPASSWORD")
# Get cursor
cur = conn.cursor()
# Define headers
headers = 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
'Accept-Encoding': 'none',
'Accept-Language': 'en-US,en;q=0.8',
'Connection': 'keep-alive'
# Build URL
url = 'YOUR VESSELFINDER/MARINETRAFFIC API URL
# Execute HTTP request
print('Get vessel positions from ' + str(url))
response = requests.get(url, headers=headers)
# Get result and store in database (point in 4326, convert date 2019-02-01 06:29:43 UTC)
# Update scheepstrack
if response.status_code == 200 :
print ('Request OK')
if len(response.json()) > 0 :
i = 0
while i < len(response.json()):
YOURCOLLUMNAME = str(response.json()[i]['AIS']['NAME'])
YOURCOLLUMNAME = int(response.json()[i]['AIS']['MMSI'])
YOURCOLLUMNAME = float(response.json()[i]['AIS']['LATITUDE'])
YOURCOLLUMNAME = float(response.json()[i]['AIS']['LONGITUDE'])
YOURCOLLUMNAME = datetime.datetime.strptime(str(response.json()[i]['AIS']['TIMESTAMP'][:-4]), '%Y-%m-%d %H:%M:%S')
# Insert new position
insert_stmt = 'insert into YOURDBNAME ( YOURCOLLUMNAME, YOURCOLLUMNAME, "YOURCOLLUMNAME", "YOURCOLLUMNAME" ) values ( %s, %s, ST_SetSRID(ST_MakePoint(%s, %s),4326), %s )'
cur.execute ( insert_stmt, ( YOURCOLLUMNAME, YOURCOLLUMNAME, YOURCOLLUMNAME, YOURCOLLUMNAME, YOURCOLLUMNAME ) )
This will create a real-time feed of you vessel(s)
Hope this is still to some use to you or somebody else that reads this.
add a comment |
Sorry for this late answer but want to share this if you still need it. I used Vesselfinder, fairly the same to MarineTraffic, and I think I accomplished what you are trying to achieve.
I used a python script (with psycopg2 extension) that received the information via an API from Vesselfinder. The script saved the data in a PostgreSQL database (with PostGIS extension) and in QGIS a PostgreSQL/PostGIS database is accessible via the database manager. Every time the script runs (i used a Loop Bat. file, to let it run every 5 min) the data is updated en immediately visible in QGIS.
this is the python code to get data and store it in a db.
# Import libraries
import requests
import pprint
import json
import sys
import psycopg2
import datetime
# Make database connection
conn = psycopg2.connect("dbname=YOURDBNAME user=YOURUSERNAME password=YOURPASSWORD")
# Get cursor
cur = conn.cursor()
# Define headers
headers = 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
'Accept-Encoding': 'none',
'Accept-Language': 'en-US,en;q=0.8',
'Connection': 'keep-alive'
# Build URL
url = 'YOUR VESSELFINDER/MARINETRAFFIC API URL
# Execute HTTP request
print('Get vessel positions from ' + str(url))
response = requests.get(url, headers=headers)
# Get result and store in database (point in 4326, convert date 2019-02-01 06:29:43 UTC)
# Update scheepstrack
if response.status_code == 200 :
print ('Request OK')
if len(response.json()) > 0 :
i = 0
while i < len(response.json()):
YOURCOLLUMNAME = str(response.json()[i]['AIS']['NAME'])
YOURCOLLUMNAME = int(response.json()[i]['AIS']['MMSI'])
YOURCOLLUMNAME = float(response.json()[i]['AIS']['LATITUDE'])
YOURCOLLUMNAME = float(response.json()[i]['AIS']['LONGITUDE'])
YOURCOLLUMNAME = datetime.datetime.strptime(str(response.json()[i]['AIS']['TIMESTAMP'][:-4]), '%Y-%m-%d %H:%M:%S')
# Insert new position
insert_stmt = 'insert into YOURDBNAME ( YOURCOLLUMNAME, YOURCOLLUMNAME, "YOURCOLLUMNAME", "YOURCOLLUMNAME" ) values ( %s, %s, ST_SetSRID(ST_MakePoint(%s, %s),4326), %s )'
cur.execute ( insert_stmt, ( YOURCOLLUMNAME, YOURCOLLUMNAME, YOURCOLLUMNAME, YOURCOLLUMNAME, YOURCOLLUMNAME ) )
This will create a real-time feed of you vessel(s)
Hope this is still to some use to you or somebody else that reads this.
Sorry for this late answer but want to share this if you still need it. I used Vesselfinder, fairly the same to MarineTraffic, and I think I accomplished what you are trying to achieve.
I used a python script (with psycopg2 extension) that received the information via an API from Vesselfinder. The script saved the data in a PostgreSQL database (with PostGIS extension) and in QGIS a PostgreSQL/PostGIS database is accessible via the database manager. Every time the script runs (i used a Loop Bat. file, to let it run every 5 min) the data is updated en immediately visible in QGIS.
this is the python code to get data and store it in a db.
# Import libraries
import requests
import pprint
import json
import sys
import psycopg2
import datetime
# Make database connection
conn = psycopg2.connect("dbname=YOURDBNAME user=YOURUSERNAME password=YOURPASSWORD")
# Get cursor
cur = conn.cursor()
# Define headers
headers = 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
'Accept-Encoding': 'none',
'Accept-Language': 'en-US,en;q=0.8',
'Connection': 'keep-alive'
# Build URL
url = 'YOUR VESSELFINDER/MARINETRAFFIC API URL
# Execute HTTP request
print('Get vessel positions from ' + str(url))
response = requests.get(url, headers=headers)
# Get result and store in database (point in 4326, convert date 2019-02-01 06:29:43 UTC)
# Update scheepstrack
if response.status_code == 200 :
print ('Request OK')
if len(response.json()) > 0 :
i = 0
while i < len(response.json()):
YOURCOLLUMNAME = str(response.json()[i]['AIS']['NAME'])
YOURCOLLUMNAME = int(response.json()[i]['AIS']['MMSI'])
YOURCOLLUMNAME = float(response.json()[i]['AIS']['LATITUDE'])
YOURCOLLUMNAME = float(response.json()[i]['AIS']['LONGITUDE'])
YOURCOLLUMNAME = datetime.datetime.strptime(str(response.json()[i]['AIS']['TIMESTAMP'][:-4]), '%Y-%m-%d %H:%M:%S')
# Insert new position
insert_stmt = 'insert into YOURDBNAME ( YOURCOLLUMNAME, YOURCOLLUMNAME, "YOURCOLLUMNAME", "YOURCOLLUMNAME" ) values ( %s, %s, ST_SetSRID(ST_MakePoint(%s, %s),4326), %s )'
cur.execute ( insert_stmt, ( YOURCOLLUMNAME, YOURCOLLUMNAME, YOURCOLLUMNAME, YOURCOLLUMNAME, YOURCOLLUMNAME ) )
This will create a real-time feed of you vessel(s)
Hope this is still to some use to you or somebody else that reads this.
answered yesterday
Cas JulicherCas Julicher
205
205
add a comment |
add a comment |
Thanks for contributing an answer to Geographic Information Systems Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f292959%2fopen-cpn-ais-integration-into-qgis%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown