The GPX rendering code checks the count of routes found in a GPX file, and only creates a route layer if the count is non-zero.
There are GPX files that only contain an empty tag. This is counted as a valid, though empty, route by the Python gpxparse library, but leads to a
Cannot determine extent for layer 'routes'
error being thrown by the OGR plugin.
So the code that determines whether the route layer should be enabled for a given GPX file should check for the count of non-empty routes being non-zero, not just for the total route count.
The GPX rendering code checks the count of routes found in a GPX file, and only creates a route layer if the count is non-zero.
There are GPX files that only contain an empty tag. This is counted as a valid, though empty, route by the Python gpxparse library, but leads to a
Cannot determine extent for layer 'routes'
error being thrown by the OGR plugin.
So the code that determines whether the route layer should be enabled for a given GPX file should check for the count of non-empty routes being non-zero, not just for the total route count.