
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
dxf-polygon-cleaner
Advanced tools
Takes the result table of dxf-polygon-importer and runs cleaning and validation functions on a given file, project and version combination.
The initial version was developed to solve following geometry problems:
Key for yellow numbered test problem sets:
npm install dxf-polygon-cleaner
The module requires a PostGIS enabled PostgreSQL database (version 9.3 or higher) and expects a database structure created by the dxf-polygon-importer.
Following environment variables need to be set:
DXF_TOOLS_DB_HOST ... PostgreSQL server host
DXF_TOOLS_DB_PORT ... PostgreSQL server port
DXF_TOOLS_DB_USER ... Database user name
DXF_TOOLS_DB_PASSWORD ... Database user password
DXF_TOOLS_DB_NAME ... Database name
Sensible database connection defaults are applied for typical 'localhost' environments, a database-name is required however.
The module will create a table approved_dxf_features
, for permantly storing a single version of approved features, and 2 temporary views, for accessing the latest versions per feature type, project and filename.
var Cleaner = require('dxf-polygon-cleaner');
// Cleaner(filename, project, version);
var cleaner = Cleaner('mydrawing.dxf', 'myproject', 1);
cleaner.setup().then(function () {
// data cleaning and/or validation methods
}).then(function () {
return cleaner.teardown();
});
Requires a test
database.
$ npm test
Cleaner(filename, project, version)
The class takes 3 arguments to identify the feature collection that should be processed: the filename
of the imported dxf file, the project
identifier and the imported version
.
Cleaner.setup()
Creates temporary views to make succeeding database queries and operations a little easier.
Cleaner.teardown()
Removes temporary views and ends the database connection pool.
Cleaner.fixDoughnuts()
Creates doughnut geometries and removes overlaps of polygons and their completely contained polygons.
Cleaner.deleteEmptyPolygons()
Deletes all polygons with an area smaller than 1 [square-unit].
Cleaner.labelPolygons()
Assigns labels as names to enclosing polygons.
Cleaner.fixDoughnutLabels()
Moves labels from cores to non-labeled rings of doughnut geometries.
Cleaner.flagPolygons()
Adds following validation flags to all polygons:
hasLabel, hasManyLabels, hasSharedLabels
compactness, area
isOverlapping, overlappingPolygons
isValid, validReason
The compactness indicator measures shape form and is calculated by the following formula:
Example values:
Cleaner.flagLabels()
Adds following validation flags to all label points:
isInPolygon, isInManyPolygons
Cleaner.approvePolygons(options)
Inserts a copy of the currently processed features into approved_dxf_features
, and deletes any prior existing versions in that table.
{
endPool: true|false end database pool when done
}
Cleaner.getInvalidGeometryDetails()
Return a GeoJSON object with point geometries and meta information of possibly problematic geometries, like self-intersections.
Cleaner.getGeoJson(options)
Return a GeoJSON Feature collection of the currently processed features. It takes and options
object with following properties:
{
approved: true|false return only approved features
endPool: true|false end database pool when done
}
Cleaner.setVersion()
Finds the most recent version of a project and filename combination and sets the Cleaner._version
property accordingly. Useful when defaulting to the last version.
Cleaner.fullService()
Alias for running common tasks:
Returns GeoJSON.
FAQs
A custom DXF cleaning and validation utility.
The npm package dxf-polygon-cleaner receives a total of 2 weekly downloads. As such, dxf-polygon-cleaner popularity was classified as not popular.
We found that dxf-polygon-cleaner 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.