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

Update GeoAlchemy #19

Closed SPlanzer closed 5 years ago

SPlanzer commented 5 years ago

Releate to #18

The read me found in /.../gazetteer/src/NZGBplugin/geoalchemy states; " Note this is currently using the "old" version of geoalchemy."

Which version does the current QGIS2 release use?

I assume this is not compatible with python3/QGIS3. Thus update and port the NZGB plugin to use a python3 compatible geoalchemy version

SPlanzer commented 5 years ago

The GeoAlchemy project is split across two repos / projects:

There is little info about compatibility however I note the geoalchemy travis config only tests Python2.7 While the geoalchemy2 travis config test2 2.7/3.4/3.5. QGIS3 is running python3.5

Based on this I will port the NZGB plugin to QGIS3 using GeoAlchemy2 (0.5.0)

SPlanzer commented 5 years ago

The versions are significantly different

geoalchemy2

dir(geoalchemy2)
['ArgumentError', 'Geography', 'Geometry', 'Raster', 'RasterElement', 'Table', 
'WKBElement', 'WKTElement', '__builtins__', '__cached__', '__doc__', '__file__',
 '__loader__', '__name__', '__package__', '__path__', '__spec__',
'_setup_ddl_event_listeners', 'comparator', 'compat', 'elements', 'event', 'exc',
 'expression', 'func', 'functions', 'select', 'types']

geoalchemy

>>> dir(geoalchemy)
['Alias', 'AttributeExtension', 'BaseFunction', 'Column', 'ColumnClause',
 'ColumnProperty',  'Curve', 'DBSpatialElement', 'DialectManager', 'Geometry',
 'GeometryBase',  'GeometryCollection', 'GeometryColumn', 'GeometryDDL', 
'GeometryExtensionColumn',  'LineString', 'MultiLineString', 'MultiPoint',
 'MultiPolygon',  'PGDialect',  'PersistentSpatialElement',  'Point', 'Polygon',
 'RawColumn', 'SpatialAttribute', 'SpatialComparator', 'SpatialElement', 'Table', 
'UserDefinedType', 'WKBSpatialElement', 'WKTSpatialElement', '__builtins__', 
'__doc__', '__file__', '__name__', '__package__', '__path__', 'base', 'column_property',
 'compile_column', 'compiles', 'dialect', 'exc', 'expression', 'from_wkt', 'functions', 
'geometry',  'literal', 'not_', 'utils', 'warnings']
SPlanzer commented 5 years ago

Model.py import geoalchemy as ga >> import geoalchemy2 as ga from geoalchemy.postgis import PGComparator > from geoalchemy2 import comparator

palmerj commented 5 years ago

Hi @SPlanzer it might pay to have a quick chat with @ccrook about the geoalchemy usage. From my memory back when Chris implemented the plugin there was some issue that caused him to use the old version at the time. It might be resolved now, but can't hurt to ask.

SPlanzer commented 5 years ago

upgrade and testing done against GeoAlchemy2 0.5.0

Note more testing required. See #22