Can somebody help me with loading a dxf file as a vector layer with PyQGIS?
Is QgsDataSourceURI
an option? I've tried it with this code, but it didn't work.
fitxer="/tmp/prova.dxf"
uri = QgsDataSourceURI()
uri.setDatabase(fitxer)
uri.setDataSource('', 'entities', 'OGR_GEOMETRY', "OGR_GEOMETRY='POINT'", 'fid')
layer = QgsVectorLayer(uri.uri(), 'prova', 'ogr')
print 'isValid:', layer.isValid()
No comments:
Post a Comment