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

gu.sql2java.geometry.jackson.GeometrySerializer Maven / Gradle / Ivy

The newest version!
package gu.sql2java.geometry.jackson;

import java.io.IOException;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.vividsolutions.jts.geom.Geometry;

/**
 * Serializing Geometry property as WKT String with Jackson
* @author guyadong * @since 3.18.0 * @param */ public class GeometrySerializer extends JsonSerializer { @Override public void serialize(T value, JsonGenerator gen, SerializerProvider serializers) throws IOException, JsonProcessingException { gen.writeString(value.toText()); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy