GeoJSONUtil

public class GeoJSONUtil

Class to store features to Vector layer

Methods

checkCRSSupportAndWGS

public static boolean checkCRSSupportAndWGS(String crsName, Context context)

Check if provided name support and throw NGWException if not. Now support EPSG 3857 and 4326 only.

Параметры:
  • crsName – Spatial reference name
  • context – Context to get error string
Бросает исключение:
 
Результат:

true if provided string is WGS84 (4326) or false if Web Mercator (3857)/

createLayerFromGeoJSON

public static void createLayerFromGeoJSON(VectorLayer layer, JSONObject geoJSONObject, IProgressor progressor)

createLayerFromGeoJSONStream

public static void createLayerFromGeoJSONStream(VectorLayer layer, InputStream in, IProgressor progressor, boolean isWGS84)

fillLayerFromGeoJSON

public static void fillLayerFromGeoJSON(VectorLayer layer, JSONObject geoJSONObject, int srs, IProgressor progressor)

fillLayerFromGeoJSONStream

public static void fillLayerFromGeoJSONStream(VectorLayer layer, InputStream in, int srs, IProgressor progressor)

formatDateTime

public static String formatDateTime(long millis, int type)

isGeoJsonHasFeatures

public static boolean isGeoJsonHasFeatures(File path)

parseDateTime

protected static Object parseDateTime(Object value, int type)

parseNumber

protected static Object parseNumber(String value)

readGeoJSONCRS

public static boolean readGeoJSONCRS(InputStream is, Context context)