Why does osr.SpatialReference return different values in python2 and 3?
up vote
4
down vote
favorite
Can somebody explain why the result of osr.SpatialReference()
differ between Python 2 and 3?
sr = osr.SpatialReference()
sr.SetFromUserInput('EPSG:28992')
sr.ExportToProj4()
In Python 2.7 this gives me
Out[15]: '+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.417,50.3319,465.552,-0.398957,0.343988,-1.8774,4.0725 +units=m +no_defs '
In Python 3 though, I get a different answer:
Out[14]: '+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.2369,50.0087,465.658,-0.406857,0.350733,-1.87035,4.0812 +units=m +no_defs'
coordinate-system gdal python-2.7 python-3
add a comment |
up vote
4
down vote
favorite
Can somebody explain why the result of osr.SpatialReference()
differ between Python 2 and 3?
sr = osr.SpatialReference()
sr.SetFromUserInput('EPSG:28992')
sr.ExportToProj4()
In Python 2.7 this gives me
Out[15]: '+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.417,50.3319,465.552,-0.398957,0.343988,-1.8774,4.0725 +units=m +no_defs '
In Python 3 though, I get a different answer:
Out[14]: '+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.2369,50.0087,465.658,-0.406857,0.350733,-1.87035,4.0812 +units=m +no_defs'
coordinate-system gdal python-2.7 python-3
add a comment |
up vote
4
down vote
favorite
up vote
4
down vote
favorite
Can somebody explain why the result of osr.SpatialReference()
differ between Python 2 and 3?
sr = osr.SpatialReference()
sr.SetFromUserInput('EPSG:28992')
sr.ExportToProj4()
In Python 2.7 this gives me
Out[15]: '+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.417,50.3319,465.552,-0.398957,0.343988,-1.8774,4.0725 +units=m +no_defs '
In Python 3 though, I get a different answer:
Out[14]: '+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.2369,50.0087,465.658,-0.406857,0.350733,-1.87035,4.0812 +units=m +no_defs'
coordinate-system gdal python-2.7 python-3
Can somebody explain why the result of osr.SpatialReference()
differ between Python 2 and 3?
sr = osr.SpatialReference()
sr.SetFromUserInput('EPSG:28992')
sr.ExportToProj4()
In Python 2.7 this gives me
Out[15]: '+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.417,50.3319,465.552,-0.398957,0.343988,-1.8774,4.0725 +units=m +no_defs '
In Python 3 though, I get a different answer:
Out[14]: '+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.2369,50.0087,465.658,-0.406857,0.350733,-1.87035,4.0812 +units=m +no_defs'
coordinate-system gdal python-2.7 python-3
coordinate-system gdal python-2.7 python-3
edited Nov 16 at 13:01
Vince
14.2k32646
14.2k32646
asked Nov 16 at 8:05
LarsVegas
1,38211635
1,38211635
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
7
down vote
accepted
The projections differ in the datum shift values for the conversion from Amersfoort datum to WGS84.
The first one is tfm code 4833, and the second is tfm code 15934.
GDAL 2.1.0 uses tfm code 4833, while GDAL 2.2.0 and later uses tfm code 15934. The change was done in https://trac.osgeo.org/gdal/changeset/37081
According to the remarks, 4833 is the latest definition. See also https://trac.osgeo.org/gdal/ticket/2487 for the difference.
If you want higher precision, you could use a grid shift file for the transformation, see http://osgeo-org.1560.x6.nabble.com/Amersfoort-RD-New-td5293753.html
so his system uses different gdal versions?
– nickves
Nov 16 at 11:12
Unless they compiled the Python bindings themselves, that seems likely.
– bugmenot123
Nov 16 at 12:29
Excellent answer.
– LarsVegas
Nov 16 at 18:32
1
@bugmenot123 it is not necessary to compile the Python bindings yourself, you can just exchange the csv files to get the transformation synchronous in both pythons.
– AndreJ
yesterday
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
7
down vote
accepted
The projections differ in the datum shift values for the conversion from Amersfoort datum to WGS84.
The first one is tfm code 4833, and the second is tfm code 15934.
GDAL 2.1.0 uses tfm code 4833, while GDAL 2.2.0 and later uses tfm code 15934. The change was done in https://trac.osgeo.org/gdal/changeset/37081
According to the remarks, 4833 is the latest definition. See also https://trac.osgeo.org/gdal/ticket/2487 for the difference.
If you want higher precision, you could use a grid shift file for the transformation, see http://osgeo-org.1560.x6.nabble.com/Amersfoort-RD-New-td5293753.html
so his system uses different gdal versions?
– nickves
Nov 16 at 11:12
Unless they compiled the Python bindings themselves, that seems likely.
– bugmenot123
Nov 16 at 12:29
Excellent answer.
– LarsVegas
Nov 16 at 18:32
1
@bugmenot123 it is not necessary to compile the Python bindings yourself, you can just exchange the csv files to get the transformation synchronous in both pythons.
– AndreJ
yesterday
add a comment |
up vote
7
down vote
accepted
The projections differ in the datum shift values for the conversion from Amersfoort datum to WGS84.
The first one is tfm code 4833, and the second is tfm code 15934.
GDAL 2.1.0 uses tfm code 4833, while GDAL 2.2.0 and later uses tfm code 15934. The change was done in https://trac.osgeo.org/gdal/changeset/37081
According to the remarks, 4833 is the latest definition. See also https://trac.osgeo.org/gdal/ticket/2487 for the difference.
If you want higher precision, you could use a grid shift file for the transformation, see http://osgeo-org.1560.x6.nabble.com/Amersfoort-RD-New-td5293753.html
so his system uses different gdal versions?
– nickves
Nov 16 at 11:12
Unless they compiled the Python bindings themselves, that seems likely.
– bugmenot123
Nov 16 at 12:29
Excellent answer.
– LarsVegas
Nov 16 at 18:32
1
@bugmenot123 it is not necessary to compile the Python bindings yourself, you can just exchange the csv files to get the transformation synchronous in both pythons.
– AndreJ
yesterday
add a comment |
up vote
7
down vote
accepted
up vote
7
down vote
accepted
The projections differ in the datum shift values for the conversion from Amersfoort datum to WGS84.
The first one is tfm code 4833, and the second is tfm code 15934.
GDAL 2.1.0 uses tfm code 4833, while GDAL 2.2.0 and later uses tfm code 15934. The change was done in https://trac.osgeo.org/gdal/changeset/37081
According to the remarks, 4833 is the latest definition. See also https://trac.osgeo.org/gdal/ticket/2487 for the difference.
If you want higher precision, you could use a grid shift file for the transformation, see http://osgeo-org.1560.x6.nabble.com/Amersfoort-RD-New-td5293753.html
The projections differ in the datum shift values for the conversion from Amersfoort datum to WGS84.
The first one is tfm code 4833, and the second is tfm code 15934.
GDAL 2.1.0 uses tfm code 4833, while GDAL 2.2.0 and later uses tfm code 15934. The change was done in https://trac.osgeo.org/gdal/changeset/37081
According to the remarks, 4833 is the latest definition. See also https://trac.osgeo.org/gdal/ticket/2487 for the difference.
If you want higher precision, you could use a grid shift file for the transformation, see http://osgeo-org.1560.x6.nabble.com/Amersfoort-RD-New-td5293753.html
edited Nov 16 at 20:50
mkennedy
15.4k13156
15.4k13156
answered Nov 16 at 9:08
AndreJ
67.2k559119
67.2k559119
so his system uses different gdal versions?
– nickves
Nov 16 at 11:12
Unless they compiled the Python bindings themselves, that seems likely.
– bugmenot123
Nov 16 at 12:29
Excellent answer.
– LarsVegas
Nov 16 at 18:32
1
@bugmenot123 it is not necessary to compile the Python bindings yourself, you can just exchange the csv files to get the transformation synchronous in both pythons.
– AndreJ
yesterday
add a comment |
so his system uses different gdal versions?
– nickves
Nov 16 at 11:12
Unless they compiled the Python bindings themselves, that seems likely.
– bugmenot123
Nov 16 at 12:29
Excellent answer.
– LarsVegas
Nov 16 at 18:32
1
@bugmenot123 it is not necessary to compile the Python bindings yourself, you can just exchange the csv files to get the transformation synchronous in both pythons.
– AndreJ
yesterday
so his system uses different gdal versions?
– nickves
Nov 16 at 11:12
so his system uses different gdal versions?
– nickves
Nov 16 at 11:12
Unless they compiled the Python bindings themselves, that seems likely.
– bugmenot123
Nov 16 at 12:29
Unless they compiled the Python bindings themselves, that seems likely.
– bugmenot123
Nov 16 at 12:29
Excellent answer.
– LarsVegas
Nov 16 at 18:32
Excellent answer.
– LarsVegas
Nov 16 at 18:32
1
1
@bugmenot123 it is not necessary to compile the Python bindings yourself, you can just exchange the csv files to get the transformation synchronous in both pythons.
– AndreJ
yesterday
@bugmenot123 it is not necessary to compile the Python bindings yourself, you can just exchange the csv files to get the transformation synchronous in both pythons.
– AndreJ
yesterday
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f302884%2fwhy-does-osr-spatialreference-return-different-values-in-python2-and-3%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown