public class

GeoJsonHelper

extends Object
java.lang.Object
   ↳ com.steerpath.sdk.utils.GeoJsonHelper

Class Overview

Helpers and utils for Features and GeoJson.

Summary

Public Methods
static String getAssetTrackingId(JSONObject json)
static String getBuildingReference(JSONObject json)
static double getCenter(JSONObject json, double defaultValue, int indexOnCoordinates)
static double getCoordinate(JSONObject json, double defaultValue, int indexOnCoordinates)
static double getCoordinateFromMapboxGeoJson(JSONObject json, double defaultValue, int indexOnCoordinates)
static String getCssClass(JSONObject json)
static String getDescription(JSONObject json)
static JSONArray getFeatures(JSONObject json)
Convenience method for hiding try-catch.
static LatLng getFirstLatLng(JSONObject geometry)
Returns first LatLng from array of geometry coordinates.
static int getFloor(JSONObject json, int defaultValue)
static String getFloor(JSONObject json)
static int[] getFloorIndexList(JSONObject json)
static String[] getFloorNameList(JSONObject json)
static JSONArray getFloors(JSONObject json)
static String getGeoJsonType(JSONObject json)
static String getGeometryJson(JSONObject json)
static String getIconUrl(JSONObject json)
static String getId(JSONObject json)
static ArrayList<String> getKeywordList(JSONObject json)
static String[] getKeywords(JSONObject json)
static double getLatitude(JSONObject json, double defaultValue)
static double getLatitudeFromMapboxGeoJson(JSONObject json, double defaultValue)
static String getLocalRef(JSONObject json)
static double getLongitude(JSONObject json, double defaultValue)
static double getLongitudeFromMapboxGeoJson(JSONObject json, double defaultValue)
static double getNaturalOrientation(JSONObject json)
static String getOptional(JSONObject json)
static double getPoint(JSONObject json, double defaultValue, int indexOnCoordinates)
static JSONObject getPolygonJson(MetaFeature feature, JSONObject rootJson)
Finds Feature's GeoJson from given root json.
static String getSubType(JSONObject json)
static String[] getTags(JSONObject json)
static ArrayList<String> getTagsList(JSONObject json)
static String getTitle(JSONObject json)
static boolean hasArea(JSONObject json)
Checks if json has "area" attribute on it and returns 1 for true and 0 for false.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static String getAssetTrackingId (JSONObject json)

public static String getBuildingReference (JSONObject json)

public static double getCenter (JSONObject json, double defaultValue, int indexOnCoordinates)

public static double getCoordinate (JSONObject json, double defaultValue, int indexOnCoordinates)

public static double getCoordinateFromMapboxGeoJson (JSONObject json, double defaultValue, int indexOnCoordinates)

public static String getCssClass (JSONObject json)

public static String getDescription (JSONObject json)

public static JSONArray getFeatures (JSONObject json)

Convenience method for hiding try-catch.

Parameters
json is expected to be FeatureCollection

public static LatLng getFirstLatLng (JSONObject geometry)

Returns first LatLng from array of geometry coordinates.

public static int getFloor (JSONObject json, int defaultValue)

public static String getFloor (JSONObject json)

public static int[] getFloorIndexList (JSONObject json)

public static String[] getFloorNameList (JSONObject json)

public static JSONArray getFloors (JSONObject json)

public static String getGeoJsonType (JSONObject json)

public static String getGeometryJson (JSONObject json)

public static String getIconUrl (JSONObject json)

public static String getId (JSONObject json)

public static ArrayList<String> getKeywordList (JSONObject json)

public static String[] getKeywords (JSONObject json)

public static double getLatitude (JSONObject json, double defaultValue)

public static double getLatitudeFromMapboxGeoJson (JSONObject json, double defaultValue)

public static String getLocalRef (JSONObject json)

public static double getLongitude (JSONObject json, double defaultValue)

public static double getLongitudeFromMapboxGeoJson (JSONObject json, double defaultValue)

public static double getNaturalOrientation (JSONObject json)

public static String getOptional (JSONObject json)

public static double getPoint (JSONObject json, double defaultValue, int indexOnCoordinates)

public static JSONObject getPolygonJson (MetaFeature feature, JSONObject rootJson)

Finds Feature's GeoJson from given root json. Extracts and returns "properties/area/coordinates" json.

Parameters
feature target Feature to find
rootJson GeoJson to search from
Returns
  • null if rootJson is invalid

public static String getSubType (JSONObject json)

Returns
  • beacon | poi | building

public static String[] getTags (JSONObject json)

public static ArrayList<String> getTagsList (JSONObject json)

public static String getTitle (JSONObject json)

public static boolean hasArea (JSONObject json)

Checks if json has "area" attribute on it and returns 1 for true and 0 for false.