I'm completely new to GeoDjango. I'm working through the tutorial for Django version 2.0, and I am encountering an error when I follow the steps in the GeoDjango section.
Specifically, when I attempt to slice a Layer object to extract Features, it gives me an error which looks like a possible bug. I'll go through the steps here.
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-12-a781c315deac> in <module>()
c:\projects\python\env\ENV3\lib\site-packages\django\contrib\gis\gdal\layer.py in __getitem__(self, index)
50 start, stop, stride = index.indices(self.num_feat)
---> 51 return [self._make_feature(fid) for fid in range(start, stop, stride)]
53 raise TypeError('Integers and slices may only be used when indexing OGR Layers.')
c:\projects\python\env\ENV3\lib\site-packages\django\contrib\gis\gdal\layer.py in <listcomp>(.0)
50 start, stop, stride = index.indices(self.num_feat)
---> 51 return [self._make_feature(fid) for fid in range(start, stop, stride)]
53 raise TypeError('Integers and slices may only be used when indexing OGR Layers.')
c:\projects\python\env\ENV3\lib\site-packages\django\contrib\gis\gdal\layer.py in _make_feature(self, feat_id)
89 # Should have returned a Feature, raise an IndexError.
---> 90 raise IndexError('Invalid feature id: %s.' % feat_id)
92 # #### Layer properties ####
IndexError: Invalid feature id: 0.