Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using a reprojection, it errors on Error: Cannot find module './crs-defs' #28

Open
mwesten opened this issue Aug 25, 2020 · 2 comments

Comments

@mwesten
Copy link

mwesten commented Aug 25, 2020

When running the latest minify-geojson on nodejs 12.18.3-lts with the following parameters:
minify-geojson -r 28992 -ktiv -w "gemeentecode, gemeentenaam, aantal_inwoners, oppervlakte_totaal_in_ha, oppervlakte_land_in_ha" -c 5 -f "water = NEE" build\gemeenten-2012v3.json

it errors with the following message:

$ minify-geojson -r 28992 -ktiv -w "gemeentecode, gemeentenaam, aantal_inwoners, oppervlakte_totaal_in_ha, oppervlakte_land_in_ha" -c 5 -f "water = NEE" build\gemeenten-2012v3.json
REPROJECTING from EPSG:28992 to WGS84
internal/modules/cjs/loader.js:968
  throw err;
  ^

Error: Cannot find module './crs-defs'
Require stack:
- C:\laragon\bin\nodejs\node-v12.18.3-lts\node_modules\minify-geojson\dist\minify-geojson.js
- C:\laragon\bin\nodejs\node-v12.18.3-lts\node_modules\minify-geojson\dist\streaming\minify-geojson-streaming.js
- C:\laragon\bin\nodejs\node-v12.18.3-lts\node_modules\minify-geojson\dist\cli.js
- C:\laragon\bin\nodejs\node-v12.18.3-lts\node_modules\minify-geojson\bin\run.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
    at Function.Module._load (internal/modules/cjs/loader.js:841:27)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at MinifyGeoJSON.getCoordinateReferenceSystem (C:\laragon\bin\nodejs\node-v12.18.3-lts\node_modules\minify-geojson\dist\minify-geojson.js:134:20)
    at C:\laragon\bin\nodejs\node-v12.18.3-lts\node_modules\minify-geojson\dist\minify-geojson.js:38:27
    at C:\laragon\bin\nodejs\node-v12.18.3-lts\node_modules\minify-geojson\dist\minify-geojson.js:73:17
    at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:63:3) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\laragon\\bin\\nodejs\\node-v12.18.3-lts\\node_modules\\minify-geojson\\dist\\minify-geojson.js',
    'C:\\laragon\\bin\\nodejs\\node-v12.18.3-lts\\node_modules\\minify-geojson\\dist\\streaming\\minify-geojson-streaming.js',
    'C:\\laragon\\bin\\nodejs\\node-v12.18.3-lts\\node_modules\\minify-geojson\\dist\\cli.js',
    'C:\\laragon\\bin\\nodejs\\node-v12.18.3-lts\\node_modules\\minify-geojson\\bin\\run.js'
  ]
}

Not sure what to do now.... it seems to miss something ?

Thanks in advance!

@mwesten
Copy link
Author

mwesten commented Aug 25, 2020

It seems like it tries to find a predefined reproject code in the crs-defs file that is not there, so the program breaks. Insteat it should check for the existance of the file and if not there, check on http://spatialreference.org for the existence of that definition ?

@mwesten
Copy link
Author

mwesten commented Aug 25, 2020

Adding a blank csr-defs.json file in the global node_modules/minify-geojson/dist folder did not work.
Adding the old dist/crs-defs.json from history https://github.com/TNOCS/minify-geojson/blob/fd31d779c39fa22253ce19959798a516a1f1009f/dist/crs-defs.json did work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant