Giter Club home page Giter Club logo

mapshaper-plus's Introduction

mapshaper-plus

Generate geojson files for Apache ECharts (incubating) Map,base on mapshaper

基于mapshaper对geojson地图数据的坐标信息进行压缩编码,并提供可直接生成压缩编码后的echarts map数据格式

通过mapshaper-plus可以直接将shp格式数据转换为压缩后的echarts数据

Demo

https://giscafer.github.io/mapshaper-plus/

Description

介绍 ——mapshaper可以将多种数据格式(Shapefile, GeoJSON, TopoJSON 和 Zip files)导入后,对地图的编辑和导出(Shapefile, GeoJSON, TopoJSON, DSV, SVG),功能强大和简单易用。

mapshaper-plus是在mapshaper基础上拓展对地图坐标信息的压缩编码,很大程度上减小了文件的代码行数和字节大小:譬如一个贵州省的数据,原始的geojson数据会在30M左右,但在对坐标信息压缩编码后,仅为1.4M

背景 ——在做echarts图表统计时,需要自制地图数据,但官方没有提供一个平台可以直接将shp文件转化为压缩后的jsonjs格式的地图文件,而mapshaper导出的json数据没有压缩,数据量过大。

使用可以访问mapshaper-plus在线demo

Screenshot

导出压缩版的数据

License

mapshaper is licensed under MPL 2.0. and mapshaper-plus is licensed under MIT.

Blog giscafer.com  ·  GitHub @giscafer  ·  Weibo @Nickbing Lao

mapshaper-plus's People

Contributors

giscafer avatar hansz00 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mapshaper-plus's Issues

Simplification cause Errors by Export

Hello,

after using the simplification of the geoJSON File, it cannot be exported in encoded echarts format:

Error: Uncaught TypeError: Cannot set property 'encodeOffsets' of null

Export ECharts got undefined

I imported this GeoJSON data:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              107.8912353515625,
              30.314802211415493
            ],
            [
              107.82943725585938,
              30.260253384089417
            ],
            [
              107.88848876953125,
              30.223475116500158
            ],
            [
              107.97225952148438,
              30.278044377800153
            ],
            [
              108.10409545898438,
              30.370505537135568
            ],
            [
              107.8912353515625,
              30.314802211415493
            ]
          ]
        ]
      }
    }
  ]
}

The polygon is rendered correctly in the website, but when export with Echarts-map-json or Echarts-map-js, the content is always undefined.

2019-01-10 2 38 34

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.