Socket
Socket
Sign inDemoInstall

planetos

Package Overview
Dependencies
1
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    planetos

Planet OS datasets API (unofficial)


Version published
Weekly downloads
11
Maintainers
1
Created
Weekly downloads
 

Changelog

Source

0.3.3 (2016-10-24)

Chores
  • main: Description, author, license comments (522db02f)
Documentation Changes
  • readme: Updated npm install command (92ac6f9f)
Tests
  • main: Description, author, license comments (b11f2fd2)

Readme

Source

planetos

Access the Planet OS API with your Node.js app.

npm Build Status Coverage Status bitHound Dependencies bitHound Code

Example

const planetos = require ('planetos') ({
  apikey: 'abc123'
});

// NOAA Wave Watch 3 data
const params = {
  lon: -50.5,
  lat: 49.5,
  count: 1,
  context: 'reftime_time_lat_lon'
};

planetos ('noaa_ww3_global_1.25x1d', params, console.log);

Installation

This module requires an API key from Planet OS. You can find it in your account settings.

npm install planetos

Configuration

The module takes the following settings:

paramtyperequireddefaultdescription
apikeystringyesYour API key
timeoutnumberno5000Request timeout in ms
endpointstringnoPlanet OSOverride default API endpoint (i.e. proxy)
const planetos = require ('planetos') ({
  apikey: 'abc123',
  timeout: 10000,
  endpoint: 'https://my.proxy/http://data.planetos.com/v1'
});

API call

The function takes these arguments:

argumenttyperequireddescription
datasetstringyesDataset name, i.e. noaa_ww3_global_1.25x1d
paramsobjectyesDataset query parameters
callbackfunctionyesfunction (err, data) {}
// Process results
function myCallback (err, data) {
  if (err) {
    return console.log (err);
  }

  console.dir (data, {
    depth: null,
    colors: true
  });
}

// Query parameters
const params = {
  lon: -50.5,
  lat: 49.5,
  count: 1,
  context: 'reftime_time_lat_lon'
};

// Request data from API
planetos ('noaa_ww3_global_1.25x1d', params, myCallback);
Output:
{ stats: { maxCount: 61, offset: 0, count: 1 },
  entries: 
   [ { context: 'reftime_time_lat_lon',
       axes: 
        { reftime: '2016-03-17T18:00:00',
          time: '2016-03-17T18:00:00',
          longitude: -49.99999999999997,
          latitude: 50 },
       data: 
        { Wind_speed_surface: 5.519999980926514,
          Wind_direction_from_which_blowing_surface: 288.3900146484375,
          'v-component_of_wind_surface': -1.7400000095367432,
          'u-component_of_wind_surface': 5.239999771118164,
          Direction_of_wind_waves_surface: 72.16000366210938,
          Primary_wave_mean_period_surface: 7.929999828338623,
          Primary_wave_direction_surface: 81.6500015258789,
          Significant_height_of_wind_waves_surface: 0.4399999976158142,
          Mean_period_of_wind_waves_surface: 7.940000057220459,
          Secondary_wave_mean_period_surface: 3.1500000953674316,
          Significant_height_of_combined_wind_waves_and_swell_surface: 0.9700000286102295,
          Secondary_wave_direction_surface: 259.6300048828125 } } ] }

Unlicense

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to http://unlicense.org

Author

Franklin van de Meent

Keywords

FAQs

Last updated on 24 Oct 2016

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc