
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
fences-slicer
Advanced tools
Split large geojson file into smaller region files
Note: you will need node and npm installed first. The easiest way to install node.js is with nave.sh by executing [sudo] ./nave.sh usemain stable
npm install fences-slicer
You can feed a geojson file through the fences-regions command to sanitize and prepare the file to be used in the fences-slicer step.
$ fences-regions --inputGeojson=/etc/planet-fences/admin_level_2.geojson --outputFile=./regions.geojson
In order for input regions to show up in output regions they must meet the following requirements:
name or name:en propertyflag propertyYou could provide a wanted list of names as a filter. In that case the results will all be names matching the items in
the wanted list.
Regions in output will also be simplified (to 0.001).
Output regions will each have the following properties:
name_display : name to be used for display purposesname : sanitized version of the name that can be used for filenamesWhen using fences-slicer from the command line, it expects the following config parameters in order to do its job.
| Name | Description |
|---|---|
inputDir | path to the directory containing geojson input files that need to be split into regions. Only GEOJSON files will be processed, all others will be skipped. Input files will not be modified. |
outputDir | path to an existing directory that will contain output files after the slicer is done slicing. |
regionFile | Geojson file containing regions to be used when slicing. Each region feature must have a name in properties. |
The expected parameters can be specified via a config file like so:
$ fences-slicer --config=./etc/config.json
{
"inputDir": "/some/dir/planet-latest-fences",
"outputDir": "/some/dir/planet-latest-fences-regions",
"regionFile": "/some/geojson/file..geojson"
}
If not using a config file, or using a config file but need to override a particular parameter do this:
$ fences-slicer --inputDir=/path/different/from/config --config=./etc/config.json
When using fences-slicer in your node.js package as dependency, you need to provide an input file and an array
of regions, where each region has an output file and box. See example below.
var slicer = require('fences-slicer');
var param = {
inputDir: '/some/dir/planet-fences/',
inputFile: 'planet-level-2.geojson',
outputDir: '/some/dir/to/throw/output/',
regionFile: '/etc/my/regions.geojson'
};
slicer.extractRegions(params, function () {
console.log('fences sliced successfully!');
});
$ npm run coverage
$ npm test
FAQs
Split large geojson file into smaller region files
We found that fences-slicer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.