Indicia-Team / warehouse

GNU General Public License v3.0
5 stars 3 forks source link

Wrong SRID for Irish grid #510

Open JimBacon opened 8 months ago

JimBacon commented 8 months ago

In modules/sref_osie/plugins/sref_osie.php the SRID is set as 29901 but it should be 29903, assuming that 'Irish Grid (TM75)' is intended.

Not really sure of the implications of this but to correct it might require reprojecting records currently in the database.

johnvanbreda commented 8 months ago

Remarks on this page imply you are correct: https://epsg.io/29901. Also they imply that the difference may be very small (within the bounds of the accuracy of the calculation). Picking a random point for comparison implies the difference may be less than a metre, so maybe a transform is not necessary:

select st_astext(st_transform(st_geomfromtext('POINT(7.74561 52.64007)', 4326), 29901)),
st_astext(st_transform(st_geomfromtext('POINT(7.74561 52.64007)', 4326), 29903))

Using 29901 may have come from conversion from old Recorder 6 documentation about the Irish Grids.

JimBacon commented 7 months ago

Agreed. And the difference is smaller still if the example point is in Ireland ;-) Very convenient.

johnvanbreda commented 6 months ago

Switched SRID in the develop branch. Once deployed we should monitor in case the slight shift in grid squares causes problems in mapping (e.g. 2 nearly identical grid squares overlapping, rather than aggregating to one).