Re: [GRASS-user] python scripts: printing messages and adding map to tree

2011-03-01 Thread Martin Landa
Hi,

2011/3/1 Carlos Grohmann :
> In my python scripts, I want to print some messages during the calculations,
> like "step 1 complete". But my 'print' statements only show _after_
> the end of the script.
> How to make them show during the process?

print messages to stderr (or flush stdout), `print >> sys.stderr,
"..."`, better to use `grass.message()`

> Also, how to add the resulting map to the tree?

That's not possible. Please report it as a wish on trac.

Martin

-- 
Martin Landa  * http://geo.fsv.cvut.cz/~landa
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Tutorial Not Same as GRASS 6.4

2011-03-01 Thread Martin Landa
Hi,

2011/3/2 Thomas D. Dean :
>> GRASS 6.4.0RC5+39438 is quite old, there are a lot of bug fixes and
>> improvements in the user interface, you will better have to download
>> the latest release from the website
>> (http://grass.osgeo.org/download/index.php). As the wxGUI is now the
>> default GUI, you will better understand what is written in the
>> tutorial ;)
>
> I upgraded to the version on ubuntugis.  It still says 6.4.0, but, I
> have wxpython, now.

that's right, wxPython GUI became to be default GUI in 6.4.0RC6.

Martin

-- 
Martin Landa  * http://geo.fsv.cvut.cz/~landa
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] v.in.e00 Error: -6.5svn

2011-03-01 Thread Markus Neteler
On Wed, Mar 2, 2011 at 12:39 AM, Rich Shepard  wrote:
>  I've hit this once before and have no idea how to overcome the error.
> Please advise.
>
> /usr/local/grass-6.5.svn/scripts/v.in.e00: line 178: 32155 Aborted
> avcimport "$GIS_OPT_FILE" "$E00SHORTNAME" 2> /dev/null > /dev/null

avcimport crashed on your machine.

You may want to try it stand-alone to see why (to catch the error message).
Also

ldd `which avcimport`

may give some info about missing libraries. Maybe a 32bit/64bit mixup?

Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] Same Projection/Different Datum

2011-03-01 Thread Rich Shepard

  Am I correct that if I have source data in the same projection (AEA, LL,
UTM), but different datum (NAD83, NAD27), I should import them into distinct
locations, and reproject to a common projection later?

Rich
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] v.in.e00 Error: -6.5svn

2011-03-01 Thread Rich Shepard

  I've hit this once before and have no idea how to overcome the error.
Please advise.

/usr/local/grass-6.5.svn/scripts/v.in.e00: line 178: 32155 Aborted
avcimport "$GIS_OPT_FILE" "$E00SHORTNAME" 2> /dev/null > /dev/null
E00 Compressed ASCII found. Will uncompress first...
...converted to Arc Coverage in current directory
Importing lines...
Over-riding projection check
Layer: ARC
WARNING: Column name changed: 'NV_ROADS#' -> 'NV_ROADS_'
WARNING: Column name changed: 'NV_ROADS-ID' -> 'NV_ROADS_ID'
DBMI-DBF driver error:
Column 'FNODE_' already exists (duplicate name)
Cannot create table.
Error in db_execute_immediate()

ERROR: Unable to create table: 'create table roads (cat integer, UserId
   integer, FNODE_ integer, TNODE_ integer, LPOLY_ integer, RPOLY_
   integer, LENGTH double precision, NV_ROADS_ integer, NV_ROADS_ID
   integer, FNODE_ integer, TNODE_ integer, LPOLY_ integer, RPOLY_
   integer, NV_RDSWA83 integer, NV_RDSWA_1 integer, PREFIX varchar ( 2
   ), NAME varchar ( 30 ), TYPE varchar ( 4 ), SUFFIX varchar ( 2 ),
   FCC varchar ( 3 ), FIPS varchar ( 11 ))'
ERROR: An error occurred while running v.in.ogr

Rich
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Tutorial Not Same as GRASS 6.4

2011-03-01 Thread Thomas D. Dean
On Tue, 2011-03-01 at 09:33 +0100, Sylvain Maillard wrote:

> GRASS 6.4.0RC5+39438 is quite old, there are a lot of bug fixes and
> improvements in the user interface, you will better have to download
> the latest release from the website
> (http://grass.osgeo.org/download/index.php). As the wxGUI is now the
> default GUI, you will better understand what is written in the
> tutorial ;)

I upgraded to the version on ubuntugis.  It still says 6.4.0, but, I
have wxpython, now.

Thanks,
tomdean

___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Converting from FileGDB

2011-03-01 Thread Rich Shepard

On Tue, 1 Mar 2011, Alex Mandel wrote:


That subscription rejection is odd, I'll see if someone can look into that.


Alex,

  When the cursor hovered over the link it read mailto: ... so that's what I
did. I thought it was a majordomo MLM that wanted only the word subscribe in
the body of the text.


As for you're other question, now that the FileGDB api has been released
for Windows & Linux (couple of months ago, and 2 weeks ago) I believe
there is some code in the GDAL svn to support it. Though it's likely very
rough around the edges and probably requires that you compile gdal
yourself. I actually don't know it's specific status, just saw some
conversations that work was being done on it.


  I'll start Opera downloading that huge file and be very willing to work
with the devs testing the code. I've several projects in Nevada dependent on
hydrologic basins of different resolutions as well as streams in those
basins. I'll be a happy tester.


Now to try and get you on the gdal list where that conversation is likely
to happen.


  Thanks. You have my e-mail address.

Rich

--
Richard B. Shepard, Ph.D.  |   The Plain English Science Consultant
Applied Ecosystem Services, Inc.   |   Helping Ensure Our Clients' Futures
 Voice: 503-667-4517  Fax: 503-667-8863
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Converting from FileGDB

2011-03-01 Thread Stuart Edwards
difficult problem I suspect -

this sounds like a good solution, but I haven't tried it :

> http://www.geomaticinsight.com/home/?p=44

Stu


On Mar 1, 2011, at 2:36 PM, Rich Shepard wrote:

>  The USGS national hydrographic dataset (NHD) by states is available only
> as a FileGeoDataBase (FileGDB). When I look on the GDAL/OGR Web site I see
> that the Personal (PGDB) format is supported, but I don't see that the FGDB
> is.
> 
>  My attempt to subscribe to the gdal-dev list to ask was rejected (I cannot
> subscribe because I'm not a subscriber. Go figure.)
> 
>  Has anyone here experience with the FGDB and know how to import it to
> GRASS? The state data set I need is about 434M zipped and will take a while
> to download via my DSL connection.
> 
> Thanks,
> 
> Rich
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user

___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Converting from FileGDB

2011-03-01 Thread Alex Mandel
On 03/01/2011 11:36 AM, Rich Shepard wrote:
>   The USGS national hydrographic dataset (NHD) by states is available only
> as a FileGeoDataBase (FileGDB). When I look on the GDAL/OGR Web site I see
> that the Personal (PGDB) format is supported, but I don't see that the FGDB
> is.
> 
>   My attempt to subscribe to the gdal-dev list to ask was rejected (I
> cannot
> subscribe because I'm not a subscriber. Go figure.)
> 
>   Has anyone here experience with the FGDB and know how to import it to
> GRASS? The state data set I need is about 434M zipped and will take a while
> to download via my DSL connection.
> 
> Thanks,
> 
> Rich

That subscription rejection is odd, I'll see if someone can look into that.

As for you're other question, now that the FileGDB api has been released
for Windows & Linux (couple of months ago, and 2 weeks ago) I believe
there is some code in the GDAL svn to support it. Though it's likely
very rough around the edges and probably requires that you compile gdal
yourself. I actually don't know it's specific status, just saw some
conversations that work was being done on it.

Now to try and get you on the gdal list where that conversation is
likely to happen.

Thanks,
Alex

___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Converting from FileGDB

2011-03-01 Thread Mike
The current problem is that anything outside of ESRI licensing couldnt
access the FGDB. They have recently released a linux api for the format,
though I assume that eventually there will be something that works. I
believe there are some features on the NHD that cannot be done on the
Personal geodatabase, hence using the FGDB. Your best bet is to ask if they
can give you another format or find someone with a ESRI license.

On Tue, Mar 1, 2011 at 12:36 PM, Rich Shepard wrote:

>  The USGS national hydrographic dataset (NHD) by states is available only
> as a FileGeoDataBase (FileGDB). When I look on the GDAL/OGR Web site I see
> that the Personal (PGDB) format is supported, but I don't see that the FGDB
> is.
>
>  My attempt to subscribe to the gdal-dev list to ask was rejected (I cannot
> subscribe because I'm not a subscriber. Go figure.)
>
>  Has anyone here experience with the FGDB and know how to import it to
> GRASS? The state data set I need is about 434M zipped and will take a while
> to download via my DSL connection.
>
> Thanks,
>
> Rich
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] Converting from FileGDB

2011-03-01 Thread Rich Shepard

  The USGS national hydrographic dataset (NHD) by states is available only
as a FileGeoDataBase (FileGDB). When I look on the GDAL/OGR Web site I see
that the Personal (PGDB) format is supported, but I don't see that the FGDB
is.

  My attempt to subscribe to the gdal-dev list to ask was rejected (I cannot
subscribe because I'm not a subscriber. Go figure.)

  Has anyone here experience with the FGDB and know how to import it to
GRASS? The state data set I need is about 434M zipped and will take a while
to download via my DSL connection.

Thanks,

Rich
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] using try/except with grass.mapcalc in a Python Script

2011-03-01 Thread Glynn Clements

Jenny Turner wrote:

> I want to include grass.mapcalc function in try except but I'm not catching
> the errors. Has anyone used this for grass.mapcalc?

What sort of error are you expecting?

If you call set_raise_on_error(), a non-zero exit status should raise
a ScriptException instead of calling sys.exit() (note that sys.exit()
raises a SystemExit exception, which can be caught if desired).

Note that r.mapcalc will only return a non-zero exit status for
fundamental errors such as syntax errors in the expression or failure
to open a map. Calculation errors (e.g. division by zero or domain
errors) result in null values.

-- 
Glynn Clements 
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] using r.resamp.stats- When I reach a tie

2011-03-01 Thread Glynn Clements

António Rocha wrote:

> >> I'm planning on using r.resamp.stats in order to  resample a grid to a 
> >> coarser resolution. Since I'm using this function with classes I will 
> >> use mode method (more frequentclass to fall into a destination cell is 
> >> the chosen). My question is: when I have a tie between two classes, how 
> >> does GRASS decides which class shall be chosen?
> >> 
> >
> > In the event of a tie, the lowest-numbered category is chosen.
> 
> Thanks for your answer. Is there any other alternative, to resample 
> data, that uses another approach to solve tie events?

What mechanism do you want?

If you wanted e.g. the highest-numbered category, you could use
r.mapcalc to create a map with the categories negated, run
r.resamp.stats on that, then negate the result.

Some other possibilities could reasonably be handled with a
combination of pre- and post-processing.

For others, the only practical solution is to modify
lib/stats/c_mode.c.

-- 
Glynn Clements 
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] Display groups as different colors

2011-03-01 Thread Andrew Lewin
Dear List,

I have a vector layer with macrophyte assemblages (11 groups total).  The 
groups represent a set of state/provinces in North America. I would like to 
display the groups as a different color for each group so that I can see if the 
groups show a spatial pattern across North America.

Anyone know how to do this? So far I can only display the category colors. The 
categories are for each state/province.

Best Regards,

Andrew

Andrew Lewin, MSc, Adv. Dipl. GIS

Founder, Speak Up for the Blue
www.speakupforblue.com

President, Spatial-Conserve Inc.
www.spatialconserve.com


___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] python scripts: printing messages and adding map to tree

2011-03-01 Thread Carlos Grohmann
Hi all,

In my python scripts, I want to print some messages during the calculations,
like "step 1 complete". But my 'print' statements only show _after_
the end of the script.
How to make them show during the process?

Also, how to add the resulting map to the tree?

tks

-- 
Prof. Carlos Henrique Grohmann - Geologist D.Sc.
Institute of Geosciences - Univ. of São Paulo, Brazil
http://www.igc.usp.br/pessoais/guano
http://lattes.cnpq.br/5846052449613692
Linux User #89721

Can’t stop the signal.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] using try/except with grass.mapcalc in a Python Script

2011-03-01 Thread Jenny Turner
Greetings

I want to include grass.mapcalc function in try except but I'm not catching
the errors. Has anyone used this for grass.mapcalc?

Thanks
Jenny
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] calculating average value over a base map

2011-03-01 Thread Christian Schwartze
Monica,
I did similar things on slope values...have a look to the following code 
snippet:

r.mapcalc slope_mult=int(slope*1000.0)
r.stats -nN input=slope_mult | awk '{print $1"="$1" "$1/1000}' | r.reclass --o 
input=slope_mult output=slope_labeled
r.statistics --o -c base=base_map cover=slope_labeled method=average 
output=slope_avg
r.mapcalc slope_avg_cval=int(@slope_avg*1000)/1000.0

Perhaps it may help you...
Regards,
Christian.

From: Monica Buescu 
Sent: Tuesday, March 01, 2011 11:40 AM
To: Dmitrij Kolesov ; GRASS user list 
Subject: Re: [GRASS-user] calculating average value over a base map


Hi Dmistrij 
I think it was worked. I just need to figure out something with r.statistics.

Thanks
Monica



___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] Ps.map vlegend

2011-03-01 Thread Martin Album Ytre-Eide
Hello.

When using "area fill patterns" 
(http://grass.osgeo.org/wiki/AreaFillPatterns#Example_Pattern_files) together 
with vlegend in ps.map trouble appears when customising the patterns to my 
need. You can pretty much get the patterns you desire with the aid of pwith and 
scale option, but the problem is that vlegend does not follow up. Vlegend 
somewhat scales things down making the legend lock like something else than 
what is seen in the map. One can change the size of the legend by using width 
and fontsize but the pattern will still have the same size.

Is there any solution to this problem other than generating your own legend? 

Martin___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] calculating average value over a base map

2011-03-01 Thread Monica Buescu
Hi Dmistrij
I think it was worked. I just need to figure out something with
r.statistics.

Thanks
Monica
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Tutorial Not Same as GRASS 6.4

2011-03-01 Thread Hamish
Thomas:
> > A quick introduction to the 6.4 wxGUI and raster maps,
> > http://grass.osgeo.org/wiki/Quick_wx_tutorial,


I had neglected to upload the images that went along with that, now they
are up and hopefully it makes more sense now.

Probably it would help if someone could decorate the images with big red
arrows, and circled icons.

(GIMP: add a new layer, select by circle (keep x,y numbers equal to 
get a round one), Select->Border +2 pixels, change background color to
red, and Ctrl-x to cut donut [make sure antialias or feathering is checked in 
tool opts])


see also 
  http://grass.osgeo.org/grass64/manuals/html64_user/helptext.html



Hamish



  
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Tutorial Not Same as GRASS 6.4

2011-03-01 Thread Sylvain Maillard
You just launch GRASS with the old Tcl/Tk interface
(http://grass.osgeo.org/grass64/manuals/html64_user/gis.m.html) and
the tutorial was made with the "new" wxGUI
(http://grass.osgeo.org/grass64/manuals/html64_user/wxGUI.html)

GRASS 6.4.0RC5+39438 is quite old, there are a lot of bug fixes and
improvements in the user interface, you will better have to download
the latest release from the website
(http://grass.osgeo.org/download/index.php). As the wxGUI is now the
default GUI, you will better understand what is written in the
tutorial ;)


cheers,
Sylvain



2011/3/1 Thomas D. Dean :
> I have GRASS 6.4.0RC5+39438 (2009).  I followed the tutorial, with lots
> of mental corrections and managed to get the example displayed.  The
> tutorial is good, just needs some tweeking to match the GRASS display.
>
> A quick introduction to the 6.4 wxGUI and raster maps,
> http://grass.osgeo.org/wiki/Quick_wx_tutorial,
> Does not correspond to the GRASS display.
>
> For example,
>
>> Once inside add a raster map layer such as "elevation" from the
>>  PERMANENT mapset. To do this click on the checkerboard toolbar
>> button with a "+" on it and then select the map name from the
>> pull-down list which appears, and click [Ok].
>
> There is no icon checkerboard with a "+" on it.  Rather, there is a
> green, red, orange icon with an arrow in it.  However, it does have the
> description "Add raster layer".  And, there is not a pull down list.
> Rather, a layer is added, labeled raster1 and clicking the "i" button
> brings up a pop-up that allows selecting the map.
>
> I am not good at describing things.  I don't know what the author
> intended the icons to be.
>
> How do I help feeding back the corrections?  Or, is this tutorial for a
> newer version?
>
> tomdean
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Points, Distances, and, Bearings.

2011-03-01 Thread Hamish
Thomas wrote:
> > How do I enter a point, a bearing from that point, and a
> > distance from that point, plot the point, the bearing line,
> > and, the distance arc?

Hamish wrote:
> check out the d.rhumbline, d.geodesic, r.transect,
> r.profile, and m.cogo modules.

... and since I've wanted such a thing for a while for laying out long
transect lines, I've just added a new v.in.geodesic module to the AddOns
repository.

  http://grass.osgeo.org/wiki/GRASS_AddOns#v.in.geodesic


Description:
 Creates a vector map containing a great circle line.

Keywords:
 vector, geodesic, great circle, transect

Usage:
 v.in.geodesic map=name [coor=east1,north1,east2,north2]
   [line=east,north,azimuth,distance] [nsteps=value] [distance=value]
   [--overwrite] [--verbose] [--quiet]

Flags:
 --o   Allow output files to overwrite existing files
 --v   Verbose module output
 --q   Quiet module output

Parameters:
   map   Name for output vector map
  coor   Starting and ending coordinates
  line   Transect definition
nsteps   Number of vertices to place along the line
 options: 1-1
 default: 100
  distance   Distance between vertices in meters



It might have some bugs, and should be rewritten in C. (treat as a
functional prototype)


enjoy,
Hamish



  
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user