Re: [GRASS-user] Problems with v.external
see comments below: > Andreas Neumann wrote: >> I am trying to use postgis datasets read-only using v.external. However, >> I >> am having problems. Here is my command: >> >> v.external dsn="PG:host=localhost dbname=uster user=an password=mypw" >> layer=natur.naturnahe_gaerten output=gaerten >> >> And here is my error message: >> >> Sorry, is not a valid parameter >> Sorry, is not a valid parameter >> Sorry, is not a valid parameter >> >> I expected to run into problems with schemas, maybe, but not with the >> login. What am I doing wrong in the dsn parameters? > > > For some reason the "quotes" are being removed from your command and so > the PG: > settings are being treated as command line parameters to v.external. As > v.external doesn't have those options, you get the error message from the > GRASS > command line parser. yes, this seems to be the case. Any ideas on why the quotes are removed? I compiled against a nightly version of gdal, somewhere between 1.4.3 and 1.5. I can try with 1.5 again. Andreas -- Andreas Neumann Böschacherstrasse 6, CH-8624 Grüt/Gossau, Switzerland Email: [EMAIL PROTECTED], Web: * http://www.carto.net/ (Carto and SVG resources) * http://www.carto.net/neumann/ (personal page) * http://www.svgopen.org/ (SVG Open Conference) * http://www.geofoto.ch/ (Georeferenced Photos of Switzerland) ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Problems with v.external
yes, PostgreSQL works in ogr. I also use it to import Interlis data to Postgis. Supported Formats: -> "ESRI Shapefile" (read/write) -> "MapInfo File" (read/write) -> "UK .NTF" (readonly) -> "SDTS" (readonly) -> "TIGER" (read/write) -> "S57" (read/write) -> "DGN" (read/write) -> "VRT" (readonly) -> "AVCBin" (readonly) -> "REC" (readonly) -> "Memory" (read/write) -> "CSV" (read/write) -> "GML" (read/write) -> "KML" (read/write) -> "Interlis 1" (read/write) -> "Interlis 2" (read/write) -> "PostgreSQL" (read/write) -> "GRASS" (readonly) Seems to be another problem. Maybe with the quotes ... Andreas > > hi Andreas, > > it seems to work here. Could it be that your OGR installation is > not compiled with PG support? > ogrinfo --formats > tells you. > > Markus > > > Andreas Neumann-7 wrote: >> >> Hello, >> >> I am trying to use postgis datasets read-only using v.external. However, >> I >> am having problems. Here is my command: >> >> v.external dsn="PG:host=localhost dbname=uster user=an password=mypw" >> layer=natur.naturnahe_gaerten output=gaerten >> >> And here is my error message: >> >> Sorry, is not a valid parameter >> Sorry, is not a valid parameter >> Sorry, is not a valid parameter >> >> I expected to run into problems with schemas, maybe, but not with the >> login. What am I doing wrong in the dsn parameters? >> >> Thanks for any hints, >> Andreas >> >> -- >> Andreas Neumann >> Böschacherstrasse 6, CH-8624 Grüt/Gossau, Switzerland >> Email: [EMAIL PROTECTED], Web: >> * http://www.carto.net/ (Carto and SVG resources) >> * http://www.carto.net/neumann/ (personal page) >> * http://www.svgopen.org/ (SVG Open Conference) >> * http://www.geofoto.ch/ (Georeferenced Photos of Switzerland) >> > > -- > View this message in context: > http://www.nabble.com/Problems-with-v.external-tf4944319.html#a14159258 > Sent from the Grass - Users mailing list archive at Nabble.com. > > ___ > grass-user mailing list > grass-user@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/grass-user > -- Andreas Neumann Böschacherstrasse 6, CH-8624 Grüt/Gossau, Switzerland Email: [EMAIL PROTECTED], Web: * http://www.carto.net/ (Carto and SVG resources) * http://www.carto.net/neumann/ (personal page) * http://www.svgopen.org/ (SVG Open Conference) * http://www.geofoto.ch/ (Georeferenced Photos of Switzerland) ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] r.regression.line... differences with regression function LINEST in openoffice.org-calc (?)
I have submitted some comments upon the documentation of the "r.regression.line" script in http://wald.intevation.org/tracker/?func=detail&aid=552&group_id=21&atid=207 Now I have 2 questions. Apologies if I miss some obvious things but I am confused! Here it goes: 1. I don't understand why (in lines 84 and 85 in the r.regression.line script) "sumsqX=sumsqX/tot" and "sumsqY=sumsqY/tot" ? 2. I can't understand the differences in the following... : I created two raster maps with the same MASK, each containing only 6 pixels with the following values: mapA: 326 641 1336 2020 3197 3484 mapB: 432 850 931 1956 2582 2622 For mapA "r.univar" gives: n: 6 minimum: 326 maximum: 3484 range: 3158 mean: 1834 mean of absolute values: 1834 standard deviation: 1194.44 variance: 1.4267e+06 variation coefficient: 65.1278 % sum: 11004) For mapB... : n: 6 minimum: 432 maximum: 2622 range: 2190 mean: 1562.17 mean of absolute values: 1562.17 standard deviation: 866.145 variance: 750207 variation coefficient: 55.4451 % sum: 9373) In openoffice calc (some of) the respective results are: For mapA: MIN: 326 MAX: 3484 AVERAGE: 1834 STDEV: 1308,45 VAR: 1,71E+06 SUM: 11004 For mapB: MIN: 432 MAX: 2622 AVERAGE: 156217 STDEV: 948,81 VAR: 9,00E+05 SUM: 9373 Based on r.regression.line I get for map1=mapA and map2=mapB: a b R N F medX sdX medY sdY 0.000458151 0.809242 0.99157 1021726 -0.98321 0.01077 5.3038 0.00917369 4.32854 and for map1=mapB and map2=mapB: a b R N F medX sdX medY sdY -0.000375823 1.21498 0.99157 1021726 -0.98321 0.00917369 4.32854 0.01077 5.3038 "R" is Pearson's correlation coefficient (as correctly defined in the script "r.regression.line" in line 83 but wrongly expressed as "sumXY - sumX*sumY/tot" in the print-out in line 101). In openoffice-calc I get for these: MapAMapB 326 432 1,350792Slope m 641 850 0,138835standard error of the slope 1336931 0,959458RSQ (Square of "r") 2020195694,662802 4,00F value from the variance analysisstd error of regression for Y 319725828213134,001379 sum of squared deviation of estimated Y values from their linear mean 34842622 or MapBMapB 432 326 0,710293Slope m 850 641 0,073004standard error of the slope 931 13360,959458RSQ 1956202094,662802 4,00F value from the variance analysisstd error of regression for Y 258231974318750,949062 sum of squared deviation of estimated Y values from their linear mean 26223484 (How is really r.regression.line functioning? Trying to interpret the script is not that easy for me since I lack of some basics in scripting) Thank you, Nikos. ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Problems with v.external
Andreas Neumann wrote: > I am trying to use postgis datasets read-only using v.external. However, I > am having problems. Here is my command: > > v.external dsn="PG:host=localhost dbname=uster user=an password=mypw" > layer=natur.naturnahe_gaerten output=gaerten > > And here is my error message: > > Sorry, is not a valid parameter > Sorry, is not a valid parameter > Sorry, is not a valid parameter > > I expected to run into problems with schemas, maybe, but not with the > login. What am I doing wrong in the dsn parameters? For some reason the "quotes" are being removed from your command and so the PG: settings are being treated as command line parameters to v.external. As v.external doesn't have those options, you get the error message from the GRASS command line parser. Hamish Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now. http://mobile.yahoo.com/sports;_ylt=At9_qDKvtAbMuh1G1SQtBI7ntAcJ ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Problems with v.external
hi Andreas, it seems to work here. Could it be that your OGR installation is not compiled with PG support? ogrinfo --formats tells you. Markus Andreas Neumann-7 wrote: > > Hello, > > I am trying to use postgis datasets read-only using v.external. However, I > am having problems. Here is my command: > > v.external dsn="PG:host=localhost dbname=uster user=an password=mypw" > layer=natur.naturnahe_gaerten output=gaerten > > And here is my error message: > > Sorry, is not a valid parameter > Sorry, is not a valid parameter > Sorry, is not a valid parameter > > I expected to run into problems with schemas, maybe, but not with the > login. What am I doing wrong in the dsn parameters? > > Thanks for any hints, > Andreas > > -- > Andreas Neumann > Böschacherstrasse 6, CH-8624 Grüt/Gossau, Switzerland > Email: [EMAIL PROTECTED], Web: > * http://www.carto.net/ (Carto and SVG resources) > * http://www.carto.net/neumann/ (personal page) > * http://www.svgopen.org/ (SVG Open Conference) > * http://www.geofoto.ch/ (Georeferenced Photos of Switzerland) > -- View this message in context: http://www.nabble.com/Problems-with-v.external-tf4944319.html#a14159258 Sent from the Grass - Users mailing list archive at Nabble.com. ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] setting output nodata values in grass
Hello all, I've been processing quite a bit of terrain data in GRASS and am having an issue with output nodata values.. Is there anyway to set the output nodata value when exporting a raster? I use r.in.xyz to load gridded data, and then export it to GTiff using r.out.gdal. The output file ends up with a float for null areas, something like "NoData Value=-9.9993381581e+36". I'd like to set it too something simple like "-". I can use "r.null map=blah null=-", but then the metadata "NoData" flag doesn't get set. Is there a way to specify a specific nodata value, either for internal storage, or as a metaopt for r.out.gdal? I'm trying to get the import / export pipeline down to the least amount of steps possible. Thanks, Jamie ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] Problems with v.external
Hello, I am trying to use postgis datasets read-only using v.external. However, I am having problems. Here is my command: v.external dsn="PG:host=localhost dbname=uster user=an password=mypw" layer=natur.naturnahe_gaerten output=gaerten And here is my error message: Sorry, is not a valid parameter Sorry, is not a valid parameter Sorry, is not a valid parameter I expected to run into problems with schemas, maybe, but not with the login. What am I doing wrong in the dsn parameters? Thanks for any hints, Andreas -- Andreas Neumann Böschacherstrasse 6, CH-8624 Grüt/Gossau, Switzerland Email: [EMAIL PROTECTED], Web: * http://www.carto.net/ (Carto and SVG resources) * http://www.carto.net/neumann/ (personal page) * http://www.svgopen.org/ (SVG Open Conference) * http://www.geofoto.ch/ (Georeferenced Photos of Switzerland) ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] v.edit option=snap
Hi, it is strange, the tool is using the library function Vect_snap_lines_list(). Can you send me part of the data to test it? Martin 2007/12/4, ivan marchesini <[EMAIL PROTECTED]>: > Hi to all, > I have a vector line maps... > I would like to use v.edit to snap only the nodes of the lines in a well > defined threshold... (20 meters) > I have tried v.edit with option "snap" but it seems that also vertex are > snapped and it seems also that the vertex of the same line are snapped > (determining smoothing of the lines). > Is there a way to automatically snap *only the the nodes* of the lines? > Many thanks > Ivan > > > > > > -- > Ti prego di cercare di non inviarmi files .doc, .xls, .ppt, .dwg. > Preferisco formati liberi. > Please try to avoid to send me .doc, .xls, .ppt, .dwg files. > I prefer free formats. > http://it.wikipedia.org/wiki/Formato_aperto > http://en.wikipedia.org/wiki/Open_format > > Ivan Marchesini > Department of Civil and Environmental Engineering > University of Perugia > Via G. Duranti 93/a > 06125 > Perugia (Italy) > Socio fondatore GFOSS "Geospatial Free and Open Source Software" > http://www.gfoss.it > e-mail: [EMAIL PROTECTED] > [EMAIL PROTECTED] > tel: +39(0)755853760 > fax (university): +39(0)755853756 > fax (home): +39(0)5782830887 > jabber: [EMAIL PROTECTED] > > ___ > grass-user mailing list > grass-user@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/grass-user > -- Martin Landa <[EMAIL PROTECTED]> * http://gama.fsv.cvut.cz/~landa * ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Silent commands in python
Thanks all, I'll check the subprocess module. Sounds interesting and a lot more complete then os.system. I'll just have to study a bit more... Those are the problems of being a self thought hacker with no formal programing education :) Cheers Daniel On Dec 4, 2007 7:40 AM, Hamish <[EMAIL PROTECTED]> wrote: > > Daniel Victoria wrote: > > This might be more of a python problem but here it goes... > > I wrote a water balance script in python to run under GRASS. What I > > would like now is that the commands in the python script would be > > silent, that is, no return from stdout or stderr. > > For instance every time I call a r.mapcalc function I get the 0-100% > > count. I'd like to silence that and other commands. > > > > In the shell I would silence command outputs using &> /dev/null, for > > exemple: > > echo "blabla=2*bla" | r.mapcalc &> /dev/null > > > > But in python that does not work using the os.system() function, that is: > > os.system("echo 'blabla=2*bla' | r.mapcalc &> /dev/null") > > > > Anyone has any tips on the matter? > > > If this is purely for cosmetic/usability reasons*, and not for technical > ones** > you've got some options in GRASS 6.3. > > * (hard to see the important messages with all the noise) > ** (like tcl's anything to stderr is an error) > > > The easiest is to pass the --quiet flag on the module command line. This works > for almost all modules. The big exception to that is r.mapcalc which doesn't > use the standard parser. > > For r.mapcalc, or if you want to set a blanket --quiet directive for the whole > script, you can set the GRASS_VERBOSE environmental variable. Python's os > module has a putenv() function to do that. > > These are the levels you can use: > (from lib/gis/verbose.c) > 0 - module should print nothing but errors and warnings (G_fatal_error, > G_warning) Triggered by "--q" or "--quiet". > 1 - module will print progress information (G_percent) > 2 - module will print all messages (G_message) [default level] > 3 - module will be very verbose. Triggered by "--v" or "--verbose". > > "--quiet" will set the level to 0. > > > shell script example > # for everything that follows > GRASS_VERBOSE=1 > export GRASS_VEBOSE > > # override for just one module > GRASS_VERBOSE=0 \ > r.mapcalc "only_set = for_this_process" > > > Another nice thing about using the enviro variable method is that it is > silently ignored for earlier versions of GRASS. For earlier versions of GRASS > an error happens when "--quiet" isn't recognized as a valid command line > option. (the new 6.2.3 knows to ignore it) > > > see "Verbosity levels" at > http://grass.gdf-hannover.de/wiki/Development_Specs > > > The advantage of these methods versus sending all stderr to /dev/null is that > warning and error messages are not lost, making prototyping and debugging a > whole lot easier. > > > Hamish > > > > > > Looking for last minute shopping deals? > Find them fast with Yahoo! Search. > http://tools.search.yahoo.com/newsearch/category.php?category=shopping > ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] wxgrass Digitization tool
Hi, 2007/12/3, Pablo Carreira <[EMAIL PROTECTED]>: > I'm trying to use wxgrass Digitization tool, it works fine to create new > vectors, but when I try to move an existing vertex I get this error in the > terminal: > > Traceback (most recent call last): > File "/usr/local/grass-6.3.0RC2/etc/wx/gui_modules/wxgui_utils.py", line > 330, in OnStartEditing > self.mapdisplay.digittoolbar.StartEditing (maplayer) > File "/usr/local/grass-6.3.0RC2/etc/wx/gui_modules/toolbars.py", line 587, > in StartEditing > self.parent.digit.SetMapName(mapLayer.name) > File "/usr/local/grass-6.3.0RC2/etc/wx/gui_modules/digit.py", line 154, in > SetMapName > self.driver.Reset(self.map) > File "/usr/local/grass-6.3.0RC2/etc/wx/gui_modules/digit.py", line 705, in > Reset > self.__display.OpenMap(str(name), str(mapset)) > AttributeError: 'NoneType' object has no attribute 'OpenMap' It seems to me that you haven't compiled wx display driver which is requested by digitization tool. For detailed information see README file (section 7 - DIGITIZATION TOOL). Martin -- Martin Landa <[EMAIL PROTECTED]> * http://gama.fsv.cvut.cz/~landa * ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] v.edit option=snap
Hi to all, I have a vector line maps... I would like to use v.edit to snap only the nodes of the lines in a well defined threshold... (20 meters) I have tried v.edit with option "snap" but it seems that also vertex are snapped and it seems also that the vertex of the same line are snapped (determining smoothing of the lines). Is there a way to automatically snap *only the the nodes* of the lines? Many thanks Ivan -- Ti prego di cercare di non inviarmi files .doc, .xls, .ppt, .dwg. Preferisco formati liberi. Please try to avoid to send me .doc, .xls, .ppt, .dwg files. I prefer free formats. http://it.wikipedia.org/wiki/Formato_aperto http://en.wikipedia.org/wiki/Open_format Ivan Marchesini Department of Civil and Environmental Engineering University of Perugia Via G. Duranti 93/a 06125 Perugia (Italy) Socio fondatore GFOSS "Geospatial Free and Open Source Software" http://www.gfoss.it e-mail: [EMAIL PROTECTED] [EMAIL PROTECTED] tel: +39(0)755853760 fax (university): +39(0)755853756 fax (home): +39(0)5782830887 jabber: [EMAIL PROTECTED] ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Silent commands in python
Daniel Victoria wrote: > This might be more of a python problem but here it goes... > I wrote a water balance script in python to run under GRASS. What I > would like now is that the commands in the python script would be > silent, that is, no return from stdout or stderr. > For instance every time I call a r.mapcalc function I get the 0-100% > count. I'd like to silence that and other commands. > > In the shell I would silence command outputs using &> /dev/null, for exemple: > echo "blabla=2*bla" | r.mapcalc &> /dev/null > > But in python that does not work using the os.system() function, that is: > os.system("echo 'blabla=2*bla' | r.mapcalc &> /dev/null") > > Anyone has any tips on the matter? If this is purely for cosmetic/usability reasons*, and not for technical ones** you've got some options in GRASS 6.3. * (hard to see the important messages with all the noise) ** (like tcl's anything to stderr is an error) The easiest is to pass the --quiet flag on the module command line. This works for almost all modules. The big exception to that is r.mapcalc which doesn't use the standard parser. For r.mapcalc, or if you want to set a blanket --quiet directive for the whole script, you can set the GRASS_VERBOSE environmental variable. Python's os module has a putenv() function to do that. These are the levels you can use: (from lib/gis/verbose.c) 0 - module should print nothing but errors and warnings (G_fatal_error, G_warning) Triggered by "--q" or "--quiet". 1 - module will print progress information (G_percent) 2 - module will print all messages (G_message) [default level] 3 - module will be very verbose. Triggered by "--v" or "--verbose". "--quiet" will set the level to 0. shell script example # for everything that follows GRASS_VERBOSE=1 export GRASS_VEBOSE # override for just one module GRASS_VERBOSE=0 \ r.mapcalc "only_set = for_this_process" Another nice thing about using the enviro variable method is that it is silently ignored for earlier versions of GRASS. For earlier versions of GRASS an error happens when "--quiet" isn't recognized as a valid command line option. (the new 6.2.3 knows to ignore it) see "Verbosity levels" at http://grass.gdf-hannover.de/wiki/Development_Specs The advantage of these methods versus sending all stderr to /dev/null is that warning and error messages are not lost, making prototyping and debugging a whole lot easier. Hamish Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user