GDAL, ogr2ogr "Cannot find proj.db" Error

Yang JongHyun picture Yang JongHyun · Jun 26, 2019 · Viewed 7.4k times · Source

I've tried to extract certain country from the world shp file from natural earth.

I am currently using windows 10, so I installed python 3.7, gdal to use the ogr2ogr.

I typed the below code in the command to extract the south korea

ogr2ogr -f GeoJSON -where "geonunit='South Korea'" korea-geo.json ne_10m_admin_1_states_provinces.shp

But the below errors are coming out.

ERROR 1: PROJ: proj_create_from_wkt: Cannot find proj.db

ERROR 1: PROJ: proj_identify: Cannot find proj.db

I already set up the environmental variables for Gdal..

C:\Program Files\GDAL\gdal-data

C:\Program Files\GDAL\gdalplugins

Please guide me to solve this problem.

Answer

 mrHalfer  picture mrHalfer · Sep 9, 2019

Check your environment_variable:

setx GDAL_DATA "C:\Program Files\GDAL\gdal-data"

setx GDAL_DRIVER_PATH "C:\Program Files\GDAL\gdalplugins"

setx PROJ_LIB "C:\Program Files\GDAL\projlib"

setx PYTHONPATH "C:\Program Files\GDAL\"