From 561d6f897b371f304131e3e9fd0141dce065367b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Desboeufs?= Date: Sun, 6 Sep 2020 21:19:44 +0200 Subject: [PATCH] Upgrade gdal-next --- lib/commands/extract-ems.js | 9 ++++--- package.json | 2 +- yarn.lock | 52 +++++++++++++++++++++++-------------- 3 files changed, 39 insertions(+), 24 deletions(-) diff --git a/lib/commands/extract-ems.js b/lib/commands/extract-ems.js index e817223..e0d9231 100644 --- a/lib/commands/extract-ems.js +++ b/lib/commands/extract-ems.js @@ -116,12 +116,15 @@ function prepareGeometry(feature) { ) } -const wgs84 = gdal.SpatialReference.fromEPSG(4326) - function getGeoJSONFeatures(gdalLayer) { + const transformation = new gdal.CoordinateTransformation( + gdalLayer.srs, + gdal.SpatialReference.fromProj4('+init=epsg:4326') + ) + return gdalLayer.features.map(feature => { const geometry = feature.getGeometry() - geometry.transformTo(wgs84) + geometry.transform(transformation) return { type: 'Feature', geometry: geometry.toObject(), diff --git a/package.json b/package.json index 26d70d3..7210ce8 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "decompress": "^4.2.1", "edigeo-reproject": "^0.2.0", "fs-extra": "^9.0.1", - "gdal-next": "^0.10.0", + "gdal-next": "^2.1.0", "geojson2shp": "^0.3.2", "glob": "^7.1.6", "lodash": "^4.17.20", diff --git a/yarn.lock b/yarn.lock index 304fa12..ac0bc24 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3190,13 +3190,13 @@ gauge@~2.7.3: strip-ansi "^3.0.1" wide-align "^1.1.0" -gdal-next@^0.10.0: - version "0.10.0" - resolved "https://registry.yarnpkg.com/gdal-next/-/gdal-next-0.10.0.tgz#e6c508a202833e3cde8bd7ecef25ea1695892c0a" - integrity sha512-3VIIASNoYO0wdbWFvw/x7ebgzSwQgTGmMxlZEJaB0nr9woAYtFu8qEUKNzUS6aGRAeeUcIGjjWHqQdbWFoHDmg== +gdal-next@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/gdal-next/-/gdal-next-2.1.0.tgz#cc99fe91f7319acaa6f6988ced9b5cfa57878cdc" + integrity sha512-+Yu+38v8Pp8dVPkBWDBkowvxMaPobF37oQwTYaT+36egPuiuZiduwSBKv6hjGFwZ0Q5bd0Bao8lxoZARtLtGPg== dependencies: - nan "~2.14.0" - node-pre-gyp "^0.14.0" + nan "^2.14.0" + node-pre-gyp "^0.15.0" geographiclib@1.48.0: version "1.48.0" @@ -4531,6 +4531,11 @@ minimist@^1.1.3, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" +minimist@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + minimist@~0.0.1: version "0.0.10" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" @@ -4564,6 +4569,13 @@ mkdirp@^0.5.0, mkdirp@^0.5.1: dependencies: minimist "0.0.8" +mkdirp@^0.5.3: + version "0.5.5" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" + integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== + dependencies: + minimist "^1.2.5" + moment@^2.27.0: version "2.27.0" resolved "https://registry.yarnpkg.com/moment/-/moment-2.27.0.tgz#8bff4e3e26a236220dfe3e36de756b6ebaa0105d" @@ -4625,10 +4637,10 @@ mute-stream@0.0.8: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== -nan@~2.14.0: - version "2.14.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" - integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg== +nan@^2.14.0: + version "2.14.1" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.1.tgz#d7be34dfa3105b91494c3147089315eff8874b01" + integrity sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw== nanomatch@^1.2.9: version "1.2.13" @@ -4651,10 +4663,10 @@ natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" -needle@^2.2.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/needle/-/needle-2.3.2.tgz#3342dea100b7160960a450dc8c22160ac712a528" - integrity sha512-DUzITvPVDUy6vczKKYTnWc/pBZ0EnjMJnQ3y+Jo5zfKFimJs7S3HFCxCRZYB9FUZcrzUQr3WsmvZgddMEIZv6w== +needle@^2.5.0: + version "2.5.2" + resolved "https://registry.yarnpkg.com/needle/-/needle-2.5.2.tgz#cf1a8fce382b5a280108bba90a14993c00e4010a" + integrity sha512-LbRIwS9BfkPvNwNHlsA41Q29kL2L/6VaOJ0qisM5lLWsTV3nP15abO5ITL6L81zqFhzjRKDAYjpcBcwM0AVvLQ== dependencies: debug "^3.2.6" iconv-lite "^0.4.4" @@ -4665,14 +4677,14 @@ nice-try@^1.0.4: resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== -node-pre-gyp@^0.14.0: - version "0.14.0" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.14.0.tgz#9a0596533b877289bcad4e143982ca3d904ddc83" - integrity sha512-+CvDC7ZttU/sSt9rFjix/P05iS43qHCOOGzcr3Ry99bXG7VX953+vFyEuph/tfqoYu8dttBkE86JSKBO2OzcxA== +node-pre-gyp@^0.15.0: + version "0.15.0" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.15.0.tgz#c2fc383276b74c7ffa842925241553e8b40f1087" + integrity sha512-7QcZa8/fpaU/BKenjcaeFF9hLz2+7S9AqyXFhlH/rilsQ/hPZKK32RtR5EQHJElgu+q5RfbJ34KriI79UWaorA== dependencies: detect-libc "^1.0.2" - mkdirp "^0.5.1" - needle "^2.2.1" + mkdirp "^0.5.3" + needle "^2.5.0" nopt "^4.0.1" npm-packlist "^1.1.6" npmlog "^4.0.2"