All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.cocoahero.android.geojson.Geometry Maven / Gradle / Ivy

There is a newer version: 9.2.1
Show newest version
package com.cocoahero.android.geojson;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

/**
 * An intermediate, abstract class that acts as a common base for all GeoJSON
 * geometry types.
 * 
 */
public abstract class Geometry extends GeoJSONObject {

    // ------------------------------------------------------------------------
    // Public Constants
    // ------------------------------------------------------------------------

    public static final String JSON_COORDINATES = "coordinates";

    // ------------------------------------------------------------------------
    // Constructors
    // ------------------------------------------------------------------------

    public Geometry() {
        // Default Constructor
    }

    public Geometry(JSONObject json) {
        super(json);
    }

    // ------------------------------------------------------------------------
    // Public Methods
    // ------------------------------------------------------------------------

    @Override
    public JSONObject toJSON() throws JSONException {
        JSONObject json = super.toJSON();

        json.put(JSON_COORDINATES, new JSONArray());

        return json;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy