New answers tagged


You have to replace layer1.type() == QgsVectorLayer() by layer1.type() == 0 You can execute the following code in the Python console in order to try and check the result expected : my_comb = QComboBox() my_comb.clear() layers = QgsProject.instance().layerTreeRoot().layerOrder() layer_list = [] for layer1 in layers: if layer1.type() == 0: # 0 if it is a ...


Why not use the function defined in Mike T's answer from the post you linked to? def redistribute_vertices(geom, distance): if geom.geom_type == 'LineString': num_vert = int(round(geom.length / distance)) if num_vert == 0: num_vert = 1 return LineString( [geom.interpolate(float(n) / num_vert, normalized=...


I needed to pass the type_ kwarg to the function ST_Union. E.g. merged = session.query(func.ST_Union(RasterData.raster, type_=Raster)).all() Thanks to the developers of Geoalchemy2 who pointed this out. Example shown in their gallery: Reproject A Raster using ST_Transform usage on Line 54

Top 50 recent answers are included