[gdal-dev] Test Data

Even Rouault even.rouault at spatialys.com
Mon Apr 26 07:44:37 PDT 2021


DGN writing indeeds need GDAL_DATA to be set and point to the directory 
that contains seed_2d.dgn

You can source scripts/setdevenv.sh to set the appropriate environment 
variables for a dev env.

Le 26/04/2021 à 16:38, Andrew Bell a écrit :
>
>
> On Mon, Apr 26, 2021 at 10:18 AM Even Rouault 
> <even.rouault at spatialys.com <mailto:even.rouault at spatialys.com>> wrote:
>
>     Andrew,
>
>     you don't need to add autotest/ogr to GDAL_DATA.
>
>     Normally this is done in autotest/pytest.ini
>
> Thanks. I missed that.
>
>     I suspect you don't have the pytest-env python module installed.
>
>     You should probably just run:
>
>     pip3 install -U -r autotest/requirements.txt
>
> I'm using conda and pip often interacts badly with it, so I've just 
> been using conda.
>
> I'm still getting an error that *seems* as if it might be related to 
> finding test data. Is there any setting/variable I might still need to 
> check?
>
> ___________________________________________ test_ogr_dgn_7 
> ___________________________________________
>
>     def test_ogr_dgn_7():
>
>         co_opts = ['UOR_PER_SUB_UNIT=100', 
> 'SUB_UNITS_PER_MASTER_UNIT=100',
>                    'ORIGIN=-50,-50,0']
>
>         dgn2_ds = 
> ogr.GetDriverByName('DGN').CreateDataSource('tmp/dgn7.dgn',
>   options=co_opts)
>
>         dgn2_lyr = dgn2_ds.CreateLayer('elements')
>
>         dgn_ds = ogr.Open('data/dgn/smalltest.dgn')
>         dgn_lyr = dgn_ds.GetLayer(0)
>
> >       dst_feat = ogr.Feature(feature_def=dgn2_lyr.GetLayerDefn())
> E       AttributeError: 'NoneType' object has no attribute 'GetLayerDefn'
>
> Thanks,
>
> -- 
> Andrew Bell
> andrew.bell.ia at gmail.com <mailto:andrew.bell.ia at gmail.com>

-- 
http://www.spatialys.com
My software is free, but my time generally not.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20210426/795982a4/attachment-0001.html>


More information about the gdal-dev mailing list