-
Notifications
You must be signed in to change notification settings - Fork 19
Description
I'm trying to do a 3D coordinate transform like this:
import SPL from "./dist/spl-node.mjs";
import path from "path";
import { fileURLToPath } from "url";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
let spl = SPL().mount(__dirname + "/dist").db().read(
"select InitSpatialMetaDataFull(1);select PROJ_SetDatabasePath('proj/proj.db')"
);
console.log(spl.exec("SELECT Transform(MakePointZ(4.88969, 52.37403, 50, 4937),7415)"));but the height remains unaltered:
{
'Transform(MakePointZ(4.88969,52.37403,50,4937),7415)':
{ type: 'Point', coordinates: [ 121120.297826, 487466.922163, 50 ] }
}This is node but I also tried the browser.
I was expecting the full proj.db to include or automatically fetch the gridfiles (nl_nsgi_nlgeo2018.tif on official PROJ CDN), but it appears this is not the case or the vertical transformation is silently ignored for some other reason.
I also tried EPSG 9286, which would only convert the height of the desired CRS, but this also doesn't work.
Documentation on PROJ and spatialite and spl.js are rather sparse, especially on vertical transformation.
Any ideas on how to proceed?
Is TIFF supported at all in the default build?
An alternative way to do this in the browser without spatialite dependency would also be great, but I suspect this is not going to happen anytime soon and I'm under too much time pressure myself.