node-gdal icon indicating copy to clipboard operation
node-gdal copied to clipboard

Geometry.transformTo should throw error out when point coordinates is error

Open shengzheng1981 opened this issue 6 years ago • 0 comments

code section:

const srs = gdal.SpatialReference.fromEPSG(4326);
layer.features.forEach( item => {
	try{
		const geometry = item.getGeometry();
		geometry.transformTo(srs);
		const feature = model({
			geometry: geometry.toJSON(),
			properties: item.fields.toJSON()
		});
		features.push(feature);
	} catch (e) {
		console.log(e);
	}
});

correct point, everything is ok! but when point is error, like : "geometry":{"type":"Point","coordinates":[-1.7976931348623157E308,-1.7976931348623157E308]} no error throw out!! also, code break,cant go through!

shengzheng1981 avatar Jan 25 '19 12:01 shengzheng1981