类 MvtBuilder


  • public class MvtBuilder
    extends Object
    mvt瓦片构造器
    作者:
    liuyu
    createdate
    2022/4/24
    • 字段详细资料

      • extent

        protected final int extent
      • tileClip

        @NotNull
        protected final @NotNull TileClip tileClip
    • 构造器详细资料

      • MvtBuilder

        public MvtBuilder​(byte z,
                          int x,
                          int y,
                          @NotNull
                          @NotNull org.locationtech.jts.geom.GeometryFactory geometryFactory)
      • MvtBuilder

        public MvtBuilder​(byte z,
                          int x,
                          int y,
                          int extent,
                          int clipBuffer,
                          @NotNull
                          @NotNull org.locationtech.jts.geom.GeometryFactory geometryFactory)
        Create with the given extent value.

        The extent value control how detailed the coordinates are encoded in the vector tile. 4096 is a good default, 256 can be used to reduce density.

        The clip buffer value control how large the clipping area is outside of the tile for geometries. 0 means that the clipping is done at the tile border. 8 is a good default.

        参数:
        extent - a int with extent value. 4096 is a good value.
        clipBuffer - a int with clip buffer size for geometries. 8 is a good value.
    • 方法详细资料

      • createLayer

        public MvtLayer createLayer​(String layerName,
                                    int simplifyDistance)
        新建一个图层,按simplifyDistance的值简化geometry
        参数:
        layerName - 图层名 本方法没有对图层名进行唯一校验,故若图层已存在,则原图层会被覆盖
        simplifyDistance - 对geometry进行简化的长度,单位是瓦片像素,取值范围[0,extent+clipBuffer],为0时表示不做简化
        返回:
        MvtLayer
      • createLayer

        public MvtLayer createLayer​(String layerName)
        新建一个图层,不对geometry进行简化
        参数:
        layerName - 图层名 本方法没有对图层名进行唯一校验,故若图层已存在,则原图层会被覆盖
        返回:
        MvtLayer
      • getOrCreateLayer

        @NotNull
        public @NotNull MvtLayer getOrCreateLayer​(String layerName,
                                                  int simplifyDistance)
        新建或获取一个图层,按simplifyDistance的值简化geometry
        参数:
        layerName - 图层名
        simplifyDistance - 对geometry进行简化的长度,单位是瓦片像素,取值范围[0,extent+clipBuffer],为0时表示不做简化
        返回:
        若已有同名图层则返回现有图层,否则新建一个
      • getOrCreateLayer

        @NotNull
        public @NotNull MvtLayer getOrCreateLayer​(String layerName)
        新建或获取一个图层,不对geometry进行简化
        参数:
        layerName - 图层名
        返回:
        若已有同名图层则返回现有图层,否则新建一个
      • getBbox

        public Bbox getBbox()
      • toBytes

        public byte[] toBytes()
        转为 bytes
        返回:
        bytes