[GRASS-dev] Re: [GRASS GIS] #1345: backport ctypes to relbr64
#1345: backport ctypes to relbr64 ---+ Reporter: hamish | Owner: grass-dev@… Type: task | Status: new Priority: major | Milestone: 6.4.2 Component: Python ctypes | Version: svn-releasebranch64 Keywords: |Platform: All Cpu: All| ---+ Comment(by martinl): Replying to [ticket:1345 hamish]: (Although in 6.x-stable I'd totally oppose replacing the existing shell scripts/ with their many many years of testing stabilization) my opinion is different as I mentioned earlier, you are right that bash scripts could be more stable than their python version. Anyway we are discovering new and new bugs in bash scripts (which is normal), some of them are hard to fix, see e.g. #1310. Unfortunately most of them are quite critical. Some of them are remaining open, generally speaking maintaining bash scripts for winGRASS is a big pain. Bearing in mind our man power in GRASS developer team I think it would be better solution to replace bash scripts by python in devbr6. Fix bugs which has been introduced during conversion from Bash script (which is easy). Make them solid and working on Windows. And later to backported them to relbr64. It's just my opinion. I would be happy to hear also other devs from the community. -- Ticket URL: https://trac.osgeo.org/grass/ticket/1345#comment:1 GRASS GIS http://grass.osgeo.org ___ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev
[GRASS-dev] GRASS Python Ctypes: Write Raster produces No null file error!!
Dear List Users, Please help me solve the following, I am entirely new to the whole Python-GRASS-Ctypes issue so please bear with me. I am trying to develop an application using Python Ctypes hooks to GRASS C libraries. Have done most of the part but getting stuck in the end where i try to write off my output file as GRASS raster. I am giving the relevant part below along with the error I am getting: ptype = POINTER(c_float) MA.resize(bands,rows,cols) for b in range(bands): ofn = madresult. + str(b) out_fd = Rast_open_new(ofn,FCELL_TYPE) if out_fd 0: G_fatal_error(Unable to create raster map %s, ofn) out_rast = Rast_allocate_buf(FCELL_TYPE) out_rast = cast(c_void_p(out_rast), ptype) for row_n in range(rows): for col_n in range(cols): if math.isnan(MA[b,row_n,col_n]): Rast_set_null_value(out_rast[col_n],1,FCELL_TYPE) else: out_rast[col_n] = MA[b,row_n,col_n] Rast_put_row(out_fd,out_rast,FCELL_TYPE) G_free(out_rast) Rast_close(out_fd) where MA is a numpy.ndarray, bands, rows and cols are all integer type variables and are self explanatory i believe. When it comes to executing the line Rast_close(out_fd) I am getting the error: ERROR: No null file for madresult.0 How do I write the null file? I have some experience in developing GRASS raster modules in C and there I never had to write any null file explicitly so whats going wrong over here? Any help from all you GRASS pioneers will be deeply appreciated. ___ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev
[GRASS-dev] Re: GRASS Python Ctypes: Write Raster produces No null file error!!
Folks On close observation made some changes to the fragment of code below on the suspicion that I was not setting null values correctly or passing pointers right so the modified code is now given below but still I get the same error of: ERROR: No null file for madresult.0 Please give me some suggestions as I have a deadline approaching. Modified code: MA.resize(bands,rows,cols) for b in range(bands): ofn = madresult. + str(b) out_fd = Rast_open_new(ofn,DCELL_TYPE) if out_fd 0: grass.fatal(_(Unable to create raster map %s) % ofn) out_rast = Rast_allocate_d_buf() #out_rast = cast(c_void_p(out_rast), ptype) for row_n in range(rows): for col_n in range(cols): #if math.isnan(MAD[b,row_n,col_n]): if (Rast_is_d_null_value(pointer(c_double(MAD[b,row_n,col_n]: Rast_set_d_null_value(pointer(c_double(out_rast[col_n])),1) else: out_rast[col_n] = MA[b,row_n,col_n] Rast_put_row(out_fd,out_rast,DCELL_TYPE) G_free(out_rast) Rast_close(out_fd) Humble regards On Apr 11, 2011, at 8:25 AM, Sudipta Sarkar wrote: Dear List Users, Please help me solve the following, I am entirely new to the whole Python-GRASS-Ctypes issue so please bear with me. I am trying to develop an application using Python Ctypes hooks to GRASS C libraries. Have done most of the part but getting stuck in the end where i try to write off my output file as GRASS raster. I am giving the relevant part below along with the error I am getting: ptype = POINTER(c_float) MA.resize(bands,rows,cols) for b in range(bands): ofn = madresult. + str(b) out_fd = Rast_open_new(ofn,FCELL_TYPE) if out_fd 0: G_fatal_error(Unable to create raster map %s, ofn) out_rast = Rast_allocate_buf(FCELL_TYPE) out_rast = cast(c_void_p(out_rast), ptype) for row_n in range(rows): for col_n in range(cols): if math.isnan(MA[b,row_n,col_n]): Rast_set_null_value(out_rast[col_n],1,FCELL_TYPE) else: out_rast[col_n] = MA[b,row_n,col_n] Rast_put_row(out_fd,out_rast,FCELL_TYPE) G_free(out_rast) Rast_close(out_fd) where MA is a numpy.ndarray, bands, rows and cols are all integer type variables and are self explanatory i believe. When it comes to executing the line Rast_close(out_fd) I am getting the error: ERROR: No null file for madresult.0 How do I write the null file? I have some experience in developing GRASS raster modules in C and there I never had to write any null file explicitly so whats going wrong over here? Any help from all you GRASS pioneers will be deeply appreciated. ___ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] Release 6.4.1
Hi all, On Tue, Apr 5, 2011 at 4:30 PM, Martin Landa landa.mar...@gmail.com wrote: Hi, 2011/4/1 Markus Neteler nete...@osgeo.org: dear GRASS devs, I would vote for releasing 6.4.1 within few days, max. one week. RC2 has been released in March 17, some bugs has been fixed since RC2. Currently we have two blockers [1], both going to be closed. I am +1 on this. perfect, currently we are waiting only for one blocker [1]. Martin [1] http://trac.osgeo.org/grass/ticket/1335 ... fixed, so time to release 6.4.1! Markus ___ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] GRASS Python Ctypes: Write Raster produces No null file error!!
Sudipta Sarkar wrote: Please help me solve the following, I am entirely new to the whole Python-GRASS-Ctypes issue so please bear with me. I am trying to develop an application using Python Ctypes hooks to GRASS C libraries. Have done most of the part but getting stuck in the end where i try to write off my output file as GRASS raster. I am giving the relevant part below along with the error I am getting: When it comes to executing the line Rast_close(out_fd) I am getting the error: ERROR: No null file for madresult.0 The problem occurs because the script writes fewer rows to the file than it should. The raster library attempts to deal with this by padding the file with zeros, but there's a bug in the code (it has already closed the null file at the point where it tries to write the additional rows; that's what the error message is reporting). Even if we fix the bug in the raster library, the fact that you aren't writing the correct number of rows suggests that there's a bug in the script. If you're reading or writing rasters using a modified window (region), note that the window handling has changed significantly between 6.x and 7.0 (in particular, 7.0 has separate windows for input and output). -- Glynn Clements gl...@gclements.plus.com ___ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev
[GRASS-dev] Re: [GRASS GIS] #436: access to python swig bindingsa from outside of a grass session
#436: access to python swig bindingsa from outside of a grass session --+- Reporter: mulligan | Owner: grass-dev@… Type: enhancement | Status: closed Priority: major| Milestone: 6.4.0 Component: Python | Version: svn-develbranch6 Resolution: wontfix |Keywords: python, SWIG, session Platform: Linux| Cpu: x86-32 --+- Changes (by hamish): * status: new = closed * resolution: = wontfix Comment: SWIG support is removed, try ctypes in devel versions of GRASS instead. Hamish -- Ticket URL: https://trac.osgeo.org/grass/ticket/436#comment:3 GRASS GIS http://grass.osgeo.org ___ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev
[GRASS-dev] Re: [GRASS GIS] #1284: 'v.vol.rst --help' fails
#1284: 'v.vol.rst --help' fails -+-- Reporter: torben | Owner: grass-dev@… Type: defect | Status: closed Priority: major | Milestone: 6.4.1 Component: Vector | Version: 6.4.0 Resolution: fixed |Keywords: v.vol.rst Platform: Linux | Cpu: x86-64 -+-- Changes (by hamish): * status: new = closed * resolution: = fixed Comment: Replying to [comment:5 marisn]: Problem is here: source:grass/branches/releasebranch_6_4/vector/v.vol.rst/main.c#L225 dminchar is defined to have length of 10, still on my system somtimes dmin is longer than 10. Easy workaround - bump up dminchar to anything large enough (1000). buffer size increased in all branches with r45906-8. Hamish -- Ticket URL: https://trac.osgeo.org/grass/ticket/1284#comment:7 GRASS GIS http://grass.osgeo.org ___ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev
[GRASS-dev] Re: [GRASS GIS] #181: tac command missing in OSX
#181: tac command missing in OSX +--- Reporter: kyngchaos | Owner: hamish Type: defect | Status: closed Priority: minor | Milestone: 6.4.1 Component: Default| Version: 6.3.0 Resolution: fixed |Keywords: v.in.garmin, v.in.mapgen, v.in.lines Platform: MacOSX | Cpu: Unspecified +--- Changes (by hamish): * status: assigned = closed * resolution: = fixed Comment: backported fix to relbr64 in r45909. would still like to hear feedback from an OSX user. Hamish -- Ticket URL: https://trac.osgeo.org/grass/ticket/181#comment:20 GRASS GIS http://grass.osgeo.org ___ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] GRASS Python Ctypes: Write Raster produces No null file error!!
Hi Glynn, Thanks for your suggestion that was indeed the case. Its fixed now. Really appreciate your help and feedback. On Apr 11, 2011, at 4:36 PM, Glynn Clements wrote: Sudipta Sarkar wrote: Please help me solve the following, I am entirely new to the whole Python-GRASS-Ctypes issue so please bear with me. I am trying to develop an application using Python Ctypes hooks to GRASS C libraries. Have done most of the part but getting stuck in the end where i try to write off my output file as GRASS raster. I am giving the relevant part below along with the error I am getting: When it comes to executing the line Rast_close(out_fd) I am getting the error: ERROR: No null file for madresult.0 The problem occurs because the script writes fewer rows to the file than it should. The raster library attempts to deal with this by padding the file with zeros, but there's a bug in the code (it has already closed the null file at the point where it tries to write the additional rows; that's what the error message is reporting). Even if we fix the bug in the raster library, the fact that you aren't writing the correct number of rows suggests that there's a bug in the script. If you're reading or writing rasters using a modified window (region), note that the window handling has changed significantly between 6.x and 7.0 (in particular, 7.0 has separate windows for input and output). -- Glynn Clements gl...@gclements.plus.com ___ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev