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

com.graphhopper.jackson.GHPointDeserializer Maven / Gradle / Ivy

There is a newer version: 9.1
Show newest version
package com.graphhopper.jackson;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.graphhopper.util.shapes.GHPoint;

import java.io.IOException;

class GHPointDeserializer extends JsonDeserializer {
    @Override
    public GHPoint deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
        double[] bounds = jsonParser.readValueAs(double[].class);
        return GHPoint.fromJson(bounds);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy