Skip to content

Commit 1706798

Browse files
committed
Updated Layer.cursor() to take hints argument.
1 parent d744f3e commit 1706798

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

geoscript/layer/layer.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from org.geoscript.util import CollectionDelegatingFeatureSource
1313
from org.geotools.data import FeatureSource, FeatureStore
1414
from org.geotools.data import DefaultQuery, Query, Transaction
15-
from org.geotools.factory import CommonFactoryFinder
15+
from org.geotools.factory import CommonFactoryFinder, Hints
1616
from org.geotools.feature import FeatureCollection, FeatureCollections
1717
from org.opengis.filter.sort import SortOrder
1818

@@ -220,7 +220,7 @@ def features(self, filter=None, transform=None, sort=None):
220220

221221
c.close()
222222

223-
def cursor(self, filter=None, sort=None):
223+
def cursor(self, filter=None, sort=None, hints=None):
224224
"""
225225
Returns a :class:`Cursor <geoscript.layer.cursor.Cursor>` over the features of the layer.
226226
@@ -273,6 +273,9 @@ def cursor(self, filter=None, sort=None):
273273
if self.proj:
274274
q.coordinateSystem = self.proj._crs
275275

276+
if hints is not None:
277+
q.setHints(Hints(hints))
278+
276279
fcol = self._source.getFeatures(q)
277280
#r = self._source.dataStore.getFeatureReader(q,Transaction.AUTO_COMMIT)
278281
return Cursor(fcol, self)

0 commit comments

Comments
 (0)