<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">I am building GDAL 3.0.4 on Windows. GDAL 3.0.4 depends on PROJ. I have chosen PROJ 7.0.0, which depends on Curl, Libtiff, and Sqlite.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I have successfully built all of the dependencies as shared libraries from source. The final output is a GDAL devinstall Release build, which I install to ...\gdal_304_devinstall.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I am able to call GDAL executables in gdal_304_devinstall\bin (ogrinfo.exe, gdalinfo, etc.), and I am also able to call the C++ API using files in gdal_304_devinstall\lib and gdal_304_devinstall\include.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">As a test of functionality, I am doing a transformation of a shapefile from EPSG 4326 to EPSG 3857. This task succeeds when I do it through the C++ API. However, it fails when I try to use the command line:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">    D:\shapefiles>PATH=%PATH%;C:\Users\[USER]\bin\gdal\gdal_304_install\bin<o:p></o:p></p>
<p class="MsoNormal">    D:\shapefiles>set GDAL_DATA=C:\Users\[USER]\bin\gdal\gdal_304_install\data<o:p></o:p></p>
<p class="MsoNormal">    D:\shapefiles>set PROJ_LIB=C:\Users\[USER]\bin\proj\proj-7.0.0\inst\share\proj # (contains proj.db)<o:p></o:p></p>
<p class="MsoNormal">    D:\shapefiles>ogr2ogr -s_srs EPSG:4326 -t_srs EPSG:3857 foobar.shp input.shp<o:p></o:p></p>
<p class="MsoNormal">    ERROR 4: Unable to open EPSG support file gcs.csv.  Try setting the GDAL_DATA environment variable to point to the directory containing EPSG csv files.<o:p></o:p></p>
<p class="MsoNormal">    ERROR 1: Failed to process SRS definition: EPSG:3857<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I am pretty confused by this. First, I did not expect GDAL to look for a .csv. I thought these were deprecated when GDAL took PROJ as a build dependency. https://github.com/OSGeo/gdal/blob/v3.0.4/gdal/NEWS, "Implement RFC 73".<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Second, I am not sure how the transformation succeeds when using the C++ API but not when using the command line. I have informed my C++ program about the location of proj_7_0.dll, but not about the location of proj.db, so I am not sure
 how it knows how to do the transform. Does it have something to do with the INCLUDE_OGR_FRMTS flag in makefile.vc? I have built GDAL with that both on and off, doesn't seem to fix command line.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Third, and this is odd, if I point GDAL_DATA to the data dir for a much older version of GDAL (2.0.4, which I downloaded precompiled), the command line works! I assume this is some kind of backwards compatibility kicking in.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Finally, as a last resort, I redid the build process using PROJ 6.3.1, but got exactly the same behavior.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Any clues? I don't have a good sense for how the EPSG transform data should be propagated in a modern GDAL build.<o:p></o:p></p>
</div>
</body>
</html>