How to use the koop/lib.GeoJSON function in koop

To help you get started, we’ve selected a few koop 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 koopjs / koop-provider-agol / workers / request-worker.js View on Github external
featureService.pageQueue.push(job.data.pages, function (error, json) {
      if (error || !json) {
        featureService.pageQueue.kill()
        throw error
      }

      // transform the data into geojson
      koop.GeoJSON.fromEsri(job.data.fields || [], json, function (err, geojson) {
        if (err) return callback(err)
        koop.Cache.insertPartial('agol', job.data.itemId, geojson, job.data.layerId, function (err) {
          if (err) {
            featureService.pageQueue.kill()
            koop.log.error('err')
            var error = new Error('Error inserting rows into the db')
            error.type = 'db'
            throw error
          }
          completed++
          koop.log.info(completed + ' pages of ' + len + ' completed. ' + job.id + ': ' + job.data.itemId + '_' + job.data.layerId)
          job.progress(completed, len)

          if (completed === len) {
            var key = ['agol', job.data.itemId, job.data.layerId].join(':')
            koop.Cache.getInfo(key, function (err, info) {

koop

Serve, transform, and query geospatial data on the web

Apache-2.0
Latest version published 2 years ago

Package Health Score

43 / 100
Full package analysis