Toblerity/Fiona — pull request #190 by jwass (2014-11-21 04:30:05+00:00)
Title: Fix reading layers that don't support feature counts

This re-enables reading layers for which OGR can't provide a feature count - it fixes reading GPX files.

For some layers/drivers, OGR can't provide a feature count and returns -1 from `ograpi.OGR_L_GetFeatureCount`. Using Fiona to read any of those would raise `RuntimeError` with "Layer does not support counting".

The commit does 2 things:
* Only raise `RuntimeError` on negative start/stop indices, since the count is needed to compute the correct index.
* Raise `TypeError` in `__len__` if the feature count can't be provided.
This enables `list(fiona.open(...))` on these layers. Without it, `__len__` returned -1, which caused Python to raise `ValueError`, which then caused `list` to fail.

Also includes some tests and a test GPX file.