1.0.6 • Published 5 years ago

app-lab v1.0.6

Weekly downloads
9
License
-
Repository
-
Last release
5 years ago

Maps-API, tools to consume the App-lab Cloud-services

Super simple to use

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

var applab = require('app-lab');
applab.init({
        username:'',
        apiKey:'',
        package:''
 });

applab.getTransect([
  [49.14758022506841, 1.9720458984374998],
  [49.337651296668845, 3.5870361328124996]
  ],{
  layer: 'ddl.simS5seriesForAirQualityEuro.o3conc',
  info_format :'text/json'
  }, function(error, transect){
    console.log(transect);
});


applab.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);
});

applab.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);
});

applab.getMetadata('ddl.simS5seriesForAirQualityEuro.o3conc', 
  { item:'dates' }
  , function(error, result){
  console.log(result);
}); 



//Get RSS-feed
applab.getMetadata('ddl.simS5seriesForAirQualityEuro.o3conc', 
  { item:'dates', info_format :'rss' }
  , function(error, result){
  console.log(result);
});


//store point
var fields = { id : '1', name : 'pointA' }; 
applab.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/app-lab-maps-api-nodejs-example.git

back to top


GetMetadata

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

applab.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

applab.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

applab.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

applab.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

applab.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

applab.getVerticleProfile(point, parameters, callback);

//example 
applab.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

applab.getTimeseriesProfile(point, parameters, callback);

//example 
applab.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

applab.sqlApi(query, callback);

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

back to top

StorePoint

var fields = { id : '1', name : 'pointA' };
applab.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' }; 
applab.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' };
applab.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.

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago