Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    geomanglerpublic

    Geomangler

    Geomangler is a utility library to process and transform geodata in Node.js. It can also be used as a geospatial server with the built in express server. Currently supported formats are csv, GeoJSON, TopoJSON, gml and json.

    Installing

    Git and Node.js (6 or higher) is required.

    npm install geomangler
    

    or

    1. Clone the repository: git clone https://github.com/afogelberg/geomangler.git
    2. Install with npm: npm install

    Getting started

    It's easy to get started. Just require geomangler and start to mangle your geodata, as in this example.

    const gm = require('geomangler');
    
    gm.add('geojson', 'in file name');
    gm.buffer(5);
    gm.save('geojson', 'out file name', {
      path: './',
      epsgCode: 'EPSG:3010'
    });
    
    

    Using Geomangler as a server

    Geomangler can also be used as a server, for example like this.

    const gm = require('geomangler');
    const gmscript = require('./scripts/gmscript');
    
    const server = gm.server({
      port: '3011'
    });
    
    server.post('/geomangler', gmscript);
    

    Api reference

    General

    • add - add source from file.
    • db - create a db connection.
    • read - read features from a format.
    • save - save source to file.
    • server - start/use an express server.
    • write - write features in a format.

    Manglers

    Helpers

    install

    npm i geomangler

    Downloadsweekly downloads

    9

    version

    1.3.1

    license

    MIT

    repository

    github.com

    last publish

    collaborators

    • avatar