Image

Integration Overview


By combining our APIs and the ArcGIS Enterprise infrastructure it is now possible to explore and analyze satellite and terrestrial AIS data more quickly than before, enabling you to easily gather information on the worlds shipping. Spire's AIS data is available in three main ways for ESRI customers:
Image

ArcGIS Pro Addin

Work on the desktop with real-time access to vessel location data and high value vessel meta data. The addin also includes predicted ship positions up to 8 hours into the future.

GET started

GeoEvent Streaming and ArcGIS Online

On-demand access via the GeoEvent server and ArcGIS enabling you to share maps and feature layers across your organization.

Get Started


Image
Image

Spatiotemporal Big Data Stores

Use GeoAnalytics Server to quickly answer important business questions such as: What was the route of this moving asset? Was it on course or not ?

GET STARTED

Code Samples For Installation Guides


GeoEvent Input Step 6 Code:

limit=3000&msg_type=1,2,3,27&fields=mmsi,msg_type,position,created_at&position={"type":"Polygon","coordinates":[[[45.81298828124999,21.90227796666864],[61.17187499999999,21.90227796666864],[-68.203125,30.65681556429287],[45.81298828124999,30.65681556429287],[45.81298828124999,21.90227796666864]]]}

Python Script for Vessels API


"""
An example code to run live queries on the SPIRE API.
"""

import requests
import json
import time
import datetime

waittime = 900 # wait 15 min in between queries

# SPIRE AIS ENDPOINT
ENDPOINT = 'https://api.sense.spire.com/vessels'


# FORMAT
FORMAT = 'json'

# YOUR TOKEN Contact us to get this token.
AUTH_TOKEN = ""

HEADERS = {"Authorization": "Bearer {}".format(AUTH_TOKEN), 'Accept': 'application/%s' % FORMAT}


# Message Processing
def process_messages(messages, theValue):
    '''Function that will be used to process data fetched from the API'''
    if theValue is None:
        uniquename = '1'
    else:
        uniquename = str(theValue)

    outputfile = r'C:\JSON\spire\Spire' + uniquename + '.json'
    f_out = open(outputfile, 'w')
    f_out.write(messages)
    f_out.close()


def query_data():

    print 'Start Querying SPIRE Data...'
    now = datetime.datetime.now()
    newiso = datetime.datetime.isoformat(now)
    request = ENDPOINT + '/?updated_after=%s' % newiso

    since = None

    while True:
        print request
        response = requests.get(request, headers=HEADERS)
        data = response.json()
        datajson = json.loads(response.text)
        thetext = json.dumps(datajson, indent=2)   # makes nicely formatted JSON

        try:
            process_messages(thetext, since)
        except KeyError:
            print "No data to write."
            continue  # dumps out of While True loop

        if 'paging' in data:
            try:
                since = data['paging']['next']
                if request.find("next=") != -1:
                    t = request.find("next=") + len("next=")
                    request=request[:t] #strip out
                    request = request + since
                else:
                    request = request + "&next=%s" % since

            except KeyError:
                print 'The data transfer is over. Waiting %s seconds to requery the vessels. Press CTRL+C to quit.' % waittime
                time.sleep(waittime)
                now = datetime.datetime.now()
                newiso = datetime.datetime.isoformat(now)
                request = ENDPOINT + '/?updated_after=%s' % newiso


if __name__ == '__main__':
    query_data()

Contact us for your real time data needs