linz / gazetteer

New Zealand Gazetteer of official place names
http://www.linz.govt.nz/regulatory/place-names/find-name/new-zealand-gazetteer-official-geographic-names/new-zealand-gazetteer-search-place-names#zoom=0&lat=-41.14127&lon=172.5&layers=BTTT
Other
2 stars 2 forks source link

Cannot change reference point position using Gazetteer editor #212

Closed CMKMS-LINZ closed 3 years ago

CMKMS-LINZ commented 4 years ago

Bug Description

After opening any name to edit the coordinates (whether in long/lat with decimal or DMS, or NZTM), it will not save.

Moving the reference point using the Move feature geometry node tool is unaffected, and works.

Steps to Reproduce

  1. Open any name.
  2. Press edit in the top right.
  3. Press edit for the coordinates
  4. Enter any new, valid format coordiante
  5. Press save, top right corner
  6. Get error message

Desktop

Screenshots

image

image

image

SPlanzer commented 4 years ago

Bug triage for QGIS3 initial release

This is the same behavior as QGIS2 / Plugin version 1.8.2. By this I mean when using any spatial reference system that is not NZGD2000 (ESPG:4167) the error is thrown.

The error shows that function used in this operation only handles geography types, meaning only spatial references representing the earth as an ellipsoid can be used. planar coordinate systems will result in this error

Automated tests in this case were only written for 4167 coordinates.

Next steps

As porting to QGIS3 does not affect this it will not be included in the initial QGIS3 release.

It should be left open as a bug and addressed in the next round of bug fixing / release

CMKMS-LINZ commented 4 years ago

Bug triage for QGIS3 initial release

This is the same behavior as QGIS2 / Plugin version 1.8.2.

By this I mean when using any spatial reference system that is not NZGD2000 (ESPG:4167) the error is thrown. This does not throw and error when using 4167. Automated tests in this case were only written for 4167 coordinates.

Next steps

As porting to QGIS3 does not affect this it will not be included in the initial QGIS3 release.

It should be left open as a bug and addressed in the next round of bug fixing / release

Definitely not the same as 1.8.2. This is a fundamental aspect of the Gazetteer editor and you can (only) edit the coordinates in long/lat or NZTM eastings and northings in production. Refer test plan 2, 30-33. As it stands in UAT, you can't enter and save any coordinates all all, in any format.

The data is stored in NZGD2000:4167, but as this is a long/lat format it's unclear why it won't let you save new coordinates in that format from the Gazetteer editor.

If I were to change something from the database it would look like this for 4167 (long lat):

update gazetteer.feature set ref_point = ST_PointFromText('POINT(174.876771 -41.851062)', 4167) where feat_id = 139689

or this for NZTM

update gazetteer.feature set ref_point = st_transform(ST_PointFromText('POINT(1755794.7 5265057.2)', 2193),4167) where feat_id = 139689

So presumably the Gazetteer editor should be doing pretty much exactly the same thing, albeit somehow also recognising and parsing the order of the coordinates as well (you can enter them in reverse in production) and whether they're in 2193 or 4167.

The error message to me looks like it's just saying 'I am not tied into the function properly, fix please':

image

SPlanzer commented 3 years ago

Summary

This error is related to the UAT test environment database version.

particularity 'astext' was renamed to 'ST_AsText ' when PostGIS went to PostGIS2.

As ST_astext is backward compatible with POSTGIS1.5, I will update 'astext' > 'ST_AsText ' for the reasons of supporting current testing and future database upgrades.

I have also checked and there are no other instances of 'astext'

Backgroung

This is an issue with the UAT test database environment rather than the QGIS plugin src code

Making a test environment available of the same versions to UAT testers was problematic as this either required the UAT tester to use Docker or setup a PostgresSQL database instance 8.5 / 1.5 that they could access. Docker would mean the user getting to know how to use it and having it installed locally. Installing PostgresQL locally was also seen to come with alot of overhead. The dev docker image running in AWS was also investigated but when proving problematic, was failed fast.

The decision was to dump and restore the prd NZGB database into the postgres instance traditionally used for testing (devassgeo01). The problem is this is PostgresSQL 9.3/ Postgis 2.4 rather than the current prd databases versions of PostresQL 8.4 and PostGIS 1.5. It was seen that this would suffice for UAT as automated tests were against the correct environment running the prd versions.

CMKMS-LINZ commented 3 years ago

Appears to be all good. Tested lat/long, long/lat, including westings, and NZTM