Hi, sorry for the omission of a descriptive subject line in my previous message.
I have recently upgraded to GRASS 7 (from 6.4) in my mac running snow leopard 10.6.8. All frameworks updated. The software starts fine...and so far appears to work OK but for some error messages in the terminal window: Launching <wxpython> GUI in the background, please wait... GRASS 7.0.svn (proj1):~ > Fri Mar 16 08:48:08 raw.local pythonw2.6[618] <Error>: CGContextRestoreGState: invalid context 0x0 Fri Mar 16 08:48:08 raw2-bu.local pythonw2.6[618] <Error>: CGContextRestoreGState: invalid context 0x0 Fri Mar 16 08:48:08 raw2-bu.local pythonw2.6[618] <Error>: CGContextRestoreGState: invalid context 0x0 Fri Mar 16 08:48:08 raw2-bu.local pythonw2.6[618] <Error>: CGContextRestoreGState: invalid context 0x0 Fri Mar 16 08:48:08 raw2-bu.local pythonw2.6[618] <Error>: CGContextRestoreGState: invalid context 0x0 Also, previews in cartographic composer that need python imaging library is not working - related to the above? I searched for other's experience with this and found some, but not solutions. Any help to fix this will be apprecaited. Thank you, Raphael. ________________________________________ From: [email protected] [[email protected]] On Behalf Of [email protected] [[email protected]] Sent: Friday, 16 March 2012 4:15 PM To: [email protected] Subject: grass-user Digest, Vol 71, Issue 32 Send grass-user mailing list submissions to [email protected] To subscribe or unsubscribe via the World Wide Web, visit http://lists.osgeo.org/mailman/listinfo/grass-user or, via email, send a message with subject or body 'help' to [email protected] You can reach the person managing the list at [email protected] When replying, please edit your Subject line so it is more specific than "Re: Contents of grass-user digest..." Today's Topics: 1. Re: grass prompt when changing locations (Rich Shepard) 2. v.in.ogr from PostGIS - how to avoid primary key to become cat (Patrick S.) 3. Re: windows format for temporary file path (Richard Edmonds) 4. Re: windows format for temporary file path (Martin Landa) 5. Re: Strange r.slope.aspect output of Aster dem (leonidas) 6. Re: grass-user Digest, Vol 71, Issue 31 ([email protected]) 7. Re: windows format for temporary file path (Glynn Clements) ---------------------------------------------------------------------- Message: 1 Date: Thu, 15 Mar 2012 09:29:03 -0700 (PDT) From: Rich Shepard <[email protected]> Subject: Re: [GRASS-user] grass prompt when changing locations To: "[email protected]" <[email protected]> Message-ID: <[email protected]> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed On Thu, 15 Mar 2012, Tyler Smith wrote: > Absolutely, I'm planning to do that shortly (and will announce it on this > list). Probably this weekend - I just need to tidy it up a bit and open > the bitbucket repository. Tyler, Thanks. Rich ------------------------------ Message: 2 Date: Thu, 15 Mar 2012 18:38:55 +0100 From: "Patrick S." <[email protected]> Subject: [GRASS-user] v.in.ogr from PostGIS - how to avoid primary key to become cat To: grass mailing list <[email protected]> Message-ID: <[email protected]> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Dear list, sorry for writing several times in such a short time, but every start is a little hard.... When importing from PostGIS, v.in.ogr will remove the column with the primary key and use the objects as "cat". Is there a way to avoid this behaviour, e.g a flag? I just copied the table now in SQL, and imported the copy, but I guess that is not really the best way to handle this. During my search I found a post to the mailing-list from 2008 on this issue, but no answer to that one. patrick ------------------------------ Message: 3 Date: Fri, 16 Mar 2012 09:20:14 +1300 From: Richard Edmonds <[email protected]> Subject: Re: [GRASS-user] windows format for temporary file path To: Glynn Clements <[email protected]> Cc: [email protected] Message-ID: <[email protected]> Content-Type: text/plain; charset=ISO-8859-1; format=flowed On 16/03/2012 3:13 a.m., Glynn Clements wrote: > It's possible that it's being used where it isn't appropriate > (i.e. where an absolute path is appropriate), but it's also possible > that you're passing an absolute path where a simple filename (or even > a map name) is actually required. > Ah that makes sense, I was trying to use it to generate, then remove a temporary layer for use in the v.to.rast command. Apologies for not posting the command which generated the error. I have changed my bash script with the following which now generates only a name rather than a path and at least now the v.to.rast command runs. temp1="$$1" v.to.rast --overwrite input=$GIS_OPT_INPUT output=$temp1 use=attr column=elevation However I still get that error when I try to remove the layer/file. I had inferred from the g.remove man page that: g.remove rast=$temp1 would remove the raster layer $temp1 but instead i get the error: Removing raster <39281> raster: couldn't be removed trying it with: g.remove rast=`g.tempfile pid=$$1` generates the error I described originally but does look closer to actually removing the layer: Removing raster <E:\GRASSdata/newLocation/PERMANENT/.tmp/35001.0> Illegal filename. Character </> not allowed. Raster map <E:\GRASSdata/newLocation/PERMANENT/.tmp/35001.0> not found Illegal filename. Character </> not allowed. raster: couldn't be removed Illegal filename. Character </> not allowed. header: couldn't be removed Illegal filename. Character </> not allowed. category: couldn't be removed Illegal filename. Character </> not allowed. color: couldn't be removed Illegal filename. Character </> not allowed. history: couldn't be removed Illegal filename. Character </> not allowed. misc: couldn't be removed Illegal filename. Character </> not allowed. fcell: couldn't be removed Illegal filename. Character </> not allowed. g3dcell: couldn't be removed Illegal filename. Character </> not allowed. colr2/PERMANENT: couldn't be removed <E:\GRASSdata/newLocation/PERMANENT/.tmp/35001.0> nothing removed Sorry the error dump is so long, but I'm having real trouble dealing with these pesky temporary layers. Hopefully if I get this sorted then a search for "create and remove temporary layers in bash for GRASS GIS" will turn up a working solution which I couldn't find previously. Perhaps I should start a new thread? Richard ------------------------------ Message: 4 Date: Thu, 15 Mar 2012 21:29:59 +0100 From: Martin Landa <[email protected]> Subject: Re: [GRASS-user] windows format for temporary file path To: Glynn Clements <[email protected]> Cc: [email protected], Richard Edmonds <[email protected]> Message-ID: <ca+ei1ofr1dauq+rddf+buoyzqjzsqcto-kzv-9lp0ye9cp5...@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Hi, 2012/3/15 Glynn Clements <[email protected]>: >> which, on echo, generated E:\GRASSdata/newLocation/PERMANENT/.tmp/9168.0 >> >> and in use results in the following error: >> Illegal filename. Character </> not allowed. >> <E:\GRASSdata/newLocation/PERMANENT/.tmp/7512.0> is an illegal file name > > In what context does the error occur? btw, probably we could introduce in pythonlib new function for generating temp map names? tempmap() -> tmp_argv[0]_pid_num, eg. `temp_r_in_wms_7512.0` (`dot` is not allowed for vector maps). Martin -- Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa ------------------------------ Message: 5 Date: Thu, 15 Mar 2012 14:02:16 -0700 (PDT) From: leonidas <[email protected]> Subject: [GRASS-user] Re: Strange r.slope.aspect output of Aster dem To: [email protected] Message-ID: <[email protected]> Content-Type: text/plain; charset=us-ascii The problem was solved (at least visually removed the fishnet) using *-r cubic* in gdalwarp. Thank you for your information! -- View this message in context: http://osgeo-org.1560.n6.nabble.com/Strange-r-slope-aspect-output-of-Aster-dem-tp4571755p4623064.html Sent from the Grass - Users mailing list archive at Nabble.com. ------------------------------ Message: 6 Date: Fri, 16 Mar 2012 08:57:12 +1100 From: <[email protected]> Subject: [GRASS-user] Re: grass-user Digest, Vol 71, Issue 31 To: <[email protected]> Message-ID: <cb88add0.d0ee%[email protected]> Content-Type: text/plain; charset="us-ascii" Hi, I have recently upgraded to GRASS 7 (from 6.4) in my mac running snow leopard 10.6.8. All frameworks updated. The software starts fine but for some error messages in the terminal window: Launching <wxpython> GUI in the background, please wait... GRASS 7.0.svn (proj1):~ > Fri Mar 16 08:48:08 raw.local pythonw2.6[618] <Error>: CGContextRestoreGState: invalid context 0x0 Fri Mar 16 08:48:08 raw2-bu.local pythonw2.6[618] <Error>: CGContextRestoreGState: invalid context 0x0 Fri Mar 16 08:48:08 raw2-bu.local pythonw2.6[618] <Error>: CGContextRestoreGState: invalid context 0x0 Fri Mar 16 08:48:08 raw2-bu.local pythonw2.6[618] <Error>: CGContextRestoreGState: invalid context 0x0 Fri Mar 16 08:48:08 raw2-bu.local pythonw2.6[618] <Error>: CGContextRestoreGState: invalid context 0x0 I searched for other's experience with this and found some, but not solutions. Any thoughts on how to fix this will be apprecaited. Thank you, Raphael. On 16/03/12 3:00 AM, "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>> wrote: Send grass-user mailing list submissions to [email protected]<mailto:[email protected]> To subscribe or unsubscribe via the World Wide Web, visit http://lists.osgeo.org/mailman/listinfo/grass-user or, via email, send a message with subject or body 'help' to [email protected]<mailto:[email protected]> You can reach the person managing the list at [email protected]<mailto:[email protected]> When replying, please edit your Subject line so it is more specific than "Re: Contents of grass-user digest..." Today's Topics: 1. Re: I do not understand how region/projection/coordinate system are intertwined (Glynn Clements) 2. Re: grass prompt when changing locations (Glynn Clements) 3. Re: Why Does Re-projection Increase Disk Space Used? [UPDATE] (Glynn Clements) 4. Re: Why Does Re-projection Increase Disk Space Used? [UPDATE] (Rich Shepard) 5. Re: grass prompt when changing locations (Tyler Smith) 6. Re: grass prompt when changing locations (Rich Shepard) 7. Re: grass prompt when changing locations (Tyler Smith) ---------------------------------------------------------------------- Message: 1 Date: Thu, 15 Mar 2012 14:22:01 +0000 From: Glynn Clements <[email protected]<mailto:[email protected]>> Subject: Re: [GRASS-user] I do not understand how region/projection/coordinate system are intertwined To: Fridtjof Schiefenh ? vel <[email protected]<mailto:[email protected]>> Cc: [email protected]<mailto:[email protected]> Message-ID: <[email protected]<mailto:[email protected]>> Content-Type: text/plain; charset=iso-8859-1 Fridtjof Schiefenh?vel wrote: it seems I can't solve this problem: ->create a location with a mercator projection (i want to have degrees as the coordinate system) That's a contradiction. Only lat/lon locations use degrees as the coordinate system. A Mercator projection (whether "normal" Mercator, transverse, or oblique) has coordinates in distance units (usually either metres or feet). A Mercator projection /can't/ have coordinates in degrees, as coordinates have to be linear while Mercator has one coordinate vary non-linearly with the angle from the tangent circle. -- Glynn Clements <[email protected]<mailto:[email protected]>> ------------------------------ Message: 2 Date: Thu, 15 Mar 2012 14:40:34 +0000 From: Glynn Clements <[email protected]<mailto:[email protected]>> Subject: Re: [GRASS-user] grass prompt when changing locations To: Tyler Smith <[email protected]<mailto:[email protected]>> Cc: [email protected]<mailto:[email protected]> Message-ID: <[email protected]<mailto:[email protected]>> Content-Type: text/plain; charset=us-ascii Tyler Smith wrote: > > my prompt looks like this: > > > > GRASS 6.4.1 (dem):~ > > > > > The reference to the location '(dem)' stays, even after changing to > > another location. How do I make Grass update this? > > The new environment variables are stored in the > $LOCATION_NAME/$MAPSET/.bashrc file (if you're using bash). But this file is > not 'source'ed when changing mapsets. So you need to do: > eval `g.gisenv` > source $GISDBASE/$LOCATION_NAME/$MAPSET/.bashrc > > or manually reset the prompt: > export PS1="GRASS-6.4.2 ($LOCATION_NAME) \w > " There is no .bashrc file in the mapset directory, so I take it I would have to set that up for each mapset in each location? It's created when you start a GRASS session. There's no point in creating it manually, as it will never be read, and will be overwritten the next time you start a GRASS session in that directory. Creating the .bashrc file in the mapset directory is something of a hack. The startup script sets HOME to the mapset directory so that the .bash_history file will be created there (so each mapset gets its own command history). That causes the .bashrc file file to be read from the mapset directory; the .bashrc file then restores HOME. Manually resetting the prompt works fine, after eval 'g.gisenv`, so that is what I'm using now. There isn't any simple way to fix this. A command such as g.mapset cannot change the environment of another process (e.g. the shell from which g.mapset was run). -- Glynn Clements <[email protected]<mailto:[email protected]>> ------------------------------ Message: 3 Date: Thu, 15 Mar 2012 14:50:54 +0000 From: Glynn Clements <[email protected]<mailto:[email protected]>> Subject: Re: [GRASS-user] Why Does Re-projection Increase Disk Space Used? [UPDATE] To: Rich Shepard <[email protected]<mailto:[email protected]>> Cc: [email protected]<mailto:[email protected]> Message-ID: <[email protected]<mailto:[email protected]>> Content-Type: text/plain; charset=us-ascii Rich Shepard wrote: Related question: if they're no longer needed, why doesn't grass remove them from the hard drive? Which OS? r.proj calls remove() on the temporary file immediately after opening it. On Unix, that removes the directory entry, and will cause the file itself to be deleted as soon as r.proj terminates. On Windows, the remove() call will fail (you can't delete an open file on Windows), and the file will be left behind. -- Glynn Clements <[email protected]<mailto:[email protected]>> ------------------------------ Message: 4 Date: Thu, 15 Mar 2012 08:06:11 -0700 (PDT) From: Rich Shepard <[email protected]<mailto:[email protected]>> Subject: Re: [GRASS-user] Why Does Re-projection Increase Disk Space Used? [UPDATE] To: [email protected]<mailto:[email protected]> Message-ID: <[email protected]<mailto:[email protected]>> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed On Thu, 15 Mar 2012, Glynn Clements wrote: Which OS? Linux. r.proj calls remove() on the temporary file immediately after opening it. On Unix, that removes the directory entry, and will cause the file itself to be deleted as soon as r.proj terminates. On Windows, the remove() call will fail (you can't delete an open file on Windows), and the file will be left behind. For some reason, then, it's not working here. Slackware-13.1/x486 and -13.37/x86_64. On the latter host I found two files in ../.tmp/<hostname>/: <pid>.1 and <pid>.2. The former was almost 100G in size and the latter was >10G. The source raster file is 45M in size. Thanks, Glynn, Rich ------------------------------ Message: 5 Date: Thu, 15 Mar 2012 11:07:46 -0400 From: Tyler Smith <[email protected]<mailto:[email protected]>> Subject: Re: [GRASS-user] grass prompt when changing locations To: Glynn Clements <[email protected]<mailto:[email protected]>> Cc: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>> Message-ID: <cadkt+zspamauhgjhctrwvkvvjvcexhseusxvfz7_psb26tw...@mail.gmail.com<mailto:cadkt+zspamauhgjhctrwvkvvjvcexhseusxvfz7_psb26tw...@mail.gmail.com>> Content-Type: text/plain; charset=ISO-8859-1 On Thu, Mar 15, 2012 at 10:40 AM, Glynn Clements <[email protected]<mailto:[email protected]>> wrote: Tyler Smith wrote: Manually resetting the prompt works fine, after eval 'g.gisenv`, so that is what I'm using now. There isn't any simple way to fix this. A command such as g.mapset cannot change the environment of another process (e.g. the shell from which g.mapset was run). Thanks for the explanation Glynn. I'm running Grass from Emacs, and have written the rough framework of a dedicated Grass mode. So instead of running g.mapset, I call M-x grass-change-location, which prompts for location and mapset, then calls g.mapset with that information. The final piece was getting the same function to reset the prompt, and now it's relatively seamless. Cheers, Tyler ------------------------------ Message: 6 Date: Thu, 15 Mar 2012 08:27:01 -0700 (PDT) From: Rich Shepard <[email protected]<mailto:[email protected]>> Subject: Re: [GRASS-user] grass prompt when changing locations To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>> Message-ID: <[email protected]<mailto:[email protected]>> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed On Thu, 15 Mar 2012, Tyler Smith wrote: I'm running Grass from Emacs, and have written the rough framework of a dedicated Grass mode. So instead of running g.mapset, I call M-x grass-change-location, which prompts for location and mapset, then calls g.mapset with that information. The final piece was getting the same function to reset the prompt, and now it's relatively seamless. Tyler, Are you willing to share your .el with the rest of us who depend on emacs for text editing? I use ESS (Emacs Speaks S) when I'm writing and running R statistical models in emacs, and the modes for SQL, Python, and C. I can appreciate the advantages of running grass within it. Rich ------------------------------ Message: 7 Date: Thu, 15 Mar 2012 11:47:21 -0400 From: Tyler Smith <[email protected]<mailto:[email protected]>> Subject: Re: [GRASS-user] grass prompt when changing locations To: Rich Shepard <[email protected]<mailto:[email protected]>> Cc: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>> Message-ID: <CADkt+Zu3hon1q3108zWi2cZitFFC=s7uea60kk9wpjxs9nj...@mail.gmail.com<mailto:CADkt+Zu3hon1q3108zWi2cZitFFC=s7uea60kk9wpjxs9nj...@mail.gmail.com>> Content-Type: text/plain; charset=ISO-8859-1 On Thu, Mar 15, 2012 at 11:27 AM, Rich Shepard <[email protected]<mailto:[email protected]>> wrote: On Thu, 15 Mar 2012, Tyler Smith wrote: I'm running Grass from Emacs, and have written the rough framework of a dedicated Grass mode. So instead of running g.mapset, I call M-x grass-change-location, which prompts for location and mapset, then calls g.mapset with that information. The final piece was getting the same function to reset the prompt, and now it's relatively seamless. Tyler, ? Are you willing to share your .el with the rest of us who depend on emacs for text editing? I use ESS (Emacs Speaks S) when I'm writing and running R statistical models in emacs, and the modes for SQL, Python, and C. I can appreciate the advantages of running grass within it. Absolutely, I'm planning to do that shortly (and will announce it on this list). Probably this weekend - I just need to tidy it up a bit and open the bitbucket repository. Cheers, Tyler ------------------------------ _______________________________________________ grass-user mailing list [email protected]<mailto:[email protected]> http://lists.osgeo.org/mailman/listinfo/grass-user End of grass-user Digest, Vol 71, Issue 31 ****************************************** ------------------------------ Message: 7 Date: Fri, 16 Mar 2012 05:14:34 +0000 From: Glynn Clements <[email protected]> Subject: Re: [GRASS-user] windows format for temporary file path To: Richard Edmonds <[email protected]> Cc: [email protected] Message-ID: <[email protected]> Content-Type: text/plain; charset=us-ascii Richard Edmonds wrote: > > It's possible that it's being used where it isn't appropriate > > (i.e. where an absolute path is appropriate), but it's also possible > > that you're passing an absolute path where a simple filename (or even > > a map name) is actually required. > > Ah that makes sense, > I was trying to use it to generate, then remove a temporary layer for > use in the v.to.rast command. Apologies for not posting the command > which generated the error. > > I have changed my bash script with the following which now generates > only a name rather than a path and at least now the v.to.rast command runs. > > temp1="$$1" The "usual" convention for temporary map names is to combine the name of the script, "tmp", and the current PID, e.g.: temprast="myscript.tmp.$$" Use of the PID should ensure uniqueness even amongst multiple concurrent runs of the script in a single mapset (which shouldn't happen anyhow), and anyone using ".tmp." in a "real" map name is asking for trouble. > v.to.rast --overwrite input=$GIS_OPT_INPUT output=$temp1 use=attr > column=elevation > > However I still get that error when I try to remove the layer/file. I > had inferred from the g.remove man page that: > > g.remove rast=$temp1 > > would remove the raster layer $temp1 but instead i get the error: > Removing raster <39281> > raster: couldn't be removed "$$" evaluates to the PID of the shell running the script. "$$1" will be that PID with a "1" appended to it. So the above error indicates that the PID was 3928. There doesn't appear to be anything wrong with your commands; whatever value is chosen for temp1, I would expect "g.remove rast=$temp1" to remove the map created by "v.to.rast ... output=$temp1", provided that it hasn't changed in the meantime. -- Glynn Clements <[email protected]> ------------------------------ _______________________________________________ grass-user mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-user End of grass-user Digest, Vol 71, Issue 32 ****************************************** _______________________________________________ grass-user mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-user
