Code example for JsonArray

Methods: get

0
            JsonDeserializationContext context) throws JsonParseException {
        CoordinateSequence coordSeq = null;
        if (json.isJsonArray()) {
            JsonArray coordinates = json.getAsJsonArray();
            CoordinateSequenceFactory coordFactory = CoordinateArraySequenceFactory.instance();
            Coordinate coord = new Coordinate(coordinates.get(0).getAsDouble(), coordinates.get(1).getAsDouble());
            coordSeq = coordFactory.create(new Coordinate[]{coord});
        }  
        return coordSeq;
    } 
}