How to use the @turf/area.default function in @turf/area

To help you get started, we’ve selected a few @turf/area 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 PieceMaker / max-inscribed-circle / utils / geojson-utils.js View on Github external
// ---------------------------------------------------------------------------------------------------------------------
// GeoJSONUtils
//
// @module
// ---------------------------------------------------------------------------------------------------------------------

const area = require('@turf/area').default;
const _ = require('lodash');

// ---------------------------------------------------------------------------------------------------------------------

class GeoJSONUtils {
    constructor() {
    }

    /**
     * Checks to see if the feature is a Polygon formatted as a MultiPolygon.
     *
     * @param {Polygon} polygon
     * @returns {Polygon}
     */
    fixMultiPoly(polygon) {
        if(polygon.geometry.type === 'MultiPolygon' && polygon.geometry.coordinates[0].length === 1) {

@turf/area

turf area module

MIT
Latest version published 3 months ago

Package Health Score

96 / 100
Full package analysis

Popular @turf/area functions