commit f8751c45e33ec0d5d40b766483c928aad3f5a4e4
Author: Tom Hughes <tom@compton.nu>
Date: Wed Mar 4 09:30:56 2020 +0000
Patch some test results for proj 6.x changes
diff --git a/test/api_coordinatetransformation.test.js b/test/api_coordinatetransformation.test.js
index b7c8e7c8..68fd5a47 100644
--- a/test/api_coordinatetransformation.test.js
+++ b/test/api_coordinatetransformation.test.js
@@ -9,7 +9,7 @@ describe('gdal.CoordinateTransformation', function() {
});
it('should handle Proj.4', function() {
var srs0 = gdal.SpatialReference.fromProj4('+proj=lcc +lat_1=49 +lat_2=45 +lat_0=44.25 +lon_0=-109.5 +x_0=599999.9999976 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048 +no_defs');
- var srs1 = gdal.SpatialReference.fromEPSG(4326);
+ var srs1 = gdal.SpatialReference.fromProj4('+init=epsg:4326');
var pt = new gdal.Point(1, 2);
var ct = new gdal.CoordinateTransformation(srs0, srs1);
diff --git a/test/api_dataset.test.js b/test/api_dataset.test.js
index 58f8ae1f..b92a8c8c 100644
--- a/test/api_dataset.test.js
+++ b/test/api_dataset.test.js
@@ -4,14 +4,14 @@ var path = require('path');
var assert = require('chai').assert;
var fileUtils = require('./utils/file.js');
-var NAD83_WKT = 'PROJCS["NAD_1983_UTM_Zone_10N",' +
- 'GEOGCS["GCS_North_American_1983",' +
- 'DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],' +
+var NAD83_WKT = 'PROJCS["NAD83 / UTM zone 10N",' +
+ 'GEOGCS["NAD83",' +
+ 'DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","6269"]],' +
'PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433]],' +
- 'PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],' +
- 'PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-123.0],' +
- 'PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_of_Origin",0.0],' +
- 'UNIT["Meter",1.0]]';
+ 'PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-123],' +
+ 'PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],' +
+ 'UNIT["metre",1,AUTHORITY["EPSG","9001"]],' +
+ 'AXIS["Easting",EAST],AXIS["Northing",NORTH]]';
describe('gdal.Dataset', function() {
afterEach(gc);
diff --git a/test/api_geometry.test.js b/test/api_geometry.test.js
index 70b5e53e..dcfffa62 100644
--- a/test/api_geometry.test.js
+++ b/test/api_geometry.test.js
@@ -1,6 +1,6 @@
var gdal = require('../lib/gdal.js');
var assert = require('chai').assert;
-var WGS84 = 'GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]';
+var WGS84 = 'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433],AXIS["Longitude",EAST],AXIS["Latitude",NORTH]]';
describe('gdal.Geometry', function() {
afterEach(gc);
diff --git a/test/api_layer.test.js b/test/api_layer.test.js
index 5037d7cf..4e08937c 100644
--- a/test/api_layer.test.js
+++ b/test/api_layer.test.js
@@ -92,6 +92,7 @@ describe('gdal.Layer', function() {
prepare_dataset_layer_test('r', function(dataset, layer) {
// EPSG:4269 - exact WKT can vary when using shared GDAL / Proj4 library
var expectedWKT = [
+ 'GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST],AUTHORITY["EPSG","4269"]]',
'GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4269"]]',
'GEOGCS["GCS_North_American_1983",DATUM["North_American_Datum_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]'
];
diff --git a/test/api_spatialreference.test.js b/test/api_spatialreference.test.js
index 36d2da3b..abc535dc 100644
--- a/test/api_spatialreference.test.js
+++ b/test/api_spatialreference.test.js
@@ -125,7 +125,7 @@ describe('gdal.SpatialReference', function() {
describe('toProj4', function() {
it('should return string', function() {
var srs = gdal.SpatialReference.fromUserInput('NAD83');
- assert.equal(srs.toProj4(), '+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs');
+ assert.equal(srs.toProj4(), '+proj=longlat +datum=NAD83 +no_defs');
});
});
describe('isGeographic', function() {
diff --git a/test/api_warp.test.js b/test/api_warp.test.js
index 19a1b543..bdece580 100644
--- a/test/api_warp.test.js
+++ b/test/api_warp.test.js
@@ -20,7 +20,7 @@ describe('gdal', function() {
// warp options
var s_srs = src.srs;
- var t_srs = gdal.SpatialReference.fromUserInput('EPSG:4326');
+ var t_srs = gdal.SpatialReference.fromProj4('+init=epsg:4326');
var tx = new gdal.CoordinateTransformation(s_srs, t_srs);
// compute output extent
@@ -110,7 +110,7 @@ describe('gdal', function() {
// warp options
var s_srs = src.srs;
- var t_srs = gdal.SpatialReference.fromUserInput('EPSG:4326');
+ var t_srs = gdal.SpatialReference.fromProj4('+init=epsg:4326');
var tr = {x: 0.0005, y: 0.0005}; // target resolution
var tx = new gdal.CoordinateTransformation(s_srs, t_srs);
var cutline = cutline_ds.layers.get(0).features.get(0).getGeometry();
@@ -478,7 +478,7 @@ describe('gdal', function() {
assert.throws(function() {
gdal.suggestedWarpOutput(options);
- }, 'Mercator_1SP with scale != 1.0 and latitude of origin != 0, not supported by PROJ.4.');
+ }, 'Mercator');
});
} else {
it.skip('should throw error if GDAL can\'t create transformer', function() {});