OGR GeoJSON layer name changes with GDAL 2.2 or later, breaking BridjOGRDataStoreTest

Description

With GDAL 2.2 or later, the layer name of a GeoJSON datasource is set to the name member of the FeatureCollection, if it exists:
http://www.gdal.org/drv_geojson.html

Previous versions of GDAL set the layer name to OGRGeoJSON.

This change breaks (for example) BridjOGRDataStoreTest.testAttributesWritingGeoJSON, which expects the old name OGRGeoJSON, not the new name junk set under GDAL 2.2:

Solution is for the test to use the layer name that is found, not hard-code the old one.

Users should take note that OGR GeoJSON layer names may depend on the version of GDAL installed on their platforms.

Environment

None

Assignee

Ben Caradoc-Davies

Reporter

Ben Caradoc-Davies

Triage

None

Components

Fix versions

Affects versions

Priority

Medium
Configure