npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ramani

v2.0.4

Published

Ramani Maps-API, tools to consume the Ramani Cloud-services

Downloads

11

Readme

Ramani Maps-API, tools to consume the Ramani Cloud-services

Super simple to use

Ramani Maps-API is designed to be the simplest way possible to get service from Ramani Cloud.

var ramani = require('ramani');
var doAuth = ramani.init({
        user:'',
        apikey:'',
        schema:''
 });
doAuth.then(function(auth){
  ramani.getTransect([
    {lat:1.9720458984374998, lng:49.14758022506841},
    {lat:3.5870361328124996, lng:49.337651296668845}
    ],{
    layer: 'public.WFTXP',
    info_format :'text/json'
    }).then(function(transect) {
      console.log(transect);
  });
});

doAuth.then(function(auth){
  ramani.getPoint({lat:2.3443, lng:48.8537}, {
  layer: 'LAI',
  dataset: 'https://analytics.ramani.ujuizi.com/goto/b5a3c1c2dd9c2b865a84a9e30654c352',
  info_format :'text/json-ld',
  }).then(function(res) {
      console.log(res);
  }); 
});


ramani.getMetadata('public.WFTXP',
  { item:'dates' }).then(function(res) {
      console.log(res);
  }); 



//Get RSS-feed
ramani.getMetadata('public.WFTXP',
  { item:'dates', info_format :'rss' }).then(function(res) {
      console.log(res);
  });


//store point
var fields = { id : '1', name : 'pointA' }; 
ramani.storePoint('layerID', fields, {lat:2.3443, lng:48.8537}).then(function(res) {
      console.log(res);
  });


//getArea
ramani.getArea([
	{lat:6.25396728515625, lng:52.382305628707854},
	{lat:6.372899355829467, lng:52.424196211696774},
	{lat:6.257838787287611, lng:52.30345857599569},
  {lat:6.638463891157568, lng:52.309025707071214}
	], {
 layer: 'public.WFTXP',
 info_format :'text/json',
 'return' :'aggregate'
 }).then(function(res) {
      console.log(res);
  });

Table of contents


Example

To illustrate how to use our Maps-API, we provide an example application that demonstrates some of the API methods detailed below.

git clone https://team.ujuizi.com:6443/RAMANI/Maps-api-nodejs-example.git

back to top


GetMetadata

You can call this function to get metadata from the layer.

ramani.getMetadata(layerID, 
  params).then(function(res) {
      console.log(res);
  });

note :
layerID => Replace layerID with the string name of the ID of a layer of your choice. A valid string consist of a layerID/param combination. You can obtain the layer ID/param-combination from the Layer Information-widget as part of our Digital Data Library (DDL).

For more information about which parameters you can get follow this link.

back to top


GetTransect

ramani.getTransect(coordinatesArray, 
  params).then(function(res) {
      console.log(res);
  });

note : coordinatesArray is an Array list, consisting of two coordinates for a single line or multiple coordinates for several segments.

Example: For example, atmospheric ozone along a line (single or multiple segments) crossing a city.

back to top


GetPoint

ramani.getPoint(point, bbox, 
  params).then(function(res) {
      console.log(res);
  });

note : point is consisting of one coordinate and bbox is bounding box

back to top

GetPointCube

var layerobj = [];
layerobj.push({
        point : {lat:2.3443, lng:48.8537},
        params : {
            layer : 'public.WFTXP',
            info_format : 'text/json-ld'
        }
    });
var grid = 3;
var radius = 0.005;
var getCube = ramani.getPointCube(layerobj, grid, radius).then(function(ret) {
      $.each(ret.data, function(k, obj) {
            console.log(obj.value);
        });
  });

note : point is consisting of one coordinate in array

back to top

GetPointProfile

var layerobj = [];
layerobj.push({
    point : {lat:2.3443, lng:48.8537},
    layers : ["public.WFTXP", "public.WFTXP"],
    params : {
         TIME : "2010-11-29T00%3A00%3A00.000Z"
    }
});
var getPointProfile = ramani.getPointProfile(layerobj).then(function(ret) {
      $.each(ret.data, function(k, obj) {
            console.log(obj.value);
        });
  });

note : point is consisting of one coordinate in array for getting data in time-series, give the duration in time on the TIME parameter. eg : TIME : "2018-11-01T00:00:00.000Z/2018-11-30T00:00:00.000Z"

back to top

GetFeatureInfo

ramani.getFeatureInfo(point, bbox, {
 layer: 'public.WFTXP',
 info_format :'text/json',
 }).then(function(ret) {
     console.log(ret);
  });

note : point is consisting of one coordinate and bbox is bounding box

back to top

GetArea

ramani.getArea(coordinatesArray, {
 layer: 'public.WFTXP',
 info_format :'text/json',
 }).then(function(ret) {
     console.log(ret);
  });

note : point is consisting of one coordinate and bbox is bounding box

back to top

GetVerticleProfile

ramani.getVerticleProfile(point, parameters, callback);

//example 
ramani.getVerticleProfile(point, {
 layer: 'public.WFTXP',
 info_format :'text/json',
 }).then(function(ret) {
     console.log(ret);
  });

note : point is consisting of one coordinate

back to top

GetTimeseriesProfile

ramani.getTimeseriesProfile(point, parameters, callback);

//example 
ramani.getTimeseriesProfile(point, {
 layer: 'public.WFTXP',
 info_format :'text/json',
 }).then(function(ret) {
     console.log(ret);
  });

note : point is consisting of one coordinate

back to top

SqlApi

ramani.sqlApi(query, callback);

//example 
ramani.sqlApi("select * from table").then(function(ret) {
     console.log(ret);
  });

back to top

StorePoint

var fields = { id : '1', name : 'pointA' }; 
ramani.storePoint('layerID', fields, point).then(function(ret) {
     console.log(ret);
  });

note : point is consisting of one coordinate

back to top

StorePolygon

var fields = { id : '1', name : 'pointA' }; 
ramani.storePolygon('layerID', fields, coordinatesArray).then(function(ret) {
     console.log(ret);
  });

note : coordinatesArray is an Array list, consisting of two coordinates for a single line or multiple coordinates for several segments.

back to top

StoreLine

var fields = { id : '1', name : 'pointA' }; 
ramani.storeLine('layerID', fields, coordinatesArray).then(function(ret) {
     console.log(ret);
  });

note : coordinatesArray is an Array list, consisting of two coordinates for a single line or multiple coordinates for several segments.