Skip to content

Conversation

@wiki0831
Copy link
Contributor

Changes:

  • download from natural earth CDN via curl
  • perform conversion in makefile directly with ogr2ogr
  • custom conversion config, include property mapping, coord truncate, and makevalid options
  • update github actions
  • remove python, selenium, and Xvfb dependencies

Notes:
data update is not included in the commit, but will be triggered by Actions

@gradedSystem gradedSystem requested a review from Copilot April 10, 2025 09:29
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 4 out of 6 changed files in this pull request and generated 1 comment.

Files not reviewed (2)
  • Makefile: Language not supported
  • scripts/requirements.txt: Language not supported

@gradedSystem
Copy link
Member

LGTM!

@gradedSystem gradedSystem merged commit b03b13c into datasets:main Apr 10, 2025
1 check failed
@wiki0831
Copy link
Contributor Author

LGTM!

Thanks for the fast approval.

I'll add some comments for traceability.

@gradedSystem
Copy link
Member

You are welcome 👍!

if [ ! -f ne_10m_admin_0_countries.zip ]; then curl -L -o ne_10m_admin_0_countries.zip https://naciscdn.org/naturalearth/10m/cultural/ne_10m_admin_0_countries.zip; fi

data: download
ogr2ogr -f GeoJSON -makevalid -lco COORDINATE_PRECISION=6 -sql "SELECT admin as name, iso_a3 as \"ISO3166-1-Alpha-3\", iso_a2 as \"ISO3166-1-Alpha-2\" FROM ne_10m_admin_0_countries" data/countries.geojson /vsizip/ne_10m_admin_0_countries.zip
Copy link
Contributor Author

@wiki0831 wiki0831 Apr 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why makevalid

the original geojson from NaturalEarth contain invalid geometry features and this flag auto correct the invalid features.

also fixes:

example:
Screenshot 2025-04-10 at 2 27 09 AM (2)

Copy link
Contributor Author

@wiki0831 wiki0831 Apr 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why "COORDINATE_PRECISION=6"

source dataset from natural earth is at 10m res and 6 decimal place is sufficient

reducing to 6th decimal also reduces the file size.

re:

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.

2 participants