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

Submitting valid geom in edit form fails valid SRID check #151

Closed SPlanzer closed 4 years ago

SPlanzer commented 4 years ago

submitting new coordinates via the edit form always fails with the below. This includes the examples in the edit for i.e 40 03 15.2S 170 35 06.9E

Cannot save changes: (psycopg2.IntegrityError) new row for relation "feature" violates check constraint "enforce_srid_ref_point"

[SQL: UPDATE gazetteer.feature SET ref_point=ST_GeomFromEWKT(%(ref_point)s) WHERE gazetteer.feature.feat_id = %(gazetteer_feature_feat_id)s]
[parameters: {'ref_point': 'SRID=-1;POINT(171.5 -40.3)', 'gazetteer_feature_feat_id': 261}]
(Background on this error at: http://sqlalche.me/e/gkpj)
SPlanzer commented 4 years ago

Geoalchemy2 requires the setting of the SRID

solved by https://github.com/linz/gazetteer/pull/145/commits/ead9c1b05eeb6ec06aa7101b2601903cf7af5094