{"_id":"topojson-simplify","_rev":"10-b66865a3f85ee1134beba8710b8c4fcd","name":"topojson-simplify","description":"Topology-preserving simplification and filtering for TopoJSON.","dist-tags":{"latest":"3.0.3"},"versions":{"0.1.0":{"name":"topojson-simplify","version":"0.1.0","description":"Topology-preserving simplification and filtering for TopoJSON.","keywords":["topojson","geojson","simplification"],"homepage":"https://github.com/topojson/topojson-simplify","license":"BSD-3-Clause","author":{"name":"Mike Bostock","url":"https://bost.ocks.org/mike"},"main":"dist/topojson-simplify.js","module":"index","repository":{"type":"git","url":"git+https://github.com/topojson/topojson-simplify.git"},"bin":{"toposimplify":"bin/toposimplify"},"scripts":{"pretest":"rm -rf dist && mkdir dist && rollup --banner \"$(preamble)\" -g topojson-client:topojson -f umd -n topojson -o dist/topojson-simplify.js -- index.js","test":"tape 'test/**/*-test.js' && eslint index.js src","prepublish":"npm run test && uglifyjs --preamble \"$(preamble)\" -cm -o dist/topojson-simplify.min.js -- dist/topojson-simplify.js","postpublish":"VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git push --tags && zip -j dist/topojson-simplify.zip -- LICENSE.md README.md dist/topojson-simplify.js dist/topojson-simplify.min.js"},"dependencies":{"commander":"2","topojson-client":"2"},"devDependencies":{"eslint":"3","package-preamble":"0.0","rollup":"0.36","tape":"4","uglify-js":"2"},"gitHead":"95221d15a6344a9e2682359fd940b72f6ec27fb2","bugs":{"url":"https://github.com/topojson/topojson-simplify/issues"},"_id":"topojson-simplify@0.1.0","_shasum":"10e840d3dae60406f50a4ffa8f2020e6e0a3f794","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"mbostock","email":"mbostock@gmail.com"},"maintainers":[{"name":"mbostock","email":"mbostock@gmail.com"}],"dist":{"shasum":"10e840d3dae60406f50a4ffa8f2020e6e0a3f794","tarball":"https://registry.npmjs.org/topojson-simplify/-/topojson-simplify-0.1.0.tgz","integrity":"sha512-k4awH9BmwvoJEjjc50Kr4UdjQjTrJSlKjrFX2efrNNQZ/cEFQwLCMmSq8XRftFxVfA1l/3/S+q1muJ/CZ3gNJA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCuYm2OJV6y8Rrk2ISnztWgt/cepEIBz6ZL5S+9KXiTowIhAPL9CDe1cRAQBqC0x+rGo7sovLEo8KXnEo0cGkjXYndr"}]},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/topojson-simplify-0.1.0.tgz_1478134909350_0.31050144229084253"},"directories":{}},"2.0.0":{"name":"topojson-simplify","version":"2.0.0","description":"Topology-preserving simplification and filtering for TopoJSON.","keywords":["topojson","geojson","simplification"],"homepage":"https://github.com/topojson/topojson-simplify","license":"BSD-3-Clause","author":{"name":"Mike Bostock","url":"https://bost.ocks.org/mike"},"main":"dist/topojson-simplify.js","module":"index","repository":{"type":"git","url":"git+https://github.com/topojson/topojson-simplify.git"},"bin":{"toposimplify":"bin/toposimplify"},"scripts":{"pretest":"rm -rf dist && mkdir dist && rollup --banner \"$(preamble)\" -g topojson-client:topojson -f umd -n topojson -o dist/topojson-simplify.js -- index.js","test":"tape 'test/**/*-test.js' && eslint index.js src","prepublish":"npm run test && uglifyjs --preamble \"$(preamble)\" -cm -o dist/topojson-simplify.min.js -- dist/topojson-simplify.js","postpublish":"git push && git push --tags && zip -j dist/topojson-simplify.zip -- LICENSE.md README.md dist/topojson-simplify.js dist/topojson-simplify.min.js"},"dependencies":{"commander":"2","topojson-client":"2"},"devDependencies":{"eslint":"3","package-preamble":"0.0","rollup":"0.36","tape":"4","uglify-js":"2"},"gitHead":"c245428066a0ca85011286816b0e1becf59b963d","bugs":{"url":"https://github.com/topojson/topojson-simplify/issues"},"_id":"topojson-simplify@2.0.0","_shasum":"84edd8203c48464d6c5bb7d4a3c9ca8ae055e871","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"mbostock","email":"mbostock@gmail.com"},"maintainers":[{"name":"mbostock","email":"mike@ocks.org"}],"dist":{"shasum":"84edd8203c48464d6c5bb7d4a3c9ca8ae055e871","tarball":"https://registry.npmjs.org/topojson-simplify/-/topojson-simplify-2.0.0.tgz","integrity":"sha512-vhYXfqc4KUI7h5PFDw3ifssLgtWgy26mPXfoTV5+WyrPJFBmU2T2J/z5aHZTVHO/dxBBx7z+UU90sTl/Zgu9Gg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHO9TxDvSVc217f26omnUTqx9ebeByqS5hGZaXbKeI2IAiEAugQYRd3PhdOY0K06Sp7A+WAOExyFINVnnMovqtzDHGE="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/topojson-simplify-2.0.0.tgz_1478201780849_0.23223502188920975"},"directories":{}},"3.0.0":{"name":"topojson-simplify","version":"3.0.0","description":"Topology-preserving simplification and filtering for TopoJSON.","keywords":["topojson","geojson","simplification"],"homepage":"https://github.com/topojson/topojson-simplify","license":"BSD-3-Clause","author":{"name":"Mike Bostock","url":"https://bost.ocks.org/mike"},"main":"dist/topojson-simplify.js","module":"index","repository":{"type":"git","url":"git+https://github.com/topojson/topojson-simplify.git"},"bin":{"toposimplify":"bin/toposimplify"},"scripts":{"pretest":"rm -rf dist && mkdir dist && rollup --banner \"$(preamble)\" -g topojson-client:topojson -f umd -n topojson -o dist/topojson-simplify.js -- index.js","test":"tape 'test/**/*-test.js' && eslint index.js src","prepublish":"npm run test && uglifyjs --preamble \"$(preamble)\" -cm -o dist/topojson-simplify.min.js -- dist/topojson-simplify.js","postpublish":"git push && git push --tags && zip -j dist/topojson-simplify.zip -- LICENSE.md README.md dist/topojson-simplify.js dist/topojson-simplify.min.js"},"dependencies":{"commander":"2","topojson-client":"3"},"devDependencies":{"eslint":"3","package-preamble":"0.0","rollup":"0.41","tape":"4","uglify-js":"2"},"gitHead":"566d031417dfd05864adc303b11cfe1c50b9f005","bugs":{"url":"https://github.com/topojson/topojson-simplify/issues"},"_id":"topojson-simplify@3.0.0","_shasum":"58527d26ca85bd8589b5800f6c10e93885245ae5","_from":".","_npmVersion":"3.10.10","_nodeVersion":"7.3.0","_npmUser":{"name":"mbostock","email":"mike@ocks.org"},"dist":{"shasum":"58527d26ca85bd8589b5800f6c10e93885245ae5","tarball":"https://registry.npmjs.org/topojson-simplify/-/topojson-simplify-3.0.0.tgz","integrity":"sha512-hrim+nmfNpIZtpb9BQy3ckxO578+/Cd1uOoeihiX0lctICMOsz8Mkkt5Mvn9QU5H0IYgVe1Ab60Zu92tzP/7Qw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/6S0RLVkSvuyiRqSkGaCfzTjFjyqha+ZHtkxf148gdwIhAMIWhLGuJjmtgexMwdl8KD2l7I88YckQvstQIGSq9wFG"}]},"maintainers":[{"name":"mbostock","email":"mike@ocks.org"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/topojson-simplify-3.0.0.tgz_1490937771517_0.9460396824870259"},"directories":{}},"3.0.1":{"name":"topojson-simplify","version":"3.0.1","description":"Topology-preserving simplification and filtering for TopoJSON.","keywords":["topojson","geojson","simplification"],"homepage":"https://github.com/topojson/topojson-simplify","license":"BSD-3-Clause","author":{"name":"Mike Bostock","url":"https://bost.ocks.org/mike"},"main":"dist/topojson-simplify.js","module":"index","repository":{"type":"git","url":"git+https://github.com/topojson/topojson-simplify.git"},"bin":{"toposimplify":"bin/toposimplify"},"scripts":{"pretest":"rm -rf dist && mkdir dist && rollup --banner \"$(preamble)\" -g topojson-client:topojson -f umd -n topojson -o dist/topojson-simplify.js -- index.js","test":"tape 'test/**/*-test.js' && eslint index.js src","prepublish":"npm run test && uglifyjs --preamble \"$(preamble)\" -cm -o dist/topojson-simplify.min.js -- dist/topojson-simplify.js","postpublish":"git push && git push --tags && zip -j dist/topojson-simplify.zip -- LICENSE.md README.md dist/topojson-simplify.js dist/topojson-simplify.min.js"},"dependencies":{"commander":"2","topojson-client":"3"},"devDependencies":{"eslint":"3","package-preamble":"0.0","rollup":"0.41","tape":"4","uglify-js":"2"},"gitHead":"09b09494278547001715e6866c46d68e04a3e2e3","bugs":{"url":"https://github.com/topojson/topojson-simplify/issues"},"_id":"topojson-simplify@3.0.1","_shasum":"bd631938f405d283c8d846e5c1fad4085699ad51","_from":".","_npmVersion":"3.10.10","_nodeVersion":"7.3.0","_npmUser":{"name":"mbostock","email":"mike@ocks.org"},"dist":{"shasum":"bd631938f405d283c8d846e5c1fad4085699ad51","tarball":"https://registry.npmjs.org/topojson-simplify/-/topojson-simplify-3.0.1.tgz","integrity":"sha512-Zzg37QYM1yJb7BryHyTSckb8o2S8F6ONlrXEJggdW+gXybjNVfLRLofRrAQUsEbt4xqLF+WK71GRvwZVfWzK8A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCynn3Xx7lNp+F+ADpT+P+xk6bKTalFt0UtKNIhJ66NbwIgaUtYnylYDqIMduZOEvDm+Nt2mrkipYJZHU/gw10kciI="}]},"maintainers":[{"name":"mbostock","email":"mike@ocks.org"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/topojson-simplify-3.0.1.tgz_1492294401322_0.7836421879474074"},"directories":{}},"3.0.2":{"name":"topojson-simplify","version":"3.0.2","description":"Topology-preserving simplification and filtering for TopoJSON.","keywords":["topojson","geojson","simplification"],"homepage":"https://github.com/topojson/topojson-simplify","license":"BSD-3-Clause","author":{"name":"Mike Bostock","url":"https://bost.ocks.org/mike"},"main":"dist/topojson-simplify.js","module":"index","repository":{"type":"git","url":"git+https://github.com/topojson/topojson-simplify.git"},"bin":{"toposimplify":"bin/toposimplify"},"scripts":{"pretest":"rm -rf dist && mkdir dist && rollup --banner \"$(preamble)\" -g topojson-client:topojson -f umd -n topojson -o dist/topojson-simplify.js -- index.js","test":"tape 'test/**/*-test.js' && eslint index.js src","prepublish":"npm run test && uglifyjs --preamble \"$(preamble)\" -cm -o dist/topojson-simplify.min.js -- dist/topojson-simplify.js","postpublish":"git push && git push --tags && zip -j dist/topojson-simplify.zip -- LICENSE.md README.md dist/topojson-simplify.js dist/topojson-simplify.min.js"},"dependencies":{"commander":"2","topojson-client":"3"},"devDependencies":{"eslint":"3","package-preamble":"0.0","rollup":"0.41","tape":"4","uglify-js":"2"},"gitHead":"cf7d99bb2fba1806ee380688a40a51d5080be885","bugs":{"url":"https://github.com/topojson/topojson-simplify/issues"},"_id":"topojson-simplify@3.0.2","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"mbostock","email":"mike@ocks.org"},"dist":{"integrity":"sha512-gyYSVRt4jO/0RJXKZQPzTDQRWV+D/nOfiljNUv0HBXslFLtq3yxRHrl7jbrjdbda5Ytdr7M8BZUI4OxU7tnbRQ==","shasum":"8a2403e639531500fafa0c6594e8b0fadebc2c02","tarball":"https://registry.npmjs.org/topojson-simplify/-/topojson-simplify-3.0.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCHaBqO/j6iDkz6TFTNEjSwNF/XzhrCII9uiSrowucR+gIgdgL6EqfVm8HK7y7b9CO/ScszDFwHRatURAeTQ8u8z6A="}]},"maintainers":[{"name":"mbostock","email":"mike@ocks.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/topojson-simplify-3.0.2.tgz_1501543099309_0.5955245280638337"},"directories":{}},"3.0.3":{"name":"topojson-simplify","version":"3.0.3","description":"Topology-preserving simplification and filtering for TopoJSON.","keywords":["topojson","geojson","simplification"],"homepage":"https://github.com/topojson/topojson-simplify","license":"ISC","author":{"name":"Mike Bostock","url":"https://bost.ocks.org/mike"},"main":"dist/topojson-simplify.js","unpkg":"dist/topojson-simplify.min.js","jsdelivr":"dist/topojson-simplify.min.js","module":"src/index.js","repository":{"type":"git","url":"git+https://github.com/topojson/topojson-simplify.git"},"bin":{"toposimplify":"bin/toposimplify"},"scripts":{"pretest":"rollup -c","test":"tape 'test/**/*-test.js' && eslint src test","prepublishOnly":"rm -rf dist && yarn test","postpublish":"git push && git push --tags && zip -j dist/${npm_package_name}.zip -- LICENSE README.md dist/${npm_package_name}.js dist/${npm_package_name}.min.js"},"dependencies":{"commander":"2","topojson-client":"3"},"devDependencies":{"eslint":"6","rollup":"1","rollup-plugin-terser":"5","tape":"4"},"gitHead":"e37de14960edddcc7d175348942e93b1b366cdbf","bugs":{"url":"https://github.com/topojson/topojson-simplify/issues"},"_id":"topojson-simplify@3.0.3","_npmVersion":"6.4.1","_nodeVersion":"10.14.1","_npmUser":{"name":"mbostock","email":"mike@ocks.org"},"dist":{"integrity":"sha512-V+pBjLVzSQ3+hSOxBiV01OVXgFiCmMO8ia3huxKEyIMTC1ApQHBcdXdOqcQ6U2JJJD31TZduwY6KyF15R8sUgg==","shasum":"668de0ca7ab36797002087190c2222f938af2ab2","tarball":"https://registry.npmjs.org/topojson-simplify/-/topojson-simplify-3.0.3.tgz","fileCount":18,"unpackedSize":50556,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdcUHZCRA9TVsSAnZWagAA7eEP/AxB9ZA0/wYtcvOoJcYM\nJs2ML4Pz09Csf0FmV/jENEr4Z2TAHpuweh/0q2+n50MHV0va9nX+hX2H0Qy4\nhn1pupF4QS6DoFOHKncZ9PU15LhGn/QsGQ5ckM4k34bGUZ7UdwVSzU876yz0\n3ZiwZWCmviZTHYc9POvz0QeMXGvokTkEXVze8trxI7P80Ubayi1FVWeRyxCQ\nmpq21xVJD2p72PMJjfUmbqdTMVArQPy/26rdwVzVOEMUIGBbtUI5PyZUrE9f\nGw+A7PFQKbmOjTJyISFwMI+uV3XoGGNKw3aP4Os1G/WIkPnttv5F5cwnDvNh\n6tht2ksNMZSU8WRbrbxwDi4ZWLQcudR9z0Erg89Pdx9nfyUkTAERLJtNWmhx\nvPLBdHogr7jRpfj9OoP7Li6p6S9B+eLCiTsm631Lg+Dl6laqh5n3gPCBNhPg\n9Lb3WVo4efT7H6AElnHpzvFqNMhib+tKLLVxfnPxoce5zKd3loR56Zwz0v8O\nmq4K6d14WJB6EEOqqNOD3cNgLMS86t4RCMQjFistYxm9v450wo5WjW0QBVmB\nvUneTjeCF7zMs25ayPgO72SUbzAf59sAUMbU65sVATQpxCnjtZzfXH96JB4E\n6uI/2YxqUsxiDUMBS551ZbNNxXfPm+OzxcHMG1dD5NPcwPaFL2m7g+7xtL7Z\nlSbr\r\n=hQMN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEnA4P6nXpN/dAOiXnMkrOdeAYlFk5JBjttq3NZC5UFjAiEAsHGBCssHf4cgxbfRvnt/myECHUlki05oJYZ376ZNQc8="}]},"maintainers":[{"name":"mbostock","email":"mike@ocks.org"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/topojson-simplify_3.0.3_1567703513117_0.7809349845042106"},"_hasShrinkwrap":false}},"readme":"# TopoJSON Simplify\n\nTopology-preserving simplification and filtering for TopoJSON. Smaller files, faster rendering!\n\nFor an introduction to line simplification:\n\n* https://bost.ocks.org/mike/simplify/\n* https://www.jasondavies.com/simplify/\n\n## Installing\n\nIf you use NPM, `npm install topojson-simplify`. Otherwise, download the [latest release](https://github.com/topojson/topojson-simplify/releases/latest). You can also load directly from [unpkg](https://unpkg.com). AMD, CommonJS, and vanilla environments are supported. In vanilla, a `topojson` global is exported:\n\n```html\n<script src=\"https://unpkg.com/topojson-client@3\"></script>\n<script src=\"https://unpkg.com/topojson-simplify@3\"></script>\n<script>\n\ntopology = topojson.presimplify(topology);\n\n</script>\n```\n\n[Try topojson-simplify in your browser.](https://tonicdev.com/npm/topojson-simplify)\n\n# API Reference\n\n<a name=\"presimplify\" href=\"#presimplify\">#</a> topojson.<b>presimplify</b>(<i>topology</i>[, <i>weight</i>]) [<>](https://github.com/topojson/topojson-simplify/blob/master/src/presimplify.js \"Source\")\n\nReturns a shallow copy of the specified *topology* where each coordinate of each arc is assigned a *z*-value according to the specified *weight* function. If *weight* is not specified, it defaults to [planarTriangleArea](#planarTriangleArea). If the input *topology* is delta-encoded (that is, if a *topology*.transform is present), this transform is removed in the returned output topology.\n\nThe returned presimplified topology can be passed to [simplify](#simplify) to remove coordinates below a desired weight threshold.\n\n<a name=\"simplify\" href=\"#simplify\">#</a> topojson.<b>simplify</b>(<i>topology</i>[, <i>minWeight</i>]) [<>](https://github.com/topojson/topojson-simplify/blob/master/src/simplify.js \"Source\")\n\nReturns a shallow copy of the specified *topology* where every arc coordinate whose *z*-value is lower than *minWeight* is removed. Only the *x* and *y* dimensions of the coordinates are preserved in the returned topology. If *minWeight* is not specified, it defaults to [Number.MIN_VALUE](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE). This method has no effect on Point and MultiPoint geometries.\n\nSee [presimplify](#presimplify) to assign *z*-value for each coordinate. See also [toposimplify](#toposimplify).\n\n<a name=\"quantile\" href=\"#quantile\">#</a> topojson.<b>quantile</b>(<i>topology</i>, <i>p</i>) [<>](https://github.com/topojson/topojson-simplify/blob/master/src/quantile.js \"Source\")\n\nReturns the *p*-quantile of the weighted points in the given [presimplified](#presimplify) *topology*, where *p* is a number in the range [0, 1]. The quantile value is then typically passed as the *minWeight* to [simplify](#simplify). For example, the median weight can be computed using *p* = 0.5, the first quartile at *p* = 0.25, and the third quartile at *p* = 0.75. This implementation uses the [R-7 method](https://en.wikipedia.org/wiki/Quantile#Quantiles_of_a_population), which is the default for the R programming language and Excel.\n\n### Filtering\n\n<a name=\"filter\" href=\"#filter\">#</a> topojson.<b>filter</b>(<i>topology</i>[, <i>filter</i>]) [<>](https://github.com/topojson/topojson-simplify/blob/master/src/filter.js \"Source\")\n\nReturns a shallow copy of the specified *topology*, removing any rings that fail the specified [*filter* function](#_filter). See [filterAttached](#filterAttached) and [filterWeight](#filterWeight) for built-in filter implementations.\n\nIf a resulting Polygon geometry object has no rings, it is replaced with a null geometry; likewise, empty polygons are removed from MultiPolygon geometry objects, and if the resulting MultiPolygon geometry object has no polygons, it is replaced with a null geometry; likewise, any null geometry objects are removed from GeometryCollection objects, and if the resulting GeometryCollection is empty, it is replaced with a null geometry.\n\nAfter any geometry objects are removed from the *topology*, the resulting topology is pruned, removing any unused arcs. As a result, this operation typically changes the arc indexes of the topology.\n\n<a name=\"filterAttached\" href=\"#filterAttached\">#</a> topojson.<b>filterAttached</b>(<i>topology</i>) [<>](https://github.com/topojson/topojson-simplify/blob/master/src/filterAttached.js \"Source\")\n\nReturns a [ring *filter* function](#_filter) that returns true if the specified *ring* shares an arc with any other object in the *topology*.\n\n<a name=\"filterAttachedWeight\" href=\"#filterAttachedWeight\">#</a> topojson.<b>filterAttachedWeight</b>(<i>topology</i>[, <i>minWeight</i>[, <i>weight</i>]]) [<>](https://github.com/topojson/topojson-simplify/blob/master/src/filterAttachedWeight.js \"Source\")\n\nReturns a [ring *filter* function](#_filter) that returns true if the weight of the specified *ring* is greater than or equal to the specified *minWeight* threshold or the specified *ring* shares an arc with any other object in the *topology*.\n\n<a name=\"filterWeight\" href=\"#filterWeight\">#</a> topojson.<b>filterWeight</b>(<i>topology</i>[, <i>minWeight</i>[, <i>weight</i>]]) [<>](https://github.com/topojson/topojson-simplify/blob/master/src/filterWeight.js \"Source\")\n\nReturns a [ring *filter* function](#_filter) that returns true if the weight of the specified *ring* is greater than or equal to the specified *minWeight* threshold. If *minWeight* is not specified, it defaults to [Number.MIN_VALUE](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE). If *weight* is not specified, it defaults to [planarRingArea](#planarRingArea).\n\n<a name=\"_filter\" href=\"#_filter\">#</a> <i>filter</i>(<i>ring</i>, <i>interior</i>)\n\nTo filter a topology, you supply a ring *filter* function to [filter](#filter). The *filter* function is invoked for each ring in the input topology, being passed two arguments: the *ring*, specified as an array of points where each point is a two-element array of numbers, and the *interior* flag. If *interior* is false, the given *ring* is the exterior ring of a polygon; if *interior* is true, the given *ring* is an interior ring (a hole). The *filter* function must then return true if the ring should be preserved, or false if the ring should be removed.\n\n### Geometry\n\n<a name=\"planarRingArea\" href=\"#planarRingArea\">#</a> topojson.<b>planarRingArea</b>(<i>ring</i>) [<>](https://github.com/topojson/topojson-simplify/blob/master/src/planar.js#L6 \"Source\")\n\nReturns the [planar area](http://mathworld.wolfram.com/PolygonArea.html) of the specified *ring*, which is an array of points \\[\\[*x*₀, *y*₀\\], \\[*x*₁, *y*₁\\], …\\]. The first point must be equal to the last point. This implementation is agnostic to winding order; the returned value is always non-negative.\n\n<a name=\"planarTriangleArea\" href=\"#planarTriangleArea\">#</a> topojson.<b>planarTriangleArea</b>(<i>triangle</i>) [<>](https://github.com/topojson/topojson-simplify/blob/master/src/planar.js#L1 \"Source\")\n\nReturns the [planar area](http://mathworld.wolfram.com/TriangleArea.html) of the specified *triangle*, which is an array of three points \\[\\[*x*₀, *y*₀\\], \\[*x*₁, *y*₁\\], \\[*x*₂, *y*₂\\]\\]. This implementation is agnostic to winding order; the returned value is always non-negative.\n\n<a name=\"sphericalRingArea\" href=\"#sphericalRingArea\">#</a> topojson.<b>sphericalRingArea</b>(<i>ring</i>, <i>interior</i>) [<>](https://github.com/topojson/topojson-simplify/blob/master/src/spherical.js#L14 \"Source\")\n\nReturns the [spherical area](https://en.wikipedia.org/wiki/Spherical_trigonometry#Area_and_spherical_excess) of the specified *ring*, which is an array of points \\[\\[*x*₀, *y*₀\\], \\[*x*₁, *y*₁\\], …\\] where *x* and *y* represent longitude and latitude in degrees, respectively. The first point must be equal to the last point.\n\nThis implementation uses [d3-geo](https://github.com/d3/d3-geo)’s [winding order convention](https://bl.ocks.org/mbostock/a7bdfeb041e850799a8d3dce4d8c50c8) to determine which side of the polygon is the inside: polygons smaller than a hemisphere must be clockwise, while polygons [larger than a hemisphere](https://bl.ocks.org/mbostock/6713736) must be anticlockwise. If *interior* is true, the opposite winding order is used. This winding order convention is also used by [ESRI shapefiles](https://github.com/mbostock/shapefile); however, it is the **opposite** convention of GeoJSON’s [RFC 7946](https://tools.ietf.org/html/rfc7946#section-3.1.6).\n\n<a name=\"sphericalTriangleArea\" href=\"#sphericalTriangleArea\">#</a> topojson.<b>sphericalTriangleArea</b>(<i>triangle</i>) [<>](https://github.com/topojson/topojson-simplify/blob/master/src/spherical.js#L43 \"Source\")\n\nReturns the [spherical excess](http://mathworld.wolfram.com/SphericalExcess.html) of the specified *triangle*, which is an array of three points \\[\\[*x*₀, *y*₀\\], \\[*x*₁, *y*₁\\], \\[*x*₂, *y*₂\\]\\] where *x* and *y* represent longitude and latitude in degrees, respectively. This implementation uses the same winding order convention as [sphericalRingArea](#sphericalRingArea).\n\n## Command Line Reference\n\n### toposimplify\n\n<a name=\"toposimplify\" href=\"#toposimplify\">#</a> <b>toposimplify</b> [<i>options…</i>] [<i>file</i>] [<>](https://github.com/topojson/topojson-simplify/blob/master/bin/toposimplify \"Source\")\n\nGiven an input *topology*, assigns a *z*-value to every arc coordinate according to a configurable *weight* function, and then generates an output *topology* where every arc coordinate whose *z*-value is lower than a configurable minimum weight is removed. Only the *x* and *y* dimensions of the coordinates are preserved in the returned topology. See also [presimplify](#presimplify), [simplify](#simplify) and [filter](#filter).\n\n<a name=\"toposimplify_help\" href=\"#toposimplify_help\">#</a> toposimplify <b>-h</b>\n<br><a href=\"#toposimplify_help\">#</a> toposimplify <b>--help</b>\n\nOutput usage information.\n\n<a name=\"toposimplify_version\" href=\"#toposimplify_version\">#</a> toposimplify <b>-V</b>\n<br><a href=\"#toposimplify_version\">#</a> toposimplify <b>--version</b>\n\nOutput the version number.\n\n<a name=\"toposimplify_out\" href=\"#toposimplify_out\">#</a> toposimplify <b>-o</b> <i>file</i>\n<br><a href=\"#toposimplify_out\">#</a> toposimplify <b>--out</b> <i>file</i>\n\nSpecify the output TopoJSON file name. Defaults to “-” for stdout.\n\n<a name=\"toposimplify_planar_area\" href=\"#toposimplify_planar_area\">#</a> toposimplify <b>-p</b> <i>value</i>\n<br><a href=\"#toposimplify_planar_area\">#</a> toposimplify <b>--planar-area</b> <i>value</i>\n\nSpecify simplification threshold *value* as the minimum planar triangle area, typically in square pixels.\n\n<a name=\"toposimplify_planar_quantile\" href=\"#toposimplify_planar_quantile\">#</a> toposimplify <b>-P</b> <i>value</i>\n<br><a href=\"#toposimplify_planar_quantile\">#</a> toposimplify <b>--planar-quantile</b> <i>value</i>\n\nSpecify simplification threshold *value* as the minimum quantile of planar triangle areas. The *value* should be in the range [0, 1].\n\n<a name=\"toposimplify_spherical_area\" href=\"#toposimplify_spherical_area\">#</a> toposimplify <b>-s</b> <i>value</i>\n<br><a href=\"#toposimplify_spherical_area\">#</a> toposimplify <b>--spherical-area</b> <i>value</i>\n\nSpecify simplification threshold *value* as the minimum spherical triangle area ([spherical excess](http://mathworld.wolfram.com/SphericalExcess.html)), in [steradians](https://en.wikipedia.org/wiki/Steradian).\n\n<a name=\"toposimplify_spherical_quantile\" href=\"#toposimplify_spherical_quantile\">#</a> toposimplify <b>-S</b> <i>value</i>\n<br><a href=\"#toposimplify_spherical_quantile\">#</a> toposimplify <b>--spherical-quantile</b> <i>value</i>\n\nSpecify simplification threshold *value* as the minimum quantile of spherical triangle areas ([spherical excess](http://mathworld.wolfram.com/SphericalExcess.html)). The *value* should be in the range [0, 1].\n\n<a name=\"toposimplify_filter_detached\" href=\"#toposimplify_filter_detached\">#</a> toposimplify <b>-f</b>\n<br><a href=\"#toposimplify_filter_detached\">#</a> toposimplify <b>--filter-detached</b>\n\nRemove detached rings that are smaller than the simplification threshold after simplifying. See [filterAttached](#filterAttached).\n\n<a name=\"toposimplify_filter_all\" href=\"#toposimplify_filter_all\">#</a> toposimplify <b>-F</b>\n<br><a href=\"#toposimplify_filter_all\">#</a> toposimplify <b>--filter-all</b>\n\nRemove any rings that are smaller than the simplification threshold after simplifying. See [filterWeight](#filterWeight).\n","maintainers":[{"name":"mbostock","email":"mike@ocks.org"}],"time":{"modified":"2022-06-27T18:40:49.890Z","created":"2016-11-03T01:01:51.324Z","0.1.0":"2016-11-03T01:01:51.324Z","2.0.0":"2016-11-03T19:36:21.086Z","3.0.0":"2017-03-31T05:22:51.805Z","3.0.1":"2017-04-15T22:13:21.588Z","3.0.2":"2017-07-31T23:18:19.403Z","3.0.3":"2019-09-05T17:11:53.242Z"},"homepage":"https://github.com/topojson/topojson-simplify","keywords":["topojson","geojson","simplification"],"repository":{"type":"git","url":"git+https://github.com/topojson/topojson-simplify.git"},"author":{"name":"Mike Bostock","url":"https://bost.ocks.org/mike"},"bugs":{"url":"https://github.com/topojson/topojson-simplify/issues"},"license":"ISC","readmeFilename":"README.md","users":{"mwesten":true}}