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. Supported formats are csv, GeoJSON, TopoJSON, gml, json, PostGIS, SQL Server among others.
Git and Node.js (6 or higher) is required.
npm install geomangler
or
- Clone the repository:
git clone https://github.com/afogelberg/geomangler.git
- Install with npm:
npm install
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'
});
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);
- 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.
- buffer - buffer points.
- center - get center of geometry.
- changeCase - changes case.
- changeGeometryType - change geometry type.
- deleteFields - deletes fields.
- filterByText - filter features by text.
- flipCoordinates - flip the axis ordering.
- joinFeatures - join features by common field
- merge - merge feature collections
- move - move features
- renameFields - rename fields
- replaceText - search and replace text
- transform - set new projection
- getFieldNames - get field names.
- getUniqueValues - get unique values from field.