def _sectionLineGeometry(self, item):
     if item and item.isValid():
         sln = ItemFeature(item, 'sln')
         request = sln.featureRequest()
         features = layers.getAllFeaturesRequest(request, self.collection('plan').layer('lines'))
         for feature in features:
             return QgsGeometry(feature.geometry())
     return QgsGeometry()
 def _getFeature(self, layer, item, category=''):
     req = None
     if category:
         sch = ItemFeature(item, 'sch')
         req = sch.featureRequest()
     else:
         req = item.featureRequest()
     try:
         return layer.getFeatures(req).next()
     except StopIteration:
         return None
     return None