Geometry from vividsolutions JTS fails when creating JSON

前端 未结 2 1177
逝去的感伤
逝去的感伤 2021-02-19 00:56

pals. I\'m using vividsolutions\'s library JTS (1.13) for Points and Polygons in my application, but when I try to convert geometry objects into JSON, my application fails. Ther

2条回答
  •  被撕碎了的回忆
    2021-02-19 01:47

    If you're using Spring Boot, this is enough:

    pom.xml:

    
        com.bedatadriven
        jackson-datatype-jts
        2.3
    
    

    JacksonConfig.java:

    package org.lskk.lumen.helpdesk;
    
    import com.bedatadriven.jackson.datatype.jts.JtsModule;
    import org.springframework.context.annotation.Bean;
    import org.springframework.context.annotation.Configuration;
    
    @Configuration
    public class JacksonConfig {
        @Bean
        public JtsModule jtsModule() {
            return new JtsModule();
        }
    }
    

提交回复
热议问题