类 GeoJsonFeatureConverter


  • public class GeoJsonFeatureConverter
    extends Object
    feature与geojson互转 线程安全
    作者:
    liuyu
    createdate
    2022/3/15
    • 字段详细资料

      • mapper

        public static final com.fasterxml.jackson.databind.ObjectMapper mapper
        jackson ObjectMapper
    • 构造器详细资料

      • GeoJsonFeatureConverter

        public GeoJsonFeatureConverter()
    • 方法详细资料

      • geometry2GeoJson

        public static GeoJsonObject.Geometry geometry2GeoJson​(org.locationtech.jts.geom.Geometry geometry)
        将geometry对象转为GeoJson
        参数:
        geometry - geometry
        返回:
        geojson
      • toGeoJson

        public static GeoJsonObject.Feature toGeoJson​(Feature feature)
        将feature对象转为GeoJson
        参数:
        feature - feature
        返回:
        geojson
      • geoJson2Geometry

        public static org.locationtech.jts.geom.Geometry geoJson2Geometry​(String strGeojsonGeometry,
                                                                          org.locationtech.jts.geom.GeometryFactory geometryFactory)
        将GeoJson对象转为Geometry
        参数:
        strGeojsonGeometry - geojsonGeometry string
        geometryFactory - jts GeometryFactory
        返回:
        jts Geometry
      • geoJson2Geometry

        public static org.locationtech.jts.geom.Geometry geoJson2Geometry​(GeoJsonObject.Geometry geojsonGeometry,
                                                                          org.locationtech.jts.geom.GeometryFactory geometryFactory)
        将GeoJson对象转为Geometry
        参数:
        geojsonGeometry - geojsonGeometry
        geometryFactory - jts GeometryFactory
        返回:
        jts Geometry
      • fromGeoJsonFeature

        public static Feature fromGeoJsonFeature​(String strGeoJsonFeature,
                                                 org.locationtech.jts.geom.GeometryFactory geometryFactory)
        将GeoJson对象转为Feature
        参数:
        strGeoJsonFeature - geoJsonFeature string
        geometryFactory - jts GeometryFactory
        返回:
        Feature
      • fromGeoJsonFeature

        public static Feature fromGeoJsonFeature​(GeoJsonObject.Feature geoJsonFeature,
                                                 org.locationtech.jts.geom.GeometryFactory geometryFactory)
        将GeoJson对象转为Feature
        参数:
        geoJsonFeature - geoJsonFeature
        geometryFactory - jts GeometryFactory
        返回:
        Feature
      • fromGeoJsonFeatureCollection

        public static FeatureCollection fromGeoJsonFeatureCollection​(String strGeoJsonFeatureCollection,
                                                                     org.locationtech.jts.geom.GeometryFactory geometryFactory)
        将GeoJson对象转为Feature
        参数:
        strGeoJsonFeatureCollection - geoJsonFeatureCollection string
        geometryFactory - geometryFactory
        返回:
        FeatureCollection
      • fromGeoJsonFeatureCollection

        public static FeatureCollection fromGeoJsonFeatureCollection​(GeoJsonObject.FeatureCollection geoJsonFeatureCollection,
                                                                     org.locationtech.jts.geom.GeometryFactory geometryFactory)
        将GeoJson对象转为Feature
        参数:
        geoJsonFeatureCollection - geoJsonFeatureCollection
        geometryFactory - geometryFactory
        返回:
        FeatureCollection