OpenDRR / boundaries

Boundary geometries for model results in Geopackage format.
Other
0 stars 5 forks source link

Update CDUID #11

Closed wkhchow closed 3 years ago

wkhchow commented 3 years ago

updated - geometry_cduid updated - opendrr-boundaries.sql (created backup sql from pgadmin, boundaries schema (line 51 to 63 in add_data.sh)

wkhchow commented 3 years ago

Closing this PR for now. Need to investigate some anomalies and make adjustments if needed.

wkhchow commented 3 years ago
anthonyfok commented 3 years ago

updated all geometries, geometry repair, reprojected source data to default 4326 if needed in source geopackage. This original repair / reproject was done during the database creation but I think this should be initially done at the source and no need to repair/reproject during the ogr2ogr import into db.

Thank you @wkhchow! You are referring to the ogr2ogr -t_srs EPSG:4326 parameter that is used for reprojection, right? I am really new to this, so I had been wondering what that was all about. Thank you for doing that reprojection from the source. :+1:

(I think we will keep the -t_srs EPSG:4326 in add_data.sh just to be safe. I suspect ogr2ogr wouldn't detect that the source SRS and target SRS are the same and wouldn't do reprojection/transformation.)

It is good that you have included a copy of generated opendrr-boundaries.sql included too, which will help me out verifying whether the database dump generated by experimental GitHub action in #12 is correct or not.

Looks good to me on my end. Thank you!

wkhchow commented 3 years ago

@anthonyfok yes ogr2ogr will just leave the projection if its already in the same projection so it can be kept as is in add_data.sh The repair geometry done during the boundary import takes a few minutes each time so I figured it is best to fix at the source for all geometries and remove that code to repair the geometry in sql. Should save a few minutes each time it is built. Also if end users ended up downloading the source geometry data on their own it would be the same as in the db as is.

The repair geometry sql part is coded out in the new branch of model factory. https://github.com/OpenDRR/model-factory/blob/update_sovi_hazthreat_feb2021/scripts/Update_boundaries_SAUID_table.sql Once that is ready to be merged to master. We can do the same with boundaries.

anthonyfok commented 3 years ago

@wkhchow Thank you for the notes! Very helpful in helping me understand how everything fits together. Would you like Joost or I to merge this PR? Or will you be doing the merging, pending corresponding change(s) to add_data.sh, if any?

wkhchow commented 3 years ago

@anthonyfok , lets hold off for now until the new model-factory branch is ready to be pulled to master. I will do the merge PR when the time comes.