com.graphhopper.jackson.GHPointDeserializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of graphhopper-web-api Show documentation
Show all versions of graphhopper-web-api Show documentation
JSON Representation of the API classes
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);
}
}