Skip to content

#167: Patch GIS province data for Da Nang and Khanh Hoa - #174

Merged
thanglequoc merged 8 commits into
masterfrom
167_PatchGISProvinceData
Jul 12, 2026
Merged

#167: Patch GIS province data for Da Nang and Khanh Hoa#174
thanglequoc merged 8 commits into
masterfrom
167_PatchGISProvinceData

Conversation

@thanglequoc

Copy link
Copy Markdown
Owner
  • Apply the manual patch GIS province data for Da Nang and Khanh Hoa to include Spratly and Paracel Islands
  • The patching is handle by using the ST_Union function in Postgis to combine the existing GIS province data and the GIS ward of the islands

Merge Hoàng Sa (20333) → Da Nang (48) and Trường Sa (22736) → Khanh Hoa (56)
ward-level geometries into their parent province geometries. This fixes an
upstream GIS data defect where province-level API responses from
sapnhap.bando.com.vn exclude island territories that are present at the ward
level.

Changes:
- sapnhap.go: add PatchIslandProvincesGeometry + mergeWardGeometryIntoProvince
  methods using inline SQL with ST_Union and ST_Envelope
- sapnhap_bando.go: add exported PatchIslandProvincesGeometry() entry point
  wired into the generation flow after FetchGISDataFromSapNhapBando()
- main.go: integrate patch step before GenerateGISSQLDatasets()
- sapnhap_test.go: add integration test stub for the patch

After the patch, province geometries spatially contain all administrative
subdivisions, including the Paracel and Spratly Islands.
@thanglequoc thanglequoc self-assigned this Jul 12, 2026
@thanglequoc

Copy link
Copy Markdown
Owner Author

Fix verified:

Da Nang GIS province
image

Khanh Hoa GIS province
image

@thanglequoc
thanglequoc merged commit 085411c into master Jul 12, 2026
1 check passed
@thanglequoc
thanglequoc deleted the 167_PatchGISProvinceData branch July 12, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant