New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gpxload

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gpxload

Routes, Waypoints and GPX Import / Export plugin for SignalK Server.

  • 1.2.0
  • npm
  • Socket score

Version published
Weekly downloads
36
decreased by-58.14%
Maintainers
1
Weekly downloads
 
Created
Source

GPXLoad:

GPX file Import / Export and resource API provider plugin for Signal K Server.

SignalK server plugin and WebApp that:

  • Allows the upload of selected Routes and Waypoints in GPX files to a SignalK server

  • Acts as a resource provider for Routes and Waypoints to make them available via the SignalK API. e.g. http://signalk-server/signalk/v1/api/reources/routes

  • Accepts updates via HTTP PUT and STREAM PUT actions to enable adding, editing and deleting of resources by applications. (see Configuration below)

  • Preserves the SignalK UUIDs of exported resources written to the GPX file to avoid resource duplication.

v1

  • API provider for:

    • resources/routes
    • resources/waypoints
    • resources/tracks
    • vesels/self/navigation/courseGreatCircle/activeRoute/href
    • vesels/self/navigation/courseGreatCircle/activeRoute/startTime
    • vesels/self/navigation/courseGreatCircle/nextPoint/position
  • Import / Export GPX resources

  • Manage Resources screen to allow:

    • Deletion of resources. (Note: Deleting a Route will also delete the associated Start / End waypoints.)

    • Setting a route as the Active Route

  • Support for SignalK HTTP PUT and STREAM PUT actions to enable applications to add, update and delete resources (see Configuration below).

Upgrading from v0.x.x

  • Prior to v0.5.0 resource UUIDs that did not strictly align to the Signal K schema and use the urn:mrn:signalk:uuid: prefix were permitted. Resources uploaded from GPX files using versions of GPXLoad prior to 0.5.0 will need to be re-imported.

Use and Operation:

To Import a GPX file:

  1. Open the Web App at the url: http://signalk-server/gpxload/

  2. Select the Import GPX tab and click Open GPX file

  3. Select a GPX file.

  4. Select some or all of the Routes, Waypoints and Tracks from the displayed list.

  5. To import just selected resources of a particular type click the Load button located within that resources group. To import all selected resources click Load Selected

To Export resources to a GPX file:

  1. Open the Web App at the url: http://signalk-server/gpxload/

  2. Select the Export to GPX tab and a list of available resources are displayed. Click Refresh if you want to re-load the list of resources from the Signal K server.

  3. Select the Routes, Waypoints and Tracks from the displayed list that you want saved to the GPX file.

  4. Click Save to export selected resources to file.

Note:

  • GPXLoad preserves the uuids of resources exported from Signal K server in the GPX file, so if these GPX files are re-imported they will update the corresponding resource on the Signal K server rather than create a new resource.

  • GPX files containing elements without Signal K UUID values will have UUIDs assigned each time the file is opened (or re-opened) in the WebUI. This will result in duplicate resources on the Signal K server if a GPX file is: opened, resources imported, re-opened and the same resources imported.

Configuration:

  • Signal K resource processing can be enabled via Signal K server Plugin Config screen.

  • GPXLoad will only accept PUT requests for a specified resource id so you will need to provide a complete, valid resource record as per the Signal K schema.

Configuration Settings

  • Enable PUT: Check this option to allow resources to be added or updated via HTTP or STREAM PUT messages.

  • Allow DELETE: Check this option to allow the deletion of resources in response to HTTP, STREAM API or DELTA messages.

  • Respond to Delta UPDATE: Check this option to respond to Delta stream UPDATE messages for the adding or updating of resources.


API Examples:

Add / Update route

Note: Supplying a null value when adding / updating a resource will DELETE it if the configuration is set to allow delete operations.

via HTTP

PUT http://signalk-server/signalk/v1/api/vessels/self/resources/routes

{       
    "value":{
        "urn:mrn:signalk:uuid:a8554512-5d3b-45a1-92e9-eb93da834aaa": {
            "name":"KI",
            "description":"KI via Edithburgh",
            "distance":164006.423,
            "start":"urn:mrn:signalk:uuid:e85c96e7-9bd4-4ed9-81aa-d3a350f0de55",
            "end":"urn:mrn:signalk:uuid:fab5c914-b49b-4f15-a1b4-e7b90de52cb5",
            "feature":{
                "type":"Feature",
                "geometry":{
                    "type":"LineString",
                    "coordinates":[
                        [137.780507,-35.781544],[137.633972,-35.557088],[137.582846,-35.551319],[137.534531,-35.589552],[137.752977,-35.08999],[138.432849,-34.885938]
                    ]
                },
                "properties":{}
            }               
        }
    }
}

via STREAM

{
    "context":"vessels.self",
    "put": {
        "path": "resources.routes",
        "source": "myapp",
        "value":{
            "urn:mrn:signalk:uuid:16c1c6bc-e8e8-4a97-9aa8-a00c27badaeb":{
                "name":"Route 2",
                "description":"Route created 26/09/2016",
                "distance":58933.222,"start":"urn:mrn:signalk:uuid:1392c042-56cc-41d3-b696-779f1d39e419",
                "end":"urn:mrn:signalk:uuid:7870ecf4-b1d5-4f42-85bf-357ccd81d5fc",
                "feature":{
                    "type":"Feature",
                    "geometry":{
                        "type":"LineString",
                        "coordinates":[[135.3,-29.5],[135.4,-29.6],[135.5,-29.7],[135.6,-29.8],[135.7,-29.9]]
                    },
                    "properties":{}
                }
            }
        }
    }
}      
Delete route

Resources will only be deleted if the configuration is set to allow DELETE operations.

via HTTP

DELETE http://signalk-server/signalk/v1/api/vessels/self/resources/routes/urn:mrn:signalk:uuid:a8554512-5d3b-45a1-92e9-eb93da834aaa

via STREAM

{
    "context":"vessels.self",
    "put": {
        "path": "resources.routes",
        "source": "myapp",
        "value":{
            "urn:mrn:signalk:uuid:16c1c6bc-e8e8-4a97-9aa8-a00c27badaeb": null
        }
    }
}           

Signal K APIs:

HTTP:

Acts as a provider for the following paths:

/signalk/v1/api/resources/routes
/signalk/v1/api/resources/waypoints
/signalk/v1/api/resources/tracks

Processes PUT requests for the following paths:

/signalk/v1/api/vessels/self/resources/routes
/signalk/v1/api/vessels/self/resources/waypoints
/vessels/self/navigation/courseGreatCircle/activeRoute/href
/vessels/self/navigation/courseGreatCircle/activeRoute/startTime
/vessels/self/navigation/courseGreatCircle/nextPoint/position

Stream:

Processes STREAM updates for the following paths:

vessels.self.resources.routes
vessels.self.resources.waypoints
vessels.self.navigation.courseGreatCircle.activeRoute.href
vessels.self.navigation.courseGreatCircle.activeRoute.startTime
vessels.self.navigation.courseGreatCircle.nextPoint.position

Sends Deltas for the following paths:

resources.routes.<uuid>
resources.waypoints.<uuid>
resources.tracks.<uuid>
navigation.courseGreatCircle.activeRoute.href
navigation.courseGreatCircle.activeRoute.startTime
navigation.courseGreatCircle.nextPoint.position

Keywords

FAQs

Package last updated on 14 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc