HughCraig / GHAP

2 stars 1 forks source link

Prepare Database for PostGIS functions #334

Open BillPascoe opened 10 months ago

BillPascoe commented 10 months ago

PostGIS work on a special datatype for lat, lng, not the usual one. Also most functions work on a 'geometry' type, and some on a 'geography' type. It's important to use the geography type where possible. See the STMetrics brief for more detail.

IanMcCrabb commented 10 months ago

Test performance on casting before we decide whether to maintain separate columns with triggers

BillPascoe commented 8 months ago

There is a note about performance testing. Since the functions are working I assume this has been done, but please send me a message confirming that we are using 'geography' type where possible, and whether we are using casting or storing the 'geometry' and 'geography' value in database columns. Make the note in here for the record.

MufengNiu commented 8 months ago

We are storing the 'geometry' and 'geography' values in database columns and setting up triggers for updates. For statistics, we are using geog where possible. Queries for using "geom" are only DBSCAN and Kmeans clustering.