Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

ramani

1.0.13 • Public • Published

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');
ramani.init({
        username:'',
        apiKey:'',
        package:''
 });
 
ramani.getTransect([
  [49.14758022506841, 1.9720458984374998],
  [49.337651296668845, 3.5870361328124996]
  ],{
  layer: 'ddl.simS5seriesForAirQualityEuro.o3conc',
  info_format :'text/json'
  }, function(error, transect){
    console.log(transect);
});
 
 
ramani.getPoint([2.3443,48.8537], {
 layer: 'LAI',
 dataset: 'https://analytics.ramani.ujuizi.com/goto/b5a3c1c2dd9c2b865a84a9e30654c352',
 info_format :'text/json-ld',
 }, function(error, result){
  if (error) console.log(error);
    console.log(result);
});
 
ramani.getFeatureInfo([2.3443,48.8537], '2.3317193984985347,48.8563575709925,2.3675322532653804,48.86276675759093', {
 layer: 'LAI',
 dataset: 'https://analytics.ramani.ujuizi.com/goto/b5a3c1c2dd9c2b865a84a9e30654c352',
 info_format :'text/json-ld',
 }, function(error, result){
  if (error) console.log(error);
    console.log(result);
});
 
ramani.getMetadata('ddl.simS5seriesForAirQualityEuro.o3conc', 
  { item:'dates' }
  , function(error, result){
  console.log(result);
}); 
 
 
 
//Get RSS-feed
ramani.getMetadata('ddl.simS5seriesForAirQualityEuro.o3conc', 
  { item:'dates', info_format :'rss' }
  , function(error, result){
  console.log(result);
});
 
 
//store point
var fields = { id : '1', name : 'pointA' }; 
ramani.storePoint('layerID', fields, [2.6092529296875,49.50916011935442], function(error, result){
    console.log(result);
});
 

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
  , function(error, result){
  console.log(result);
}); 

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
  , function(error, result){
  console.log(result);
}); 

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
  , function(error, result){
  console.log(result);
}); 

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

back to top

GetFeatureInfo

ramani.getFeatureInfo(point, bbox, {
 layer: 'ddl.simS5seriesForAirQualityEuro.o3conc',
 info_format :'text/json',
 }, function(error, result){
  console.log(result);
});

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

back to top

GetArea

ramani.getFeatureInfo(point, bbox, {
 layer: 'ddl.simS5seriesForAirQualityEuro.o3conc',
 info_format :'text/json',
 }, function(error, result){
  console.log(result);
});

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: 'ddl.simS5seriesForAirQualityEuro.o3conc',
 info_format :'text/json',
 }, function(error, result){
  console.log(result);
});

note : point is consisting of one coordinate

back to top

GetTimeseriesProfile

ramani.getTimeseriesProfile(point, parameters, callback);
 
//example 
ramani.getTimeseriesProfile(point, {
 layer: 'ddl.simS5seriesForAirQualityEuro.o3conc',
 info_format :'text/json',
 }, function(error, result){
  console.log(result);
});

note : point is consisting of one coordinate

back to top

SqlApi

ramani.sqlApi(query, callback);
 
//example 
ramani.sqlApi("select * from table", function(error, result){
  console.log(result);
});

back to top

StorePoint

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

note : point is consisting of one coordinate

back to top

StorePolygon

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

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, function(error, result){
    console.log(result);
});

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

Keywords

install

npm i ramani

Downloadsweekly downloads

2

version

1.0.13

license

none

last publish

collaborators

  • avatar
Report a vulnerability