I've been scratching my head for a white trying to figure it out if it's possible to get pixel information from my rasters using gdallocationinfo in javascript. I found node-gdal, but after reading its documentation I'm not sure if gdallocationinfo is usable.
I basically need this:
gdallocationinfo mytiff.vrt lonlat.lon lonlat.lat -valonly -geolocSo I added to my javascript the following as a test (after node-gdal was succesfully installed as explained in the link above):
var gdal = require("gdal");var dataset = gdal.open("mytiff.vrt");console.log("number of bands: " + dataset.bands.count());console.log("width: " + dataset.rasterSize.x);console.log("height: " + dataset.rasterSize.y);console.log("geotransform: " + dataset.geoTransform);console.log("srs: " + (ds.srs ? ds.srs.toWKT() : 'null'));but I get:
Uncaught ReferenceError: require is not definedIt seems to me that node-gdal is not being recognized, do I need to add some kind of src path to my HTML file first to get node-gdal working?
Any hint is welcomed, thanks in advance,
أكثر...
I basically need this:
gdallocationinfo mytiff.vrt lonlat.lon lonlat.lat -valonly -geolocSo I added to my javascript the following as a test (after node-gdal was succesfully installed as explained in the link above):
var gdal = require("gdal");var dataset = gdal.open("mytiff.vrt");console.log("number of bands: " + dataset.bands.count());console.log("width: " + dataset.rasterSize.x);console.log("height: " + dataset.rasterSize.y);console.log("geotransform: " + dataset.geoTransform);console.log("srs: " + (ds.srs ? ds.srs.toWKT() : 'null'));but I get:
Uncaught ReferenceError: require is not definedIt seems to me that node-gdal is not being recognized, do I need to add some kind of src path to my HTML file first to get node-gdal working?
Any hint is welcomed, thanks in advance,
أكثر...