[Qgis-developer] Spatialite "selection[0].geometry().asPoint()" (0, 0)

Jakob Lanstorp jlanstorp at gmail.com
Tue Jul 22 05:41:19 PDT 2014


When using a point shapefile I can get the point of geometry of a selected
feature. When using a point layer from a Spatialite DB I can not?

Shapefile:
>>> lyr = QgsMapLayerRegistry.instance().mapLayersByName('point_shape')[0]
>>> selection = lyr.selectedFeatures()
>>> selection[0].geometry().asPoint()
(535265,6.25118e+06)

Spatialite:
>>> lyr =
>>> QgsMapLayerRegistry.instance().mapLayersByName('point_spatialite')[0]
>>> selection = lyr.selectedFeatures()
>>> selection[0].geometry().asPoint()
(0,0)

Why the (0,0) when point layer is from a Spatialite DB? Using OSGEO4W QGIS
2.4.

Thanks,
Jakob



-----
Jakob Lanstorp
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Spatialite-selection-0-geometry-asPoint-0-0-tp5152456.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.


More information about the Qgis-developer mailing list