Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jgomezdans/bb81152d37cf0b5eb3d3fb9c60203bca to your computer and use it in GitHub Desktop.
Save jgomezdans/bb81152d37cf0b5eb3d3fb9c60203bca to your computer and use it in GitHub Desktop.
Point in polygon SQL sqlite
ogr2ogr -f "GeoJSON" YieldsProvince.geojson CountyYield2000_2018.csv \
-dialect "sqlite" \
-sql "select adm.ADM1_EN, adm.ADM2_EN, yield.* " \
"from CountyYield2000_2018 as yield, 'chn_admbnda_adm2_ocha_2020.shp'.chn_admbnda_adm2_ocha_2020 adm" \
"where ST_contains(adm.geometry, yield.geometry)" \
-oo X_POSSIBLE_NAMES=field_4 -oo Y_POSSIBLE_NAMES=field_5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment