Skip to main content
added 394 characters in body
Source Link

I have a table in Memory from a cx_Oracle query (a list of rows, and a list of field names and their types) in my python plugin and I want to load it as a geometry-less layer (Attribute table) in qgis. Which data Provider will Support that?

QgsOracleProvider has a constructor that Returns false, disconnects and sets valid to False if the table queried has no geometry column.

QgsMemoryProvider only allows Point, Linestring, Multipoint, MultilineString, and Multipolygon geometries. Any other geometry is interpreted as WKBUnknown, which causes the QgsMemoryProvider.isValid() to return False. If I cheat and create a QgsVectorLayer("Point", "myLayerName", "memory"), and add features with no geometries, then I get a seg fault when I add the layer to the map layer registry. Also important to note, is that when a layer is imported using QgsMemoryProvider, it is not possible to Join against it (A Join from the layer does work.) Since mostly people want to load non-geometric tables into Qgis in order to join them to an existing vector, this reduces the Memory provider's suitability for non geometric tables. (Unless I am wrong. I would be delighted to be wrong.)

QgsDelimitedTextProvider requires an Input file, and I would much rather not write out a csv to the file and then Import it again when I already have the data. But maybe I have to?

Thanks

I have a table in Memory from a cx_Oracle query (a list of rows, and a list of field names and their types) in my python plugin and I want to load it as a geometry-less layer (Attribute table) in qgis. Which data Provider will Support that?

QgsOracleProvider has a constructor that Returns false, disconnects and sets valid to False if the table queried has no geometry column.

QgsMemoryProvider only allows Point, Linestring, Multipoint, MultilineString, and Multipolygon geometries. Any other geometry is interpreted as WKBUnknown, which causes the QgsMemoryProvider.isValid() to return False. If I cheat and create a QgsVectorLayer("Point", "myLayerName", "memory"), and add features with no geometries, then I get a seg fault when I add the layer to the map layer registry.

QgsDelimitedTextProvider requires an Input file, and I would much rather not write out a csv to the file and then Import it again when I already have the data. But maybe I have to?

Thanks

I have a table in Memory from a cx_Oracle query (a list of rows, and a list of field names and their types) in my python plugin and I want to load it as a geometry-less layer (Attribute table) in qgis. Which data Provider will Support that?

QgsOracleProvider has a constructor that Returns false, disconnects and sets valid to False if the table queried has no geometry column.

QgsMemoryProvider only allows Point, Linestring, Multipoint, MultilineString, and Multipolygon geometries. Any other geometry is interpreted as WKBUnknown, which causes the QgsMemoryProvider.isValid() to return False. If I cheat and create a QgsVectorLayer("Point", "myLayerName", "memory"), and add features with no geometries, then I get a seg fault when I add the layer to the map layer registry. Also important to note, is that when a layer is imported using QgsMemoryProvider, it is not possible to Join against it (A Join from the layer does work.) Since mostly people want to load non-geometric tables into Qgis in order to join them to an existing vector, this reduces the Memory provider's suitability for non geometric tables. (Unless I am wrong. I would be delighted to be wrong.)

QgsDelimitedTextProvider requires an Input file, and I would much rather not write out a csv to the file and then Import it again when I already have the data. But maybe I have to?

Thanks

edited title
Link
underdark
  • 84.5k
  • 22
  • 233
  • 415

Qgis Python: Which data providers support loading attribute tables without geometry?

added 164 characters in body
Source Link

I have a table in memoryMemory from a cx_Oracle query (a list of rows, and a list of field names and their types) in my python plugin and I want to load it as a geometry-less layer (Attribute table) in qgis. Which data Provider will Support that?

QgsOracleProvider has a constructor that Returns false, disconnects and sets valid to False if the table queried has no geometry column.

QgsMemoryProvider only allows Point, Linestring, Multipoint, MultilineString, and Multipolygon geometries. Any other geometry is interpreted as WKBUnknown, which causes the QgsMemoryProvider.isValid() to return False. If I cheat and create a QgsVectorLayer("Point", "myLayerName", "memory"), and add features with no geometries, then I get a seg fault when I add the layer to the map layer registry.

QgsDelimitedTextProvider requires an Input file, and I would much rather not write out a csv to the file and then Import it again when I already have the data. But maybe I have to?

Thanks

I have a table in memory (a list of rows, and a list of field names and their types) in my python plugin and I want to load it as a geometry-less layer (Attribute table) in qgis. Which data Provider will Support that?

QgsMemoryProvider only allows Point, Linestring, Multipoint, MultilineString, and Multipolygon geometries. Any other geometry is interpreted as WKBUnknown, which causes the QgsMemoryProvider.isValid() to return False. If I cheat and create a QgsVectorLayer("Point", "myLayerName", "memory"), and add features with no geometries, then I get a seg fault when I add the layer to the map layer registry.

QgsDelimitedTextProvider requires an Input file, and I would much rather not write out a csv to the file and then Import it again when I already have the data. But maybe I have to?

Thanks

I have a table in Memory from a cx_Oracle query (a list of rows, and a list of field names and their types) in my python plugin and I want to load it as a geometry-less layer (Attribute table) in qgis. Which data Provider will Support that?

QgsOracleProvider has a constructor that Returns false, disconnects and sets valid to False if the table queried has no geometry column.

QgsMemoryProvider only allows Point, Linestring, Multipoint, MultilineString, and Multipolygon geometries. Any other geometry is interpreted as WKBUnknown, which causes the QgsMemoryProvider.isValid() to return False. If I cheat and create a QgsVectorLayer("Point", "myLayerName", "memory"), and add features with no geometries, then I get a seg fault when I add the layer to the map layer registry.

QgsDelimitedTextProvider requires an Input file, and I would much rather not write out a csv to the file and then Import it again when I already have the data. But maybe I have to?

Thanks

added 455 characters in body
Source Link
Loading
Source Link
Loading