How to use mapshaper - 2 common examples

To help you get started, we’ve selected a few mapshaper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github code4history / Maplat / editor / lib / mapedit.js View on Github external
'use strict';
var path = require('path');
var settings = require('./settings');
var fs = require('fs-extra');
var fileUrl = require('file-url');
var electron = require('electron');
var BrowserWindow = electron.BrowserWindow;
var turf = require('@turf/turf');
var Tin = require('../common/js/tin');
var wkt = require('wellknown');
var isClockwise = turf.booleanClockwise;
const {ipcMain} = require('electron');
var internal = require('mapshaper').internal;

settings.init();

var mapFolder;
var tileFolder;
var focused;
var tinObject;

var mapedit = {
    init: function() {
        var saveFolder = settings.getSetting('saveFolder');
        mapFolder = saveFolder + path.sep + 'maps';
        fs.ensureDir(mapFolder, function(err) {});
        tileFolder = saveFolder + path.sep + 'tiles';
        fs.ensureDir(tileFolder, function(err) {});
        focused = BrowserWindow.getFocusedWindow();
github echarts-maps / echarts-china-cities-js / build / tasks / beijing.js View on Github external
return new Promise((resolve, reject) => {
    mapshaper.runCommands(command, (error) => {
      if(error){reject(error);};
      resolve();
    });
  });
}

mapshaper

A tool for editing vector datasets for mapping and GIS.

MPL-2.0
Latest version published 2 days ago

Package Health Score

73 / 100
Full package analysis

Popular mapshaper functions