Skip to content

Unable to detect CRS, GeoJSON has no "crs" property #186

@jfoclpf

Description

@jfoclpf

I am getting this error

Error parsing Geometry Error: Unable to detect CRS, GeoJSON has no "crs" property.
    at detectCrs (/home/joao/dev/geoapi.pt/node_modules/@ngageoint/geopackage/node_modules/reproject/index.js:57:11)
    at Object.reproject (/home/joao/dev/geoapi.pt/node_modules/@ngageoint/geopackage/node_modules/reproject/index.js:98:12)
    at Function.FeatureDao.reprojectFeature (/home/joao/dev/geoapi.pt/node_modules/@ngageoint/geopackage/dist/lib/features/user/featureDao.js:446:44)
    at Object._a.next (/home/joao/dev/geoapi.pt/node_modules/@ngageoint/geopackage/dist/lib/features/user/featureDao.js:389:51)
    at generateMunicipalityCensosJsonFIle (/home/joao/dev/geoapi.pt/routines/censos/generateCensosData.js:260:14)
    at generateJsonData (/home/joao/dev/geoapi.pt/routines/censos/generateCensosData.js:236:5)

with

GeoPackageAPI.open(file).then(geoPackage => {
  const table = geoPackage.getFeatureTables()[0]
  const featureDao = geoPackage.getFeatureDao(table)

  // colums which have statistical numbers to aggregate on the municipality
  const countableColumns = featureDao.columns.filter(c => c.startsWith('N_'))

  // statistical sum for all municipalities
  const sum = {}
  countableColumns.forEach(el => {
    sum[el] = 0
  })

  const geoPackageIterator = geoPackage.iterateGeoJSONFeatures(table)
  for (const feature of geoPackageIterator) { // <= ****** HERE *************
    for (const el in sum) {
      sum[el] += feature.properties[el]
    }
  }
})

I'm using the latest NPM version 4.2.3, and node v16.19.0

Any idea what the problem is?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions