Coder Social home page Coder Social logo

Comments (5)

tgrippa avatar tgrippa commented on July 18, 2024

Hey @petrasovaa,

I tried a fix in commit 9bca4e0 that works on my computer. Also, I improved the manual page a bit. Could you check again on your side if it runs as expected ?

from grass-addons.

petrasovaa avatar petrasovaa commented on July 18, 2024

I tested the examples and yes, those work, thank you! In addition though I tested these (without the csvfile option):

r.zonal.classes zone_map=zipcodes raster=landuse96_28m vectormap=vect_output classes_list='4,12,1234' --o

resulting in

r.stats command finished...
Creating output vector map...
DBMI-SQLite driver error:
Error in sqlite3_prepare():
table rzonalclasses_tmp_vect_32080 has 19 columns but 18 values were supplied

DBMI-SQLite driver error:
Error in sqlite3_prepare():
table rzonalclasses_tmp_vect_32080 has 19 columns but 18 values were supplied

ERROR: Error while executing: 'INSERT INTO rzonalclasses_tmp_vect_32080
       VALUES
       (18,9e-05,0.11286,0.07422,0.00000,0.0231,0.00000,0.0549,0.00000,0.00000,0.05871,0.02337,0.00000,0.29982,0.35147,0.00146,0.00000,0.00000)'
Traceback (most recent call last):
  File "/home/anna/.grass7/addons/scripts/r.zonal.classes", line 316, in <module>
    main()
  File "/home/anna/.grass7/addons/scripts/r.zonal.classes", line 309, in main
    gscript.run_command('db.execute', input=insert_sql, quiet=True)
  File "/home/anna/dev/grass/grass/dist.x86_64-pc-linux-gnu/etc/python/grass/script/core.py", line 499, in run_command
    return handle_errors(returncode, result=None, args=args, kwargs=kwargs)
  File "/home/anna/dev/grass/grass/dist.x86_64-pc-linux-gnu/etc/python/grass/script/core.py", line 392, in handle_errors
    returncode=returncode)
grass.exceptions.CalledModuleError: Module run db.execute db.execute --q input=/home/anna/grassdata/nc_spm_08_grass7/anna/.tmp/pop-os/32080.1 ended with error

from grass-addons.

petrasovaa avatar petrasovaa commented on July 18, 2024

One more thing, the code is works only with Python3 due to:

with open(csvfile, 'w', newline='') as outfile:

newline is not in Python2. It's up to you if you care about that I guess.

from grass-addons.

tgrippa avatar tgrippa commented on July 18, 2024

The bug on INSERT sql statement is fixed now since 47ec9c7.
For the Python 2 compatibility, I guess it is relevant to keep it as now since it is not supported anymore.
Thanks for testing this add-on ;) If you consider the issue over, feel free to close the discussion...

from grass-addons.

petrasovaa avatar petrasovaa commented on July 18, 2024

Thank you!

from grass-addons.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.