Ramani API for Android

Java library to build maps with OpenGL vector-tile rendering such as OpenScienceMap, MapForge, MapBox, GeoJSON, and RAMANI Maps. This library also provides methods to request georeference information from the COPERNICUS and Sentinel data services.

Table of Contents

Supported Platforms

Developing an application with this library, requires the following:

  • Android SDK 4.1 (API Level 16) or later.
  • Android plugin for Gradle version 3.0.1 or later.
  • Gradle version 4.1 or later.

Sample App


Screen Capture



Getting Started

To make it general, we will make the example using code from the Android Studio. First, download our latest library or grab via gradle.

1. Adding our repository url on your root project, build.gradle :


          allprojects {
              repositories {
                  google()
                  jcenter()
                  maven {
                      url 'http://team.ujuizi.com/archiva/repository/internal/'
                  }
              }
          }
        

2. Then on your app build.gradle, add the 'maven' plugin and our dependency.


          apply plugin: 'com.android.application'
          apply plugin: 'maven'
          
          dependencies {
              implementation 'com.ujuizi.ramani:maps-api:version_number'
          }
        

3. Sync your gradle, and now it's on your Android project. For further information about our release version, please visit our Archiva Repository


API-Key

You must provide the API-Key that you get from our client-area webpage before accessing our services. Below is the step-by-step guide to create new API Key:

  • Sign in. Or Register first, if you don't have an account yet
  • Select Tab Api Keys, and then Add Key.
  • Input your Product Name and your Package Name
  • Press Create Key
  • Done

For testing, you can also use our testing credential :

  • API-Key : 68891c9a8f10e61a4b1ca2d43bb06a00
  • Username : ramaniuser
  • But you need to set your package name as com.ramani.map'

Load Basemap And Map Layer (using layerID)

You can load a basemap without any authentication. But you need an authentication to load Ramani Map, your private geometry data or map layer from our cloud service.




            public class MainActivity extends AppCompatActivity 
                    implements RMAccountManager.RMAccountManagerListener{

                private String layerID = "simS3seriesLaiGlobal/lai";
                private Map mMap;

                @Override
                protected void onCreate(Bundle savedInstanceState) {
                    super.onCreate(savedInstanceState);
                    setContentView(R.layout.activity_main);

                    // init map
                    MapView mMapView = findViewById(R.id.mapView);
                    mMapView.setMapPosition(new GeoPoint(51.221297, 4.399128), 13);  
                    mMap = mMapView.map();
                
                    // adding basemap
                    VectorTileLayer mBaseLayer = mMap.setBaseMap(new OSciMap4TileSource());  
                    mMap.layers().add(new BuildingLayer(mMap, mBaseLayer));  
                    mMap.layers().add(new LabelLayer(mMap, mBaseLayer)); 
                    mMap.setTheme(ThemeLoader.load(VtmThemes.DEFAULT), true);
                
                    // authentication before using our services
                    RMAccountManager.init(this, this, "YOUR_USERNAME", "YOUR_API_KEY");
                }

                @Override
                public void onMapAuthDone() {
                    // false if auth success and token generated
                    if (RMServicesManager.getToken().isEmpty())  
                        return;
                       
                    RMMapTileLayer rmTileLayer = new RMMapTileLayer(mMap, new RMMapTileSource(layerID)); 
                    rmTileLayer.tileRenderer().setBitmapAlpha(0.5f); // layer opacity, range 0 - 1 
                    mMap.layers().add(2, rmTileLayer); //index hierarchy, 0 is basemap
                    mMap.render();  
                }
          }
        
  • Explore the maps we have offer in our DDL

Load Map Layer (using Ramani Analytics URL)

If you are using Ramani Analytics URL, the usage is the same as layerID. You only need to add /wmsmap on the URL.


            private Map mMap;
            private String url = "https://analytics.ramani.ujuizi.com/SOURCES/.Copernicus/.Land/.LAI/.LAI/wmsmap";

            @Override
            public void onMapAuthDone() {
                // false if auth success and token generated
                if (RMServicesManager.getToken().isEmpty())  
                  return;

                RMMapTileLayer rmTileLayer = new RMMapTileLayer(mMap, new RMMapTileSource(url));
                mMap.layers().add(2, rmTileLayer); //index hierarchy, 0 is basemap
                mMap.render();
            }
          

But sometimes, the Ramani Analytics URL can be too long. Therefore, you can use the shorten URL by clicking Get Maps-API Endpoint on your Ramani Analytics URL page, Data Files section. And then, copy the URL.




            private Map mMap;
            private String shortenURL = "https://analytics.ramani.ujuizi.com/goto/c047d9845229cf794e15240e7bd3adbc";

            @Override
            public void onMapAuthDone() {
                // false if auth success and token generated
                if (RMServicesManager.getToken().isEmpty())  
                  return;

                mapServices = new RMMapServices();
                mapServices.setRMServiceListener(this);
                mapServices.getMapFromOPeNDAPURL(shortenURL); // to decode your shorten URL
            }

            @Override
            public void onStringResult(RMMapServices.Task task, String result) {
                if (task.equals(RMMapServices.Task.MAP)) {
                  RMMapTileLayer rmTileLayer = new RMMapTileLayer(mMap, new RMMapTileSource(result));
                  mMap.layers().add(2, rmTileLayer); //index hierarchy, 0 is basemap
                  mMap.render();
                }
            }
        

Get Point

To get more features information at a single point. Retrieves data, including geometry and attribute values.


        @Override
        public void onMapAuthDone() {
               RMMapServices mapServices = new RMMapServices();
               mapServices.setRMServiceListener(this);
                        
               String layerID = "simS3seriesLaiGlobal/lai";
               GeoPoint point = new GeoPoint(51.221297, 4.399128);
               RMMapInfo.Type format= "RMMapInfo.Type.JSON";
                        
               // for JSON-LD format, you need to change the defaut parameter
               if (format == RMMapInfo.Type.JSONLD) {
                      java.util.Map params = new HashMap();
                      params.put(RMParams.QUERY_LAYERS, "lai"); 
                      params.put(RMParams.LAYERS, "lai");
                      params.put(RMParams.SERVICE, "WMS");
                      params.put(RMParams.VERSION, "1.1.1");
                      params.put(RMParams.SRS, "EPSG:4326");
                      params.put(RMParams.X, "128"); // x y required, half of width and height
                      params.put(RMParams.Y, "128");
                      params.put("DATASET", "thredds/Sentinel-3-timeseries-global-lai"); 
                      mapServices.setParams(params);
               }
               mapServices.getPoint(point, layerID, format);
        }
                    
        /**
         * Handling service return
         * for every service with text format (e.g. XML, JSON, JSON-LD)
         * */
        @Override
        public void onStringResult(RMMapServices.Task task, String result) {
            if (task == RMMapServices.Task.POINT_PROFILE) {
                  // to filter your request
            }
        }
      

Note:

  • Only support XML, JSON, and JSON-LD.
  • setParams method is used to add or change an existing parameters
  • For JSON-LD parameter value such as QUERY_LAYERS, LAYERS, or DATASET, please visit our catalog here.
  • To get layer capabilities (attribute) or if you want to set custom parameter.
  • Explore the maps we have offer in our DDL

Get Point Profile

To get more features information at a single point. Retrieves data, including geometry and attribute values. But unlike Get Point, you can request for multiple different parameter(point, layerID, parameter, and returnType) in 1 request. Recommended for data comparison or animation use case.


        @Override
        public void onMapAuthDone() {
            RMMapServices mapServices = new RMMapServices();
            mapServices.setRMServiceListener(this);

            if (!RMServicesManager.getToken().isEmpty()) { // true if auth success
                ArrayList models = new ArrayList<>();
                models.add(new RMServicesModel(new GeoPoint(10.1372, 5.4422), "layerID A", Type.JSON));
                models.add(new RMServicesModel(new GeoPoint(12.4353, 5.3422), "layerID A", Type.XML));
                models.add(new RMServicesModel(new GeoPoint(12.4353, 5.3422), "layerID B", Type.JSON, new HashMap<>()));
                mapServices.getPointProfile(models);
            }
        }

        /**
         * Handling service return
         * for every service with text format (e.g. XML, JSON, JSON-LD)
         * */
        @Override
        public void onStringResult(RMMapServices.Task task, String result) {
            if (task == RMMapServices.Task.POINT_PROFILE) {
                // to filter your request
            }
        }
      

Note:


Get Point Cube

The extended version of Get Point Profile. Where you're able to not just get the information on a single point, but also the information of the neighboor GeoPoint, in a 3x3, 5x5, etc bounding box. It would be usefull for a comparison (e.g temperature between all neighboring pixels in a 3x3).


In order to create a grid(rectangular), a bounding box is needed. And every bounding box has a radius, which is the distance from your center point to the outer edge of bounding box. And the diameter, which is the distance between outer edge, or always twice the radius.


The radius value in our API is the latlong distance(e.g. distance from GeoPoint(10.00, 10.00) to GeoPoint(10.00, 10.50) will has 0.5 distance in lon (+- 50Km)). And if you set your radius at 0.5, your diameter(grid width) will be 1. This also means, the distance between bounding box center point in your grid, is 1 (diameter).


            
        private int gridSize = 3;
        
        // radius of your bounding box(bb)
        // from the center point to the outher edge of bb
        // in latlon distance, 0.5f = +- 50Km
        private float radius = 0.5f
        private String layerID = "simS3seriesCoverGlobal/coverclass";
        
        @Override
        public void onMapAuthDone() {
            RMMapServices mapServices = new RMMapServices();
            mapServices.setRMServiceListener(this);

            if (!RMServicesManager.getToken().isEmpty()) { // true if auth success
                ArrayList models = new ArrayList<>();
                models.add(new RMServicesModel(new GeoPoint(0.0000, 0.0000), layerID, RMMapInfo.Type.JSON, radius));
                mapServices.getPointCube(models, gridSize); // gridSize, only support for odd number and >= 3
            }
        }

        /**
         * Handling service return
         * for every service with text format (e.g. XML, JSON, JSON-LD)
         * */
        @Override
        public void onStringArrayResult(RMMapServices.Task task, ArrayList result) {
            if (task == RMMapServices.Task.POINT_PROFILE) {
                // instead of 1 single point
                // for every data request in your model, you will get a gridSize x gridSize (e.g 3x3, 5,5, etc) data
            }
        }
      

The code above will give you 9 data points, since you're requesting for 3x3 grid size. The value itself once again, depend on your GeoPoint and Radius.



    GeoPoint(-1, -1)
    {"type":"FeatureInfoResponse","features":[{"geometry":{"type":"Point","coordinates":[-0.998046875,-1.001953125]},"properties":{"iIndex":64441,"jIndex":32761,"gridCentreLon":-0.9972222202875969,"gridCentreLat":-1.0027777778505822},"featureInfo":[{"time":"2009-01-01T00:00:00.000Z","value":-46}]}]}
        
        
    GeoPoint(-1, 0)
    {"type":"FeatureInfoResponse","features":[{"geometry":{"type":"Point","coordinates":[0.001953125,-1.001953125]},"properties":{"iIndex":64801,"jIndex":32761,"gridCentreLon":0.0027777797232033663,"gridCentreLat":-1.0027777778505822},"featureInfo":[{"time":"2009-01-01T00:00:00.000Z","value":-46}]}]}
        
        
    GeoPoint(-1, 1)
    {"type":"FeatureInfoResponse","features":[{"geometry":{"type":"Point","coordinates":[1.001953125,-1.001953125]},"properties":{"iIndex":65161,"jIndex":32761,"gridCentreLon":1.002777779734032,"gridCentreLat":-1.0027777778505822},"featureInfo":[{"time":"2009-01-01T00:00:00.000Z","value":-46}]}]}
        
        
    GeoPoint(0, -1)
    {"type":"FeatureInfoResponse","features":[{"geometry":{"type":"Point","coordinates":[-0.998046875,-0.001953125]},"properties":{"iIndex":64441,"jIndex":32401,"gridCentreLon":-0.9972222202875969,"gridCentreLat":-0.002777777849786389},"featureInfo":[{"time":"2009-01-01T00:00:00.000Z","value":-46}]}]}
        
    GeoPoint(0, 0)
    {"type":"FeatureInfoResponse","features":[{"geometry":{"type":"Point","coordinates":[0.001953125,-0.001953125]},"properties":{"iIndex":64801,"jIndex":32401,"gridCentreLon":0.0027777797232033663,"gridCentreLat":-0.002777777849786389},"featureInfo":[{"time":"2009-01-01T00:00:00.000Z","value":-46}]}]}
        
    GeoPoint(0, 1)
    {"type":"FeatureInfoResponse","features":[{"geometry":{"type":"Point","coordinates":[1.001953125,-0.001953125]},"properties":{"iIndex":65161,"jIndex":32401,"gridCentreLon":1.002777779734032,"gridCentreLat":-0.002777777849786389},"featureInfo":[{"time":"2009-01-01T00:00:00.000Z","value":-46}]}]}
        
        
    GeoPoint(1, -1)
    {"type":"FeatureInfoResponse","features":[{"geometry":{"type":"Point","coordinates":[-0.998046875,0.998046875]},"properties":{"iIndex":64441,"jIndex":32041,"gridCentreLon":-0.9972222202875969,"gridCentreLat":0.9972222221510236},"featureInfo":[{"time":"2009-01-01T00:00:00.000Z","value":-46}]}]}
        
        
    GeoPoint(1, 0)
    {"type":"FeatureInfoResponse","features":[{"geometry":{"type":"Point","coordinates":[0.001953125,0.998046875]},"properties":{"iIndex":64801,"jIndex":32041,"gridCentreLon":0.0027777797232033663,"gridCentreLat":0.9972222221510236},"featureInfo":[{"time":"2009-01-01T00:00:00.000Z","value":-46}]}]}
        
        
    GeoPoint(1, 1)
    {"type":"FeatureInfoResponse","features":[{"geometry":{"type":"Point","coordinates":[1.001953125,0.998046875]},"properties":{"iIndex":65161,"jIndex":32041,"gridCentreLon":1.002777779734032,"gridCentreLat":0.9972222221510236},"featureInfo":[{"time":"2009-01-01T00:00:00.000Z","value":-46}]}]}
        

With the order from the Bottom Left (the lowest coordinate) to Top Right (the higher coordinate). Below is the visualization of the 3x3 grid indices, where the (0,0) is your original GeoPoint:

Note:

  • Only support for grid size with odd value and >= 3
  • Only support XML, JSON, and JSON-LD.
  • For JSON-LD, please see the Get Point example.
  • To get layer capabilities (attribute) or if you want to set custom parameter.
  • Explore the maps we have offer in our DDL

Get Vertical Profile

To get more features information at a single point(Get Point), along a vertical dimension.


            @Override
            public void onMapAuthDone() {
                RMMapServices mapServices = new RMMapServices();
                mapServices.setRMServiceListener(this);

                if (!RMServicesManager.getToken().isEmpty()) { // true if auth success
                    GeoPoint point = new GeoPoint(51.221297, 4.399128);
                    String layerID = "simS3seriesLaiGlobal/lai";
                    RMMapInfo.Type format = RMMapInfo.Type.JSON;
                        
                    // supported format : JSON, PNG, SVG
                    mapServices.getVerticleProfile(point, layerID, format);
                }
            }

            /**
             * Handling service return
             * for every service with text format (e.g. XML, JSON, JSON-LD)
             * */
            @Override
            public void onStringResult(RMMapServices.Task task, String result) {
                if (task == RMMapServices.Task.VERTICLE) {
                    // to filter your request
                }
            }

            /**
             * for every service with format PNG, SVG
             * you can convert the InputStream to Bitmap using our method
             * */
            @Override
            public void onByteResult(RMMapServices.Task task, InputStream result) {
                if (task == RMMapServices.Task.VERTICLE)
                    Bitmap image = RMUtils.convertStreamToBitmap(result);
            }
      

Note:

  • Only works on layers that have a temporal dimension (explore the maps we have offer in our DDL), for example nitrates in the depth of the ocean
  • Only support for JSON, PNG, and SVG.
  • To get layer capabilities (attribute) or if you want to set custom parameter.

Get Time-series Profile

To get more features information at a single point(Get Point), along with variation in time (along a temporal dimension).


            @Override
            public void onMapAuthDone() {
                RMMapServices mapServices = new RMMapServices();
                mapServices.setRMServiceListener(this);

                if (!RMServicesManager.getToken().isEmpty()) { // true if auth success
                    GeoPoint point = new GeoPoint(51.221297, 4.399128);
                    String layerID = "simS3seriesLaiGlobal/lai";
                    RMMapInfo.Type format = RMMapInfo.Type.JSON;
                        
                    // supported format : JSON, PNG, SVG
                    mapServices.getTimeSeriesProfile(point, layerID, format);
                }
            }

            /**
             * Handling service return
             * for every service with text format (e.g. XML, JSON, JSON-LD)
             * */
            @Override
            public void onStringResult(RMMapServices.Task task, String result) {
                if (task == RMMapServices.Task.TIME_SERIES) {
                    // to filter your request
                }
            }

            /**
             * for every service with format PNG, SVG
             * you can convert the InputStream to Bitmap using our method
             * */
            @Override
            public void onByteResult(RMMapServices.Task task, InputStream result) {
                if (task == RMMapServices.Task.TIME_SERIES)
                    Bitmap image = RMUtils.convertStreamToBitmap(result);
            }
    

Note:

  • Only works on layers that have a temporal dimension (explore the maps we have offer in our DDL), for example Leaf Area Index (LAI) over the seasons of the year
  • Only support for JSON, PNG, and SVG.
  • To get layer capabilities (attribute) or if you want to set custom parameter.

Get Horizontal Profile (GetTransect)

To get more features information at multiple point, along a horizontal dimension. For example, atmospheric ozone along a line (single or multiple segments) crossing a city.


            @Override
            public void onMapAuthDone() {
                RMMapServices mapServices = new RMMapServices();
                mapServices.setRMServiceListener(this);

                if (!RMServicesManager.getToken().isEmpty()) { // true if auth success
                    ArrayList points = new ArrayList();
                    points.add(new GeoPoint(51.221297, 4.399128));
                    points.add(new GeoPoint(52.596012, 6.295243));

                    String layerID = "simS3seriesLaiGlobal/lai";
                    RMMapInfo.Type format = RMMapInfo.Type.JSON;

                    // supported format : JSON, PNG, SVG
                    mapServices.getTransect(points, layerID, format);
                }
            }

            /**
             * Handling service return
             * for every service with text format (e.g. XML, JSON, JSON-LD)
             * */
            @Override
            public void onStringResult(RMMapServices.Task task, String result) {
                if (task == RMMapServices.Task.TRANSECT) {
                    // to filter your request
                }
            }

            /**
             * for every service with format PNG, SVG
             * you can convert the InputStream to Bitmap using our method
             * */
            @Override
            public void onByteResult(RMMapServices.Task task, InputStream result) {
                if (task == RMMapServices.Task.TRANSECT)
                    Bitmap image = RMUtils.convertStreamToBitmap(result);
            }
      

Note:


Get Area Profile

To get more features information at multiple point, along a horizontal dimension. But for an area defined by PolygonOptions.



            @Override
            public void onMapAuthDone() {
                RMMapServices mapServices = new RMMapServices();
                mapServices.setRMServiceListener(this);

                if (!RMServicesManager.getToken().isEmpty()) { // true if auth success
                    ArrayList points = new ArrayList();
                    points.add(new GeoPoint(51.221297, 4.399128));
                    points.add(new GeoPoint(53.596012, 6.295243));
                    points.add(new GeoPoint(53.726012, 4.289128));

                    String layerID = "simS3seriesLaiGlobal/lai";
                    RMMapInfo.Type format = RMMapInfo.Type.JSON;
                          
                    // supported format : JSON, PNG, SVG
                    mapServices.getArea(points, layerID, format, RMMapInfo.Return.HISTOGRAM);
                 }
            }

            /**
             * Handling service return
             * for every service with text format (e.g. XML, JSON, JSON-LD)
             * */
            @Override
            public void onStringResult(RMMapServices.Task task, String result) {
                if (task == RMMapServices.Task.AREA) {
                    // to filter your request
                }
            }

            /**
             * for every service with format PNG, SVG
             * you can convert the InputStream to Bitmap using our method
             * */
            @Override
            public void onByteResult(RMMapServices.Task task, InputStream result) {
                if (task == RMMapServices.Task.AREA)
                    Bitmap image = RMUtils.convertStreamToBitmap(result);
            }
        
    

Note:

  • Only support for JSON, PNG, SVG.
  • Only support for dataType : ALL, HISTOGRAM, and AGGREGATE.
  • Explore the maps we have offer in our DDL.
  • To get layer capabilities (attribute) or if you want to set custom parameter.

Return Example :


        {
        "type": "GetAreaResponse",
    
        "area": {
            "crs": "EPSG:4326",
            "linestring": "3.53759765625 47.79839667295524,4.556673569110679 48.07338898931344,3.4914556008582487 47.49998727341379,5.2789456005429924 47.913809258555474,3.3776305571161824 46.756562106822706,5.6348949137565185 47.21247952521911,3.787219268892672 46.519273910457045,4.775344730497775 46.848707252177114,4.775344730497775 46.848707252177114,",
            "dataset": "Sentinel-3: Global Nighttime Lights",
            "variable": "Nighttime Lights",
    
            "units": "",
            "aggregate": {
                "mean": 6.622666666666683,
                "stdv": 8.875178801281983,
                "skew": 2.6443954084095673,
                "kurt": 9.388449667730299,
    
                "min": 0,
                "max": 61,
                "perc": 6,
    
                "median": 6
            },
            "histogram": [
                "{frequency=2.0, value=54.0}",
                "{frequency=1.0, value=56.0}",
                ...
                "{frequency=2.0, value=16.0}",
                "{frequency=1.0, value=15.0}",
    
                "{frequency=2.0, value=18.0}"
            ]
    
            }
        }
        

Get Layer Attributes(GetMetadata)

To requests metadata (e.g. date-range, layer details, units, etc.) from layer dataset. For example, to obtain the temporal range of a time-series required by getTimeseriesProfile use (TIME), or to get the extremes of a layer (Min), and (Max) to set the scaleRange parameter.



            @Override
            public void onMapAuthDone() {
                if (RMServicesManager.getToken().isEmpty()) { // false if auth success
                    return;

                RMMapServices mapServices = new RMMapServices();
                mapServices.setRMServiceListener(this);
                
                String layerID = "simS3seriesLaiGlobal/lai";
                mapServices.getLayerAttributes(layerID);
            }

            /**
             * Handling service return
             * for every service with text format (e.g. XML, JSON, JSON-LD)
             * */
            @Override
            public void onStringResult(RMMapServices.Task task, String result) {
                if (task == RMMapServices.Task.LAYER_ATTR) {
                    // to filter your request
                }
            }
          

Note:

  • Only support JSON.
  • For more information about which parameters you can get follow this link.
  • Explore the maps we have offer in our DDL.

Get dates for timeseries and return as RSS or ISO8601 format

Using Get Layer Attributes method, below is the example to get (TIME) for Get Time-series Profile:



            @Override
            public void onMapAuthDone() {
                if (RMServicesManager.getToken().isEmpty()) { // false if auth success
                    return;

                // init our service and the listener
                RMMapServices mapServices = new RMMapServices();
                mapServices.setRMServiceListener(this);

                String layerID = "simS3seriesLaiGlobal/lai";
                
                Map params = new HashMap();
                params.put("item", "dates");
                params.put("format", "rss"); //with : RSS, without : ISO8601
                mapServices.setParams(params);

                mapServices.getLayerAttributes(layerID);
            }
            
            /**
             * For Text format
             * */
            @Override
            public void onStringResult(RMMapServices.Task task, String result) {
                if (task == RMMapServices.Task.LAYER_ATTR) {
                    try{
                        JSONObject metadata = new JSONObject(result);
                        String numColorBands = metadata.getString("numColorBands");
                        String time = metadata.getString("nearestTimeIso");
                        String defaultPalette = metadata.getString("defaultPalette");
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            }
    
      
    

Note:

  • Only support JSON.
  • For more information about which parameters you can get follow this link.
  • Explore the maps we have offer in our DDL.

Set Parameter

Set Parameter is used to add or replace existing parameters, to make your requested data richer and more dynamic. Make sure to call setParams(params) before executing your request, or the API will use your default parameter.


            Map params = new HashMap();
            params.put("ELEVATION", "1");
            params.put("TIME", "2006-07-28T00:00:00.000Z/2006-08-01T00:00:00.000Z");
            mapServices.setParams(params);
    
            GeoPoint point = new GeoPoint(51.221297, 4.399128);
            String layerID = "simS3seriesLaiGlobal/lai";

            mapServices.getTimeSeriesProfile(point, layerID, RMMapInfo.Type.JSON);
            
        
  • The example above use param (TIME) to set the temporal range of a time-series.
  • For more information about which parameters you can set, follow this link.
  • Explore the maps we have offer in our DDL.

Manipulate Your Data in Our Cloud

With this method, you can do CRUD (Create, Read, Update, Delete) to your dataset. The first example shows how to search for a feature in a layer and show it on the map, the second shows how to insert a new point (i.e. GPS-location).



            @Override
            public void onMapAuthDone() {
                
                // init our service and the listener
                RMMapServices mapServices = new RMMapServices();
                mapServices.setRMServiceListener(this);

                String query = "SELECT * FROM public.ec_example WHERE round(ST_Distance(ST_Transform(\"the_geom\",3857),
                'ST_GeomFromText('POINT(551569.5961058318 6701998.640044251)',3857))) < 6114.9622628
                ORDER BY round(ST_Distance(ST_Transform(\"the_geom\",3857),
                ST_GeomFromText('POINT(551569.5961058318 6701998.640044251)',3857)))LIMIT 5";
  
  
                String insertQuery = "INSERT INTO public.road_pavement_qualities (the_geom ,time, longitude, latitude, accelx, accely,
                accelz, orientx, orienty, orientz, magneticx, magneticy, magneticz, bearing, speed, gpsaccuracy, entropy, annotation_observe,
                status, rpqs, annotation_predict) VALUES (ST_GeomFromText('POINT(110.597145 -7.002776666666667)',4326),
                1434159945524,110.597145,-7.002776666666667, 4.338,3.217,4.616,2.2945807,-53.003002,1.0712337,
                -2.5,41.25,-15.0,0.0,0.0,6.8,0.9999999999999998,null,
                null,null,null);";
    
                mapServices.sqlApi(query);
                mapServices.sqlApi(insertQuery);  
            }
        
  • Basically, you're using PostgreSQL query syntax
  • Only work for dataset/layer under your account(private)
  • Explore the maps we have offer in our DDL.

Get Layer Id List

This feature will help you to get all of dataset name (layerID), inside your account.



            @Override
            public void onMapAuthDone() {
                if (RMServicesManager.getToken().isEmpty()) // false if auth success
                    return;

                RMMapServices mapServices = new RMMapServices();
                mapServices.setRMServiceListener(this);
                mapServices.getAllDatasetLayerName();
            }

            /**
             * Handling service return
             * */
            @Override
            public void onStringArrayResult(RMMapServices.Task task, ArrayList result) {
                if (task == RMMapServices.Task.LIST_DATASET) {
                    for (String layerID : result)
                        String name = layerID;
                }
            }
        
  • You can also see the dataset information in your account, at Editor >> Design
  • Explore the maps we have offer in our DDL.

Store Geometry Data

Store your single point or multiple point such as linestring, polygon, multipolygon, etc on our Cloud Service as Geometry data.


            @Override
            public void onMapAuthDone() {
                
                // init the service and the listener
                RMMapServices mapServices = new RMMapServices();
                mapServices.setRMServiceListener(this);

                //for single coordinate and without any parameter
                mapServices.store("layerID", new GeoPoint(52.4024, 6.0370), new HashMap());

                // or multiple coordinate and with added parameter
                Map fields = new HashMap();
                fields.put("id", "7");
                fields.put("name", "Geometry A");
                
                ArrayList points = new ArrayList();
                points.add(new GeoPoint(52.4024, 6.0370));
                points.add(new GeoPoint(52.5960, 6.2952));
                points.add(new GeoPoint(52.5028, 6.7044));
                points.add(new GeoPoint(52.3269, 6.9077));
                points.add(new GeoPoint(52.1840, 6.6742));
                points.add(new GeoPoint(52.2160, 6.2787));
    
                // for multiple coordinate you need to specify the DataType
                // MULTILINESTRING, MULTIPOLYGON, POLYGON, etc
                mapServices.store("layerID", points, fields, RMMapInfo.DataType.MULTILINESTRING); 
            }
            
            @Override
            public void onStringResult(RMMapServices.Task task, String result) {
                if (task == RMMapServices.Task.STORE)
                    // to see if your request is success
            }
      
     
  • Only work for dataset/layer under your account(private)
  • If you do not have any dataset in your account, in your account go to Editor >> Add

SPARQL API

With this method, you are able to get the RDF data, through our API using a SPARQL query.



            @Override
            public void onMapAuthDone() {
                
                // init our service and the listener
                RMMapServices mapServices = new RMMapServices();
                mapServices.setRMServiceListener(this);

                String dataset = "LaiPalermoLdt";
                String query = "select * where { ?s ?p ?o } limit 10";
    
                mapServices.sparqlApi(dataset, query); 
            }
            
            @Override
            public void onStringResult(RMMapServices.Task task, String result) {
                if (task == RMMapServices.Task.SPARQL)
                    Log.d(TAG, task.name() + " : " + result);
            }
        

For the dataset value, you can get it by following this step:

  • Go to our SOURCES, and look for small dataset. Here for example.
  • Click on Create SPARQL EndPoint. Note! Only works for small datasets, so make sure you subset a dataset by space and time so a manageable dataset results.
  • Input your data, especially SPARQL Endpoint Name. Since this will be your dataset name
  • Press Create Endpoint URL. And copy the URL from the generated Endpoint
  • Done. For further information about this API, you can also check one of our documentation here


Get Legend Graphic

The GetLegendGraphic method itself is optional for an SLD-enabled WMS. It provides a general mechanism for acquiring legend symbols, beyond the LegendURL reference of WMS Capabilities. Servers supporting the GetLegendGraphic call might code LegendURL references as GetLegendGraphic for interface consistency.



            @Override
            public void onMapAuthDone() {
                
                // init our service and the listener
                RMMapServices mapServices = new RMMapServices();
                mapServices.setRMServiceListener(this);

                String layerID = "obsS1SeriesGreenland/lon"
                mapServices.getLegendGraphic(layerID);
            }
            
            @Override
            public void onByteResult(RMMapServices.Task task, InputStream result) {
                if (task == RMMapServices.Task.LEGEND_GRAPHIC)
                    image.setImageBitmap(RMUtils.convertStreamToBitmap(result));
            }
        



  • For different pallete, you can use setParams and set the pallete value into your preference
  • Explore the maps we have offer in our DDL.

Known Uses


Known Issues

On every development project, you can get a fault or defect in a system or machine. For further information about our current development progress, please check our open issues.



License

Copyright (c) 2017 RAMANI B.V.


Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:


The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.


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 OR COPYRIGHT HOLDERS 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.



© 2018 Ujuizi Laboratories