I am having problems getting lengths from multilinestrings after transforming data from EPSG:27700 - OSGB 1936 / British National Grid to EPSG:4326/ WGS 84.
I'm doing this conversion to import a roads shapefile into a PostGIS database that uses WGS84 as default. However, when I try to calulate lengths, I'm having weird readings.
Firstly I thought about some incorrect transformation, but after doing some additional tests in an empty database importing the layer without transforming it (OSGB 1936 reference), I´m still puzzled:
The following query returns contradictory results
SELECT ST_Length(geom) AS length_OSGB ,ST_Length_Spheroid(ST_Transform(geom,4326),'SPHEROID["WGS 84",6378137,298.257223563]') As length_WGS84 FROM osgb36_dataWHERE id = 108 this yields 338 meters for the OSGB36 length and 482 meters for the WGS84 length. The right one is 338 meters.
I've done the importation to the database using QGIS and DBmanager.
Also, I had to guess the initial projectios, as the .prj was missing, but projecting the result over google maps results in a perfect match.
Any hint is welcome
أكثر...
I'm doing this conversion to import a roads shapefile into a PostGIS database that uses WGS84 as default. However, when I try to calulate lengths, I'm having weird readings.
Firstly I thought about some incorrect transformation, but after doing some additional tests in an empty database importing the layer without transforming it (OSGB 1936 reference), I´m still puzzled:
The following query returns contradictory results
SELECT ST_Length(geom) AS length_OSGB ,ST_Length_Spheroid(ST_Transform(geom,4326),'SPHEROID["WGS 84",6378137,298.257223563]') As length_WGS84 FROM osgb36_dataWHERE id = 108 this yields 338 meters for the OSGB36 length and 482 meters for the WGS84 length. The right one is 338 meters.
I've done the importation to the database using QGIS and DBmanager.
Also, I had to guess the initial projectios, as the .prj was missing, but projecting the result over google maps results in a perfect match.
Any hint is welcome
أكثر...