minify-geojson
minify-geojson copied to clipboard
When using a reprojection, it errors on `Error: Cannot find module './crs-defs'`
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!
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 ?
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!