opengeos / whitebox-python

WhiteboxTools Python Frontend

Home Page:https://pypi.org/project/whitebox/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

a bug in func (raster_to_vector_lines)

SonwYang opened this issue · comments

commented

Description

Hello! Mr.WU. When I turn a single pixel wide raster into a line vector, the previously continuous closed shape becomes a broken line segment. How to avoid this problem?

code

from WBT.whitebox_tools import WhiteboxTools

if __name__ == "__main__":
    rasterPath = "/home/BE/results/cq_test_edge.tif"
    outputPath = "/home/BE/results/cq_test_edge4.shp"
    wbt = WhiteboxTools()

    wbt.raster_to_vector_lines(rasterPath, outputPath)

image

I'm afraid that this is expected behaviour given the algorithm used for line vectorization in the tool. This behaviour cannot be modified without swapping out the algorithm for another, which would mean a tool re-write.

commented

@jblindsay Hello! Do you know another algorithm used for line vectorization in addition to arcpy?

Closing this issue for now as it is related to the WhiteboxTools backend rather than the frontend.