How to use the @lykmapipo/geo-tools.isFeature function in @lykmapipo/geo-tools

To help you get started, we’ve selected a few @lykmapipo/geo-tools 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 CodeTanzania / ewea / scripts / seedGeo.js View on Github external
readGeoJSON({ path }, (error, { finished, feature, next }) => {
    // handle read errors
    if (error) {
      return done(error);
    }
    // handle read finish
    if (finished) {
      return done();
    }
    // process features
    if (isFeature(feature) && get(feature, 'properties.name') && next) {
      // prepare feature seed
      const hospital = {
        namespace: 'Feature', // TODO: CriticalFacility
        strings: {
          name: { en: get(feature, 'properties.name') },
        },
        geos: { geometry: get(feature, 'geometry') },
        properties: get(feature, 'properties'),
        populate: {
          'relations.type': {
            match: { namespace: 'FeatureType', 'strings.name.en': 'Hospital' },
            model: 'Predefine',
          },
        },
      };
      // seed feature

@lykmapipo/geo-tools

Opinionated geo utilities for day to day development

MIT
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis

Popular @lykmapipo/geo-tools functions