yocontra / node-gdal-next

Node.js bindings for GDAL (Geospatial Data Abstraction Library) [Fork]
https://contra.io/node-gdal-next/
Apache License 2.0
75 stars 36 forks source link

LCC projections support broken #6

Closed jdesboeufs closed 3 years ago

jdesboeufs commented 4 years ago

The support of LCC projections seems to be broken since PROJ6 integration. So I'm stuck to 0.10.0 version in production for now.

Example code:

const gdal = require('gdal-next')

const wgs84 = gdal.SpatialReference.fromProj4('+init=epsg:4326')

const dataset = gdal.open('/vsizip/test.zip')
const layer = dataset.layers.get(0)
const transform = new gdal.CoordinateTransformation(layer.srs, wgs84)

const geometry = layer.features.get(0).getGeometry()
geometry.transform(transform)

You can try with this file:

curl https://www.data.gouv.fr/fr/datasets/r/1cbb1e3a-b915-4103-95ad-6a9feb3c8187 > test.zip
yocontra commented 4 years ago

@jdesboeufs Could you make a repo that expresses this as a test using some assertions? Then I can run the tests against each version of gdal and look into the issue, and have a better idea of it actually being fixed without having to manually look at the output. I'm not super familiar with the expected output so will make it much easier.

jdesboeufs commented 4 years ago

After some additional research, it seems the transformation "Lambert Conformal Conic" used in the coordinates system is not supported anymore in PROJ7. It also breaks with ogr2ogr 3.1. It's a real problem for me, but it's not the responsability of gdal-next.

jdesboeufs commented 4 years ago

I reopen the issue since I'm able to "repair" the projection with ogr2ogr. So if ogr2ogr is able to read and save, then open read and transform, gdal-next could too.

mmomtchev commented 3 years ago

@jdesboeufs this is working for me in the latest version, can you please retry and give me feedback

jdesboeufs commented 3 years ago

It's working!

Thank you very much!