Modify

Opened 4 years ago

Last modified 4 years ago

#20160 new enhancement

[patch] [rfe] British National Grid projection EPSG:27700

Reported by: Adrian Owned by: team
Priority: normal Milestone:
Component: Core Version: latest
Keywords: template_report projection OSGB_1936 OSGB36 Cc:

Description

This proposal is in two parts. First, to add the British National Grid projection EPSG:27700 to the list of default projections. Second, to upgrade the definition of EPSG:27700 from the approximate version currently used by JOSM. The approximation produces misalignments of up to 5m depending on the location. The approximation is the one used by proj4 at the time when the projection handling was added to JOSM. The definition used by proj was upgraded in proj6. It implements the official definition held in the EPSG registry.

The upgrade actually applies to the OSGB36 datum, used by EPSG:27700. This change affects 105 projections which use the OSGB36 datum, numbers 4277, 7405, 27700 and 102799-102900. It involves a grid shift file OSTN15_NTv2_OSGBtoETRS.gsb. The file came from https://www.ordnancesurvey.co.uk/business-government/tools-support/os-net/for-developers The file is also available here https://download.osgeo.org/proj/proj-datumgrid-europe-1.2.zip

A patch is attached. You will see that it includes an ugly workaround. I have updated the projection test files and the updates are in the patch. I have only updated the 105 projections affected. I used proj-4.9.3 - with a modification to the OSGB36 datum equivalent to the modification in the patch - when updating the test files. I have run ProjectionRefTest and ProjectionRegressionTest and they passed on my machine.

[junitlauncher] Test run finished after 59302 ms
[junitlauncher] [         1 tests successful      ]

[junitlauncher] Test run finished after 59390 ms
[junitlauncher] [         1 tests successful      ]

If you accept this rfe, and if you wish to credit me, my name is Adrian.

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2020-11-21 14:56:29 +0100 (Sat, 21 Nov 2020)
Revision:17329
Build-Date:2020-11-22 02:30:52
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (17329 en_GB) Mac OS X 10.14.6
OS Build number: Mac OS X 10.14.6 (18G6020)
Memory Usage: 234 MB / 4096 MB (111 MB allocated, but free)
Java version: 15+36, AdoptOpenJDK, OpenJDK 64-Bit Server VM
Look and Feel: com.apple.laf.AquaLookAndFeel
Screen: Display 458669421 1920x1080 (scaling 1.0x1.0)
Maximum Screen Size: 1920x1080
Best cursor sizes: 16x16 -> 16x16, 32x32 -> 32x32

Plugins:
+ ImportImagePlugin (35567)
+ InfoMode (35543)
+ PicLayer (2a9aa7a)
+ apache-commons (35524)
+ cadastre-fr (35645)
+ editgpx (35562)
+ ejml (35458)
+ geotools (35458)
+ http2 (35427)
+ imagery_offset_db (35640)
+ jaxb (35543)
+ jts (35458)
+ log4j (35458)
+ measurement (35640)
+ opendata (35640)
+ photo_geotagging (35640)
+ poly (35640)
+ reverter (35640)
+ turnrestrictions (35640)
+ undelete (35640)
+ utilsplugin2 (35640)
+ waydownloader (35640)

Attachments (3)

20160.patch (157.0 KB ) - added by Adrian 4 years ago.
OSTN15_NTv2_OSGBtoETRS.gsb (14.5 MB ) - added by Adrian 4 years ago.
Grid shift file
20160v2.patch (157.0 KB ) - added by Adrian 4 years ago.

Change History (22)

by Adrian, 4 years ago

Attachment: 20160.patch added

by Adrian, 4 years ago

Attachment: OSTN15_NTv2_OSGBtoETRS.gsb added

Grid shift file

comment:1 by stoecker, 4 years ago

Why that change to NTV2Proj4DirGridShiftFileSource.java?

BTW: Actually I'm not happy that we stick to proj4 style files. Migration to the better proj6 concept would be fine. Question is how?

in reply to:  1 comment:2 by Adrian, 4 years ago

Replying to stoecker:

Why that change to NTV2Proj4DirGridShiftFileSource.java?

It allows JOSM to look for grid shift files in a local folder on MacOS, like it does in Windows and Linux/Unix. I installed proj from source on MacOS and by default it puts its grid shift files in /usr/local/share/proj

in reply to:  1 ; comment:3 by simon04, 4 years ago

Milestone: 20.12

BTW: Actually I'm not happy that we stick to proj4 style files. Migration to the better proj6 concept would be fine. Question is how?

#18733?

in reply to:  3 ; comment:4 by stoecker, 4 years ago

Replying to simon04:

BTW: Actually I'm not happy that we stick to proj4 style files. Migration to the better proj6 concept would be fine. Question is how?

#18733?

No. The grids are only one part.

The transformations itself in newer proj are handled totally different (and better). But sadly this means the transformation dataset isn't compatible. You don't find such an easy textual description for new proj.

comment:5 by simon04, 4 years ago

Milestone: 20.1221.01

in reply to:  4 ; comment:6 by Don-vip, 4 years ago

Replying to stoecker:

The transformations itself in newer proj are handled totally different (and better).

What's the difference? Do you have an example?

comment:7 by Don-vip, 4 years ago

Why so many changes in the projection data files? I expected to find only changes for the three listed projections.

in reply to:  7 comment:8 by Adrian, 4 years ago

Replying to Don-vip:

Why so many changes in the projection data files? I expected to find only changes for the three listed projections.

I am proposing a change to the OSGB36 datum. This datum is used by 105 projections and I have updated the corresponding tests.

in reply to:  6 ; comment:9 by stoecker, 4 years ago

Replying to Don-vip:

Replying to stoecker:

The transformations itself in newer proj are handled totally different (and better).

What's the difference? Do you have an example?

https://github.com/OSGeo/PROJ/releases/tag/5.0.0

in reply to:  9 ; comment:10 by Don-vip, 4 years ago

Replying to stoecker:

What's the difference? Do you have an example?

https://github.com/OSGeo/PROJ/releases/tag/5.0.0

OK so if I understand correctly, the algorithms have been improved and the previous text file is now a SQLite3 database file named proj.db.

Probably the simplest solution would be to make JOSM download the JDBC driver (7 Mb) and SQLite file (9 Mb) at runtime?

I don't know what the algorithms update mean for us.

in reply to:  10 comment:11 by stoecker, 4 years ago

Replying to Don-vip:

Replying to stoecker:

What's the difference? Do you have an example?

https://github.com/OSGeo/PROJ/releases/tag/5.0.0

OK so if I understand correctly, the algorithms have been improved and the previous text file is now a SQLite3 database file named proj.db.

Probably the simplest solution would be to make JOSM download the JDBC driver (7 Mb) and SQLite file (9 Mb) at runtime?

I don't know what the algorithms update mean for us.

I have no idea. But maybe the existence of the sqlite file means that it's easier than I thought :-)

comment:12 by Don-vip, 4 years ago

One other option would be simply to write a conversion tool that converts the sqlite file to proj.4 format?

in reply to:  12 comment:13 by stoecker, 4 years ago

Replying to Don-vip:

One other option would be simply to write a conversion tool that converts the sqlite file to proj.4 format?

If possible I'd think that's the easiest solution.

comment:14 by stoecker, 4 years ago

Milestone: 21.0121.02

Milestone renamed

comment:15 by Don-vip, 4 years ago

Milestone: 21.0221.03

I'll try to take a look to projection stuff next month.

comment:16 by Don-vip, 4 years ago

Milestone: 21.0321.04

comment:17 by simon04, 4 years ago

Milestone: 21.0421.05

@stoecker and/or Don-vip, can someone please review/apply this patch for milestone:21.05? Thank you!

comment:18 by Adrian, 4 years ago

I believe you are thinking of doing something rather different from what I proposed in this patch, but which would nevertheless upgrade the OSGB36 datum to use the grid shift file. Also, I suspect that no-one else is using this patch. But for what it's worth, I attach a version of the patch updated to apply cleanly to r17833. For instructions on how to use the patch in the absence of support for the grid shift file from the JOSM server, please see #20178.

by Adrian, 4 years ago

Attachment: 20160v2.patch added

comment:19 by simon04, 4 years ago

Milestone: 21.05

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to Adrian.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.