jblindsay / whitebox-tools

An advanced geospatial data analysis platform
https://www.whiteboxgeo.com/
MIT License
966 stars 161 forks source link

VectorPolygonsToRaster issue #42

Closed mlavy closed 5 years ago

mlavy commented 5 years ago

Description

The whitebox tool "VectorPolygonsToRaster" return a different result compare to the Whitebox GAT -win tool "Vector polygons to raster" . The output .tif has gaps!!!

What I Did

from whitebox import WhiteboxTools

# Set up the environment
wbt = WhiteboxTools()
data_dir = "/../whitebox_issue"
wbt.work_dir = (data_dir) 

i_vector = "poly.shp"
fieldZ = "Value"
out_raster = "poly2raster_PYTHON.tif"

wbt.vector_polygons_to_raster(
    i=i_vector,
    output=out_raster,
    field=fieldZ,
    nodata=True,
    cell_size=1,
   # base=None,
   # callback=default_callback
)

Vector Polygons To Raster - GAT-win

poly2raster_GAT-win poly2raster_PYTHON

jblindsay commented 5 years ago

@mlavy Thank you for reporting this issue and for providing so much detail in describing the problem. I would ask that, if you are able to, would you mind sending me the file that you are trying to process so that I may perform testing and evaluation?

mlavy commented 5 years ago

Thank you Jhon for your quick reply, attached the file requested.

On Wed, Jul 24, 2019 at 5:01 PM John Lindsay notifications@github.com wrote:

@mlavy https://github.com/mlavy Thank you for reporting this issue and for providing so much detail in describing the problem. I would ask that, if you are able to, would you mind sending me the file that you are trying to process so that I may perform testing and evaluation?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jblindsay/whitebox-tools/issues/42?email_source=notifications&email_token=AMWMWHSWWYBB5X6EV4JEIMDQBBVFNA5CNFSM4IGQ56F2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2WTZXQ#issuecomment-514669790, or mute the thread https://github.com/notifications/unsubscribe-auth/AMWMWHQKVSZJSQINBPEQ34DQBBVFNANCNFSM4IGQ56FQ .

--

Muriel Lavy

e-mail: murielavy@g muriel.lavy@polito.itmail.com

Skype: muriel.lavy

jblindsay commented 5 years ago

@mlavy I don't believe you can attach to a Github issue like that. You may have to email me the file directly.

mlavy commented 5 years ago

should I use this email: jlindsay@uoguelph.ca

jblindsay commented 5 years ago

Yes, that will work well.

jblindsay commented 5 years ago

This should be fixed now in the v1.0.1 and so I am closing. Please feel free to re-open the issue if any further problems persist.

mlavy commented 5 years ago

Dear John, thanks for the update. Installing the whitebox python package with pip install, the WhiteboxTools version installed along with whitebox 1.0.0 is WhiteboxTools v1.0.0, and not the v1.0.1 I would need this installation in server, so it would be better to have it automatically uploaded in the whitebox. Is that possible? Thank you, Muriel

On Sun, Oct 20, 2019 at 4:45 PM John Lindsay notifications@github.com wrote:

Closed #42 https://github.com/jblindsay/whitebox-tools/issues/42.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jblindsay/whitebox-tools/issues/42?email_source=notifications&email_token=AMWMWHXM2YFZGDR675JGMLDQPRVHHA5CNFSM4IGQ56F2YY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOUKKWEVI#event-2727699029, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMWMWHS4VD42TBJRHJVAHWTQPRVHHANCNFSM4IGQ56FQ .

--

Muriel Lavy

e-mail: murielavy@g muriel.lavy@polito.itmail.com

Skype: muriel.lavy

giswqs commented 5 years ago

@mlavy I am working on it. Stay tuned.

giswqs commented 5 years ago

@mlavy The pip package has been updated. https://pypi.org/project/whitebox/

mlavy commented 5 years ago

Thank you :)

On Mon, Oct 21, 2019 at 3:03 PM Qiusheng Wu notifications@github.com wrote:

@mlavy https://github.com/mlavy The pip package has been updated. https://pypi.org/project/whitebox/

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jblindsay/whitebox-tools/issues/42?email_source=notifications&email_token=AMWMWHRUPD47CAPPTR3NVPTQPWSCDA5CNFSM4IGQ56F2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEB2HWKA#issuecomment-544504616, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMWMWHTCX37MP4BKF57DYYTQPWSCDANCNFSM4IGQ56FQ .

--

Muriel Lavy

e-mail: murielavy@g muriel.lavy@polito.itmail.com

Skype: muriel.lavy

jblindsay commented 5 years ago

@giswqs Thanks once again Qiusheng for being so incredibly responsive.

mlavy commented 5 years ago

Dear all, I had no results running the vector_polygons_to_raster python tools. the error received is:

thread 'main' panicked at 'index out of bounds: the len is 1 but the index is 1', /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54\src\libcore\slice\mod.rs:2715:10note: run with RUST_BACKTRACE=1 environment variable to display a backtrace.

I am not sure if this is imputable to the WhiteboxTools package or the Whitebox Thanks for your support by far Muriel

On Mon, Oct 21, 2019 at 3:18 PM John Lindsay notifications@github.com wrote:

@giswqs https://github.com/giswqs Thanks once again Qiusheng for being so incredibly responsive.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jblindsay/whitebox-tools/issues/42?email_source=notifications&email_token=AMWMWHWKEJSH3XVMAMH2RYDQPWTY3A5CNFSM4IGQ56F2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEB2JCKI#issuecomment-544510249, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMWMWHXF4T4OPOLHZMKWOTDQPWTY3ANCNFSM4IGQ56FQ .

--

Muriel Lavy

e-mail: murielavy@g muriel.lavy@polito.itmail.com

Skype: muriel.lavy

jblindsay commented 5 years ago

@mlavy This was the result of an issue with my latest attempt to fix the --flag=False issue that plagued the QGIS front end. This fix ended up breaking non-QGIS front ends with optional flags, for which --flag indicates --flag=True. Anyhow, I've just now committed a series of changes that should fix this 'len is 1 but the index is 1' error. It would otherwise occur quite commonly for any tool with a Boolean flag.