New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dotmapper

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dotmapper

Auto-generate a dotmap from a GeoJSON file.

0.0.1
latest
Source
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

dotmapper

Auto-generate random points in GeoJSON features.

var dotmapper = require("dotmapper");

// Define a dict of point sets you want
// Values should be either:
// key names - will generate feature.properties[key] points in each feature
// functions - will generate function(feature.properties) points in each feature

var pointSets = {
  republicans: function(properties) {
    return +properties.REPUBLICANS_MESSY_FIELD_NAME;
  },
  democrats: "DEMOCRATS_MESSY_FIELD_NAME"
};

var myPoints = dotmapper(myFeatureCollection,pointSets);

// myPoints is a dict with the same keys, and the values are arrays of points

/*
{
  republicans: [
    [lng,lat],
    [lng,lat],
    [lng,lat]
    ...
  ],
  democrats: [
    [lng,lat],
    [lng,lat],
    [lng,lat]
  ]
}
*/

Keywords

dots

FAQs

Package last updated on 12 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts