<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>GDAL_DATA is evaluated as the argument of fopen(), so if it is
relative, you need to be a current directory consistent with the
relative path for it to work. You'd generally want ot use an
absolute path for GDAL_DATA<br>
</p>
<p>I see that in pytest.ini a commented line with #GDAL_DATA =
../gdal/data. And autotest/conftest.py has logic to chdir() in the
directory where each test is run, and it happens our arborescence
of test is autotest/foo, so the value of ../gdal/data does not
work. It should rather be ../../gdal/data . We should probably fix
that line, but I'm wondering if it is a good idea to set it at all
in pytest.ini. A dev environment without GDAL_DATA set wouldn't be
functional outside of pytest. A nice improvement would be to
detect that we run from a dev environment and automatically figure
out the GDAL_DATA directory from that (qgis has some magic for
similar situation), but that might be fragile and need a bit of
rework if some day we use another build system :-)<br>
</p>
<div class="moz-cite-prefix">Le 26/04/2021 à 23:51, Andrew Bell a
écrit :<br>
</div>
<blockquote type="cite"
cite="mid:CACJ51z0zoFqAwVB1U96pHoV7-VQzwy_hrRWT=6qh7WZ8gJjgvA@mail.gmail.com">
<div dir="ltr">
<div dir="ltr"><br>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Mon, Apr 26, 2021 at
10:44 AM Even Rouault <<a
href="mailto:even.rouault@spatialys.com"
moz-do-not-send="true">even.rouault@spatialys.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote">
<div>
<p>DGN writing indeeds need GDAL_DATA to be set and point
to the directory that contains seed_2d.dgn</p>
</div>
</blockquote>
<div>Is it the case that GDAL_DATA is relative to the
directory containing the test rather than the test driver
directory (autotest)? Changing a relative path to an
absolute one allowed the seed file to be found. This seemed
strange because the provided pytest.ini contains a relative
path. Is there some other variable that sets the base path
to be used?</div>
<div><br>
</div>
<div>Thanks,</div>
</div>
<div><br>
</div>
-- <br>
<div dir="ltr" class="gmail_signature">Andrew Bell<br>
<a href="mailto:andrew.bell.ia@gmail.com" target="_blank"
moz-do-not-send="true">andrew.bell.ia@gmail.com</a></div>
</div>
</blockquote>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</body>
</html>