How to use the @turf/random.randomPosition function in @turf/random

To help you get started, we’ve selected a few @turf/random 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 digidem / mapeo-mobile / scripts / anonymize_test_data.js View on Github external
function randomizeObs(o) {
  var r = JSON.parse(JSON.stringify(o));
  r.id = randomBytes(8).toString("hex");
  r.version = randomBytes(32).toString("hex");
  r.created_at = addDateFuzz(o.created_at);
  r.timestamp = addDateFuzz(o.timestamp, r.created_at);
  var pos = randomPosition(bbox);
  r.value.lon = pos[0];
  r.value.lat = pos[1];
  r.value.tags = {
    notes: txtgen.sentence(),
    categoryId: o.value.tags.categoryId
  };
  return r;
}

@turf/random

turf random module

MIT
Latest version published 4 months ago

Package Health Score

94 / 100
Full package analysis