[GRASS5] A naive opinion on how grass *should* work

Okay, I will cheerfully label the following as a completely naive
opinion on how grass *should* work from the point of a newbie. If I
am saying something totally wrong or stupid, please say so. If you
want to say "Hey, great ideas, Russ. Here's your CVS login, go for
it!", that's a legitimate response as well.

First, its ridiculous to have to set the region just to run grass.
Completely unnecessary. Maybe some commands need to have a default
region. If so, they can say "Please run g.region first".

Second, images that are not georeferenced should *always* be imported
into an x,y projection, and d.rast should show the entire image by
default.

Third, when a map is georeferenced, *then* it goes into a location.

Third, no, wait, Fourth, the scope of a location should be determined
by the data stored in that location. Since all such data is
georeferenced (see "Third"), the bounds of the data set the scope of
the location, not vice-versa.

In other words, grass should be more approachable. I should be able
to go to a GIS clearinghouse (such as the New York State one at
Cornell), download a georeferenced map, run grass5 (for the first
time!) and be able to do this and have it work:

grass5

    yeah, I know, grass currently insists upon setting up a database.
    While that's arguably a good idea, so are defaults. If ~/.grassrc
    does not exist, then create ~/grass. If that directory already
    exists, then create ~/grass1 (etc). And put that into ~/.grassrc
    as the default directory.

    Yeah, I know, grass currently insists on wanting to know the
    default region. See "First".

r.in.tiff /tmp/O44075.tiff

    yeah, I know, r.in.tiff expects tagged arguments rather than
    positional. Why should I have to type input=foo and output=bar,
    when 99.99 times out of a hundred, the first argument is *always*
    the input and the second argument is *always* the output?

    Yeah, I know, r.in.tiff expects an output name as well. What's
    wrong with

d.rast

    Yeah, I know, d.rast wants a filename. If there's only one raster
    filename, why bother prompting for it?

    Yeah, I know, d.rast knows that I should run d.mon first. In the
    usual case, given the X11 window system, shouldn't d.rast simply start
    up x0 if it's not running already? Reasonable defaults make the
    newbie's life much easier.

And another thing: when I go into a location, grass should change my
current directory to be that of the location. And all of my datasets
should have an empty filename there, e.g. r.O44075. That way, I can
say "d.rast r.<tab>", and bash's filename completion makes my life
easier. Yeah, I know, that's not something a newbie would think of.
I'm so used to filename completion, though, that not having it is
painful.

Yes, I know that GIS is complicated, and there's a lot to know. But
at least you can do your best to have a learning curve that goes like
this:

| |
| |
| ... |
| .... |
| .... |
| ... |
| ... |
| .... |
| .... |
|..... |

instead of this:

| |
| |
| ............. |
| .......... |
| ....... |
| .. |
| . |
| . |
| . |
|. |

--
-russ nelson http://russnelson.com | Okay, enough is enough!
Crynwr sells support for free software | PGPok | Can we PLEASE all stop
521 Pleasant Valley Rd. | +1 315 268 1925 voice | using insecure Microsoft
Potsdam, NY 13676-3213 | +1 315 268 9201 FAX | email products???

Russell has a good point of view for the very first time user - all of us
already have
at least one GRASS location set-up so r.in.gdal will do a lot what Russell is
describing here,
however I have found from working with other people that
for the first timers the necessity to set up a region at the beginning is a
surprisingly big obstacle.
(well not so surprisingly, given the oldish interface for doing that)
I guess that the problem to getting this addressed is that most of the issues

mentioned below are not such big issues once you use GRAS a lot and
especially
with the improvements in r.in.gdal. (Russ use r.in.gdal instead of
r.in.tiff).
For example the issue of adapting the region to displayed map (as Carl has
mentioned
before) would drive you crazy if you are doing some modeling using a larger
number of
maps with different extent and resolutions and you need to preview those
maps, so that kind of behavior
should be optional and not default, but having GRASS create some default
LOCATION into which
data can be imported when it is started for the very first time may make life
easier for the newcomers.

when I go into a location, grass should change my
current directory to be that of the location.

By no means you would want to do that - you don't want to touch the stuff in
that directory
if you are newbie. Even for experienced users, you only very rarely want to
go there -
your current directory is best to be that of your current directory,
especially if you have
there some data that you want to import. All your files should be managed by
the g.* commands
so you do not have to go to your location.

I guess that these things won't change for GRASS5.0 but for GRASS5.1 there
are probably suggestions
already how to make the first startup of grass simpler.

Helena

Nelson wrote:

Okay, I will cheerfully label the following as a completely naive
opinion on how grass *should* work from the point of a newbie. If I
am saying something totally wrong or stupid, please say so. If you
want to say "Hey, great ideas, Russ. Here's your CVS login, go for
it!", that's a legitimate response as well.

First, its ridiculous to have to set the region just to run grass.
Completely unnecessary. Maybe some commands need to have a default
region. If so, they can say "Please run g.region first".

Second, images that are not georeferenced should *always* be imported
into an x,y projection, and d.rast should show the entire image by
default.

Third, when a map is georeferenced, *then* it goes into a location.

Third, no, wait, Fourth, the scope of a location should be determined
by the data stored in that location. Since all such data is
georeferenced (see "Third"), the bounds of the data set the scope of
the location, not vice-versa.

In other words, grass should be more approachable. I should be able
to go to a GIS clearinghouse (such as the New York State one at
Cornell), download a georeferenced map, run grass5 (for the first
time!) and be able to do this and have it work:

grass5

    yeah, I know, grass currently insists upon setting up a database.
    While that's arguably a good idea, so are defaults. If ~/.grassrc
    does not exist, then create ~/grass. If that directory already
    exists, then create ~/grass1 (etc). And put that into ~/.grassrc
    as the default directory.

    Yeah, I know, grass currently insists on wanting to know the
    default region. See "First".

r.in.tiff /tmp/O44075.tiff

    yeah, I know, r.in.tiff expects tagged arguments rather than
    positional. Why should I have to type input=foo and output=bar,
    when 99.99 times out of a hundred, the first argument is *always*
    the input and the second argument is *always* the output?

    Yeah, I know, r.in.tiff expects an output name as well. What's
    wrong with

d.rast

    Yeah, I know, d.rast wants a filename. If there's only one raster
    filename, why bother prompting for it?

    Yeah, I know, d.rast knows that I should run d.mon first. In the
    usual case, given the X11 window system, shouldn't d.rast simply start
    up x0 if it's not running already? Reasonable defaults make the
    newbie's life much easier.

And another thing: when I go into a location, grass should change my
current directory to be that of the location. And all of my datasets
should have an empty filename there, e.g. r.O44075. That way, I can
say "d.rast r.<tab>", and bash's filename completion makes my life
easier. Yeah, I know, that's not something a newbie would think of.
I'm so used to filename completion, though, that not having it is
painful.

Yes, I know that GIS is complicated, and there's a lot to know. But
at least you can do your best to have a learning curve that goes like
this:

| |
| |
| ... |
| .... |
| .... |
| ... |
| ... |
| .... |
| .... |
|..... |

instead of this:

| |
| |
| ............. |
| .......... |
| ....... |
| .. |
| . |
| . |
| . |
|. |

--
-russ nelson http://russnelson.com | Okay, enough is enough!
Crynwr sells support for free software | PGPok | Can we PLEASE all stop
521 Pleasant Valley Rd. | +1 315 268 1925 voice | using insecure Microsoft
Potsdam, NY 13676-3213 | +1 315 268 9201 FAX | email products???
_______________________________________________
grass5 mailing list
grass5@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass5

On May 2, Helena Mitasova wrote:
> Russell has a good point of view for the very first time user

I agree. I've wrestled with several of the exact same problems.

I still dislike everything involved with creating a new
location/region before starting in with the data.

> with the improvements in r.in.gdal. (Russ use r.in.gdal instead of
> r.in.tiff).

Oh? Does r.in.gdal do everything that r.in.riff and r.in.jpg do? If
so, why don't we drop some duplicate code away, (eg. leave r.in.tiff
merely as a symlink to r.in.gdal or some such)?

There's certainly no use in having two different implementations of
the same functionality.

> For example the issue of adapting the region to displayed map (as Carl has
> mentioned
> before) would drive you crazy if you are doing some modeling using a larger
> number of
> maps with different extent and resolutions and you need to preview those
> maps, so that kind of behavior
> should be optional and not default

Actually Helena, perhaps I was misunderstood.

I do not think that display commands should change the region. (There
is a problem that Russ and I both hit as new users doing d.rast and
not being able to figure out why nothing appeared. Maybe if a display
command is given a map which is entirely outside the current region a
useful message could be generated informing the user what happened and
what could be done to fix it?).

What I have proposed is disassociating monitor regions from the
concept of a "current region".

Each monitor must necessarily have a region associated with it,
(describing the extents of what actually appears within the
monitor). Currently, the monitor's region is the same as "The
Region". This is broken IMHO as it makes it almost impossible to
successfully go back and forth between multiple monitors viewing
different areas.

So, what I think we need is per-monitor regions.

Additionally, I think that wherever possible commands should be made
to operate without any specific region established by the user. This
would eliminate the need for the user to even specify a region in
order to start using GRASS.

Then, if a particular command must have a region that it cannot
compute from its input, then that command could request that the user
specify a region and explain how to do it.

-Carl

--
Carl Worth
USC Information Sciences Institute cworth@east.isi.edu
3811 N. Fairfax Dr. #200, Arlington VA 22203 703-812-3725

On Thu, May 02, 2002 at 04:42:21PM +0000, Carl Worth wrote:

On May 2, Helena Mitasova wrote:
> Russell has a good point of view for the very first time user

I agree. I've wrestled with several of the exact same problems.

I still dislike everything involved with creating a new
location/region before starting in with the data.

As a workaround I can provide a script to generate a LOCATION
from a raster map automatically (based on GDAL). Long time ago
I proposed to add this to a screen which appears earlier than
the standard startup screeen.

Once v.in.ogr is developed, above mentioned script can also
generate LOCATIONS from vector data. Of course this could be
done with more programming efforts already today, but I do not
find time for that.

If someone wants above "create_location.sh" (to be run outside
GRASS), let me know. The script is faking a GRASS environment to
make r.in.gdal working, then the create location feature of
r.in.gdal is used (yes, a dirty trick).

> with the improvements in r.in.gdal. (Russ use r.in.gdal instead of
> r.in.tiff).

Oh? Does r.in.gdal do everything that r.in.riff and r.in.jpg do? If
so, why don't we drop some duplicate code away, (eg. leave r.in.tiff
merely as a symlink to r.in.gdal or some such)?

The only problem with r.in.gdal is that the libgdal is required.
This caused problems sometimes in the past with conflicting
libstdc++ versions (perhaps no longer, not sure).

In general r.in.gdal is candidate to become renamed to r.import.

[... another thread maybe ...]

Markus

Helena Mitasova writes:
> set up a region at the beginning is a surprisingly big obstacle.
> (well not so surprisingly, given the oldish interface for doing that)

No, it's not the interface. Well, okay, it *is* the interface, but
more than that it's the necessary to know MORE than I really know.
Here's the questions I asked myself:

``1?? They're giving me a default lat/lon of 0N, 0E through 1N, 1E??
That's in the middle of the fricking ocean!! That doesn't make any
sense.''

``Cell resolution? What's a cell? How do I know what my cell
resolution is? I haven't even imported my first map, and it wants to
know what the resolution of the map is going to be? I have no
fricking idea.''

``Hrm. It doesn't accept "75.00W". Maybe "75 00'W". No, that's not
right either. How about "-75.00"? No, that doesn't work either. How
about "75.0000W"? How about "7500W"? ARRGGGGGHHHHHH!''

``Ahhhh, okay, it just wants integer degrees. But how big should I
make my region? Just the one map I want to do first, or should I make
it big enough to hold all fifty maps??''

> I guess that the problem to getting this addressed is that most of the
> issues mentioned below are not such big issues once you use GRAS a lot
> and especially with the improvements in r.in.gdal. (Russ use r.in.gdal
> instead of r.in.tiff).

It didn't get built on my machine because libgdal was missing.

> For example the issue of adapting the region
> to displayed map (as Carl has mentioned before) would drive you crazy
> if you are doing some modeling using a larger number of maps with
> different extent and resolutions and you need to preview those maps,

Wait a second. You mean that the region is only used for viewing??
Then why do I have to set it before doing anything in grass??

See how little I know?

> >when I go into a location, grass should change my
> >current directory to be that of the location.
>
> By no means you would want to do that - you don't want to touch the
> stuff in that directory if you are newbie.

You're right, I don't want to look in the subdirectories. But it
would be nice if filename completion worked. That way I could use
a-very-long-name-for-this-particular-dataset, and only have to type
a-v<TAB>. So since I don't want to look in the subdirectories, I
should have an empty file with the same name as the raster file.

--
-russ nelson http://russnelson.com | Okay, enough is enough!
Crynwr sells support for free software | PGPok | Can we PLEASE all stop
521 Pleasant Valley Rd. | +1 315 268 1925 voice | using insecure Microsoft
Potsdam, NY 13676-3213 | +1 315 268 9201 FAX | email products???

Carl Worth writes:
> Maybe if a display command is given a map which is entirely outside
> the current region a useful message could be generated informing
> the user what happened and what could be done to fix it?).

That's an excellent idea. Tell the user "You asked for a view
entirely off the selected map. Use d.region rast=map to move the view
onto the location of your map."

> Then, if a particular command must have a region that it cannot
> compute from its input, then that command could request that the user
> specify a region and explain how to do it.

Yup, yup!

--
-russ nelson http://russnelson.com | Okay, enough is enough!
Crynwr sells support for free software | PGPok | Can we PLEASE all stop
521 Pleasant Valley Rd. | +1 315 268 1925 voice | using insecure Microsoft
Potsdam, NY 13676-3213 | +1 315 268 9201 FAX | email products???

Russell Nelson wrote:

> set up a region at the beginning is a surprisingly big obstacle.
> (well not so surprisingly, given the oldish interface for doing that)

No, it's not the interface. Well, okay, it *is* the interface, but
more than that it's the necessary to know MORE than I really know.
Here's the questions I asked myself:

``1?? They're giving me a default lat/lon of 0N, 0E through 1N, 1E??

Not quite; it's the origin of the current coordinate system, which may
or may not be a lat/lon coordinate system.

The image has to go somewhere. The alternative is for all of the
programs which import uncorrelated images to insist that the user
specifies the boundaries on the command line.

``Cell resolution? What's a cell? How do I know what my cell
resolution is? I haven't even imported my first map, and it wants to
know what the resolution of the map is going to be? I have no
fricking idea.''

The user may or may not know what resolution they want, but GRASS
absolutely cannot know. The same applies to the region boundaries.

Note that the resolution specified when creating a location is the
default for the resolution setting which GRASS uses when creating new
raster maps. This doesn't have to correspond to the resolution of any
maps which you import. And you can change the actual output resolution
from its default value with g.region.

For vector and sites maps, the resolution doesn't matter.

``Hrm. It doesn't accept "75.00W". Maybe "75 00'W". No, that's not
right either. How about "-75.00"? No, that doesn't work either. How
about "75.0000W"? How about "7500W"? ARRGGGGGHHHHHH!''

``Ahhhh, okay, it just wants integer degrees. But how big should I
make my region? Just the one map I want to do first, or should I make
it big enough to hold all fifty maps??''

Again, you can change the actual region boundaries at any time with
g.region.

> I guess that the problem to getting this addressed is that most of the
> issues mentioned below are not such big issues once you use GRAS a lot
> and especially with the improvements in r.in.gdal. (Russ use r.in.gdal
> instead of r.in.tiff).

It didn't get built on my machine because libgdal was missing.

By default, r.in.gdal should be built regardless of whether you have
libgdal. However, it won't actually run unless libgdal is present.

> For example the issue of adapting the region
> to displayed map (as Carl has mentioned before) would drive you crazy
> if you are doing some modeling using a larger number of maps with
> different extent and resolutions and you need to preview those maps,

Wait a second. You mean that the region is only used for viewing??

No. As well as viewing, the region is also used when generating new
raster maps (which is probably *the* most important function of
GRASS).

--
Glynn Clements <glynn.clements@virgin.net>

On Thursday 02 May 2002 09:18, Russell Nelson wrote:

Okay, I will cheerfully label the following as a completely naive
opinion on how grass *should* work from the point of a newbie. If I
am saying something totally wrong or stupid, please say so. If you
want to say "Hey, great ideas, Russ. Here's your CVS login, go for
it!", that's a legitimate response as well.

I agree completely that this is a naive opinion. That doesn't mean it's
wrong. I went through some of this when I first started and from the number
of very similar comments we get I have to conclude that pretty much every new
user runs into the same difficulty.

Our main problem is how to fix the start-up problems without losing or
over-complicating functions that may be difficult to set up, but which are
important, easy-to-use tools for a more experienced user. Our other problem
is how we should prioritize a problem that effects new users once and not
again when we have other problems to work out that effect all users all the
time.

Most of what's below is not suited to the developers' list. This is
cross-posted to the user's list and non-programmng follow up should be posted
there.

First, its ridiculous to have to set the region just to run grass.
Completely unnecessary. Maybe some commands need to have a default
region. If so, they can say "Please run g.region first".

A lot (most ?) commands need a region, so this suggestion would probably
cause the majority of the GRASS modules to bail out. It would be annoying in
no time. Just the same, there should be some reasonable default behavior
when a region is not set. I think that's something that can be fixed.

Second, images that are not georeferenced should *always* be imported
into an x,y projection, and d.rast should show the entire image by
default.

You *always* have the option of importing non-georeferenced images into an XY
location, but that isn't generally necessary or useful. I don't see much
reason to force that behavior. Moreover, it wouldn't be reasonable to force
that behavior on imported vector or sites files. GRASS doesn't have much of
a way to determine when those files are georeferenced and when they're not.
I think we can reasonably expect the user to provide that information.

Third, when a map is georeferenced, *then* it goes into a location.

Georeferencing a bitmap should move it to a different database location?
Regardless of how it becomes georeferenced? I think again that this is the
responsibility of the user.

Third, no, wait, Fourth, the scope of a location should be determined
by the data stored in that location. Since all such data is
georeferenced (see "Third"), the bounds of the data set the scope of
the location, not vice-versa.

I'm not sure what you mean by "scope of the location." I think you mean the
default region, but you might mean some kind of automatically set current
region. As near as I can tell, I think that would be a bad idea. Let me
give an example.

I have a database location named "Panhandle" in an albers equal area
projection. The location includes one file imported from the national atlas
of the US. With your suggestion this location would have a "scope" that
covered the entire continental US. The purpose of the location is to allow
me to work with a ground water model centered over the northern Texas
panhandle area so that I can work over details of the model within an area
that is no bigger than 15 miles by 25 miles.

Anything that resets my region to the continental US would be annoying at
best. As is, I have a region defined for my local area, another region
defined (with a different resolution) for a larger sub-regional area and
another region (the default region) that covers the whole area of the model.
I have no need for any kind of "scope" that covers the continental US.

I think a lot of us work with data from variable scales and locations, so a
lot of us probably would react the same way.

In other words, grass should be more approachable. I should be able
to go to a GIS clearinghouse (such as the New York State one at
Cornell), download a georeferenced map, run grass5 (for the first
time!) and be able to do this and have it work:

That's an achievable goal. I'd like to see it happen and as Helena pointed
out it is actually possible to do that now with r.in.gdal. But we have
problems. You only need that capability once per project. So what happens
if you import a map that doesn't fit the current region? Does GRASS create a
new database location? A new mapset in the current location? You could end
up with an entirely different database location for each map you import. I
don't think you want to do that, and it certainly isn't the way that GRASS
was intended to work.

I don't think we want default behavior that would create a new location or
even a new mapset for every imported map that doesn't agree with the current
location or region. It might be reasonable to provide an option to create a
new location or region based on the information in the map, but the header
information may not contain all the necessary data (information on the
projection, in particular). Some other source of information will generally
be needed.

grass5

    yeah, I know, grass currently insists upon setting up a database.
    While that's arguably a good idea, so are defaults. If ~/.grassrc
    does not exist, then create ~/grass. If that directory already
    exists, then create ~/grass1 (etc). And put that into ~/.grassrc
    as the default directory.

    Yeah, I know, grass currently insists on wanting to know the
    default region. See "First".

GRASS does need to have and use a more comprehensive set of reasonable
defaults.

r.in.tiff /tmp/O44075.tiff

    yeah, I know, r.in.tiff expects tagged arguments rather than
    positional. Why should I have to type input=foo and output=bar,
    when 99.99 times out of a hundred, the first argument is *always*
    the input and the second argument is *always* the output?

I think all of the user modules use the same parser. That has good side
effects (simple programming, consistent interface) and some bad side effects
(not much individual flexibility). In general the first argument is *not*
input and the second argument is *not* output.

    Yeah, I know, r.in.tiff expects an output name as well. What's
    wrong with

d.rast

    Yeah, I know, d.rast wants a filename. If there's only one raster
    filename, why bother prompting for it?

We should program in an exception for the fairly bizarre instance of a mapset
with only one raster file? Personally I think there's a lot more important
issues.

    Yeah, I know, d.rast knows that I should run d.mon first. In the
    usual case, given the X11 window system, shouldn't d.rast simply start
    up x0 if it's not running already? Reasonable defaults make the
    newbie's life much easier.

That sounds workable.

And another thing: when I go into a location, grass should change my
current directory to be that of the location. And all of my datasets
should have an empty filename there, e.g. r.O44075. That way, I can
say "d.rast r.<tab>", and bash's filename completion makes my life
easier. Yeah, I know, that's not something a newbie would think of.
I'm so used to filename completion, though, that not having it is
painful.

Absolutely not. I think you misunderstand the role and structure of the
GRASS database. Ideally once the database is set up you should never have
to worry about where the database is or how it's structured. GRASS provides
tools to access and manage the data base and those are what you should be
using, not shell tricks and not unix utilities.

That said, I think the GRASS database structure needs a little work.

Yes, I know that GIS is complicated, and there's a lot to know. But
at least you can do your best to have a learning curve that goes like

I get the impression that you entered into GRASS without a project, only a
simple example problem -- an unreferenced tiff file that you wanted to view.
That would make startup a little more difficult, because if that's your goal
then all of the GIS details seem annoying and unnecessary. If you actually
have a project, with data that needs to be stored and served then GRASS'
setup requirements are more understandable and the learning curve might look
a little different.

Roger Miller

Roger Miller writes:
> Our main problem is how to fix the start-up problems without losing or
> over-complicating functions that may be difficult to set up, but which are
> important, easy-to-use tools for a more experienced user. Our other problem
> is how we should prioritize a problem that effects new users once and not
> again when we have other problems to work out that effect all users all the
> time.

You're assuming that a problem that affects new users once will not
cause them to give up in disgust and throw money at ESRI. I hope it's
not your intention that GRASS be "the software you run when you can't
afford anything good."

> Most of what's below is not suited to the developers' list.

Sure it is. You made grass work the way it does (or at least have
have not fixed these problems), and you need to hear about them.

> > First, its ridiculous to have to set the region just to run grass.
> > Completely unnecessary. Maybe some commands need to have a default
> > region. If so, they can say "Please run g.region first".
>
> A lot (most ?) commands need a region, so this suggestion would probably
> cause the majority of the GRASS modules to bail out. It would be annoying in
> no time. Just the same, there should be some reasonable default behavior
> when a region is not set. I think that's something that can be fixed.

Exactly. Reasonable defaults.

> > Second, images that are not georeferenced should *always* be imported
> > into an x,y projection, and d.rast should show the entire image by
> > default.
>
> You *always* have the option of importing non-georeferenced images into an XY
> location, but that isn't generally necessary or useful.

Let me explain the problem that I'm trying to solve. I want to reduce
the learning curve. I want early rewards. I want a new grass user to
be able to see her map by running three commands: "grass5, r.in.png
image, d.rast". Apparently, if you actually set up a reasonable
region, and then import a map, it's not *in* the region you just
specified.

> > Third, when a map is georeferenced, *then* it goes into a location.
>
> Georeferencing a bitmap should move it to a different database location?
> Regardless of how it becomes georeferenced? I think again that this is the
> responsibility of the user.

Remember: you understand how GRASS works now. A newbie understands
how grass *should* work. A user makes a mental model of how things
work, and they quickly get frustrated if that mental model never
results in useful predictions. And then they become a former user,
and GRASS hater. "Yeah, I tried GRASS, fiddled with it for a couple
of hours, but never got it to do anything."

Running GRASS as it currently works results in newbie frustration, for
no good reason that I can understand.

> > Third, no, wait, Fourth, the scope of a location should be determined
> > by the data stored in that location. Since all such data is
> > georeferenced (see "Third"), the bounds of the data set the scope of
> > the location, not vice-versa.
>
> I'm not sure what you mean by "scope of the location." I think you mean the
> default region, but you might mean some kind of automatically set current
> region. As near as I can tell, I think that would be a bad idea. Let me
> give an example.

I'm asking for reasonable defaults. If I load a georeferenced map
(e.g. GeoTIFF) into an empty location, is there any reason not to set
the default region to that of the map? Maybe it's simply that
"location" is badly named, and should be instead called "dataset" or
"project" or "collection"?

See, here's what I was thinking when I first ran GRASS:

Hmmm... It's asking me for a location. That must mean the geographic
location of the data I'm going to load. But I don't know that! Why
can't it figure that out for me?? I can try guessing, but what if it
truncates the data that I load, so that it discards data outside the
box? I don't want that. I'd better set the box to be a little bigger
than what I need (herein insert a description of my difficulty in
setting the lat/lon region).

Okay, great, now I'm running GRASS! Now what? Oh, I see, I have to
import a raster. r.in., hmmmm, there's no r.in.jpeg, although there's
r.in.ppm and r.in.png. No matter, I'll just save my jpeg in png
format and load it with r.in.png.

Hmmm.... It refuses to load the image, something about "Illegal
latitude for North". At this point, I was completely hosed. Couldn't
do a damn thing. I purged my grass database, rm -rf ~/.grassrc5, and
started again.

Not sure what I did differently, but I got an image loaded.
Unfortunately, the image was loaded at 0,0 and I was looking much
farther northwest than that when I ran d.rast on the image.

Does it help for you to understand what I was thinking, and what I was
expecting?

> I think a lot of us work with data from variable scales and locations, so a
> lot of us probably would react the same way.

My suggestion was based on a wrong conception of what the default
region was going to accomplish. In fact, you don't need to set the
default region *at all* in order to load a map into a location. And
setting it to anything but zero was the wrong thing to do. I would
have had more success if I'd simply left it alone and accepted the
defaults.

Where did I go wrong? It was in thinking that the default region was
somehow associated with setting a boundary box on any and all data
that I loaded. If I'm the only person who was misled, then fine, it's
just a fluke. Otherwise, *something* needs to be changed. Perhaps
it's something as simple as NOT asking for the default region, but
instead setting it to the current defaults of (0,0,1,1), and
automagically setting it when a user loads the first map (or even
suggesting "You might want to set the default region using g.region
blahblahblah".) It might be causing d.rast to emit a warning when the
raster and the region do not overlap.

> > In other words, grass should be more approachable. I should be able
> > to go to a GIS clearinghouse (such as the New York State one at
> > Cornell), download a georeferenced map, run grass5 (for the first
> > time!) and be able to do this and have it work:
>
> That's an achievable goal. I'd like to see it happen and as Helena pointed
> out it is actually possible to do that now with r.in.gdal. But we have
> problems. You only need that capability once per project. So what happens
> if you import a map that doesn't fit the current region?

I have no idea (newbie, remember?). I'm not sure what happens now.
It might discard any data that doesn't overlap the current region. Or
it might load the data, but when you run d.rast on it, never show it
to you.

> GRASS does need to have and use a more comprehensive set of reasonable
> defaults.

What would break to use a region of 0,0,1,1, and simply not ask for
a default region?

> I think all of the user modules use the same parser. That has good side
> effects (simple programming, consistent interface) and some bad side effects
> (not much individual flexibility). In general the first argument is *not*
> input and the second argument is *not* output.

tagged arguments are fine when the arguments are optional. If the
arguments are required, they may as well be positional. Seems to me
like the parser could easily be extended so that a command could tell
the parser "my first positional argument goes to input=, and my second
goes to output=".

I could go into this whole rant about how people are used to
expressing ideas in sequence, but if you disagreed with me, read it
unable you would be to.

> > Yeah, I know, d.rast wants a filename. If there's only one raster
> > filename, why bother prompting for it?
>
> We should program in an exception for the fairly bizarre instance of a mapset
> with only one raster file?

When a newbie first loads a raster, that's the only raster he's going
to have. That is not a "fairly bizarre instance". From the newbie's
point of view, it's normal (everything a newbie does is normal).

> Personally I think there's a lot more important issues.

I *did* point out that I'm not unwilling to submit patches.

> > And another thing: when I go into a location, grass should change my
> > current directory to be that of the location. And all of my datasets
> > should have an empty filename there, e.g. r.O44075.
>
> Absolutely not. I think you misunderstand the role and structure of the
> GRASS database.

No, I'm not that kind of a newbie. I'm a newbie who is completely
familiar with Unix, and databases and data structures. I can see that
different data is stored in different files. What I'm asking for is
the ability to use the Unix shell's ability to expand a filename found
in the current directory. As long as we're going to have to type into
a shell, we may as well work *with* the shell instead of against it.

> Ideally once the database is set up you should never have
> to worry about where the database is or how it's structured. GRASS provides
> tools to access and manage the data base and those are what you should be
> using, not shell tricks and not unix utilities.

What tool do I use to enter the raster name
This-is-the-historical-map-of-the-Potsam-Quad? without having to type
the whole thing?

> I get the impression that you entered into GRASS without a project, only a
> simple example problem -- an unreferenced tiff file that you wanted to view.
> That would make startup a little more difficult, because if that's your goal
> then all of the GIS details seem annoying and unnecessary. If you actually
> have a project, with data that needs to be stored and served then GRASS'
> setup requirements are more understandable and the learning curve might look
> a little different.

Your impression is wrong. I have 60 maps I want to splice together
and georeference. I'm going to start with only one of them. So far
I'm having no luck with the *real* data, because r.in.png complains
that I have too many colors when I ask for 16, and my X server
mysteriously crashes on an illegal instruction when I ask for 24.

I've tried loading a georeferenced tiff, and r.in.tiff segfaults, so I
tried loading a png which is created from just a portion of that tiff,
and W00 H00 I actually can see it (after wiping grassdata and
.grassrc5, and starting afresh).

Now, I'm the Vice President of the Open Source Initiative, so
drop-kicking GRASS and switching to something proprietary and usable
is not an option. GRASS is my only option, so I've got to stick it
out. That doesn't mean I'm going to suffer in silence or suffer
alone, though.

--
-russ nelson http://russnelson.com | Okay, enough is enough!
Crynwr sells support for free software | PGPok | Can we PLEASE all stop
521 Pleasant Valley Rd. | +1 315 268 1925 voice | using insecure Microsoft
Potsdam, NY 13676-3213 | +1 315 268 9201 FAX | email products???

Glynn Clements writes:
> Again, you can change the actual region boundaries at any time with
> g.region.

Aha! That wasn't obvious to me. I thought that, because GRASS was
asking me for the default region for the location, that I needed to
set it before loading anything. Newbies make up these weird
requirements and restrictions all the time. Why? Because they're
trying to make sense of the world. Children do the same thing when
they're really young. My daughter refused to wear pants when she was
very young because "they make me a boy". I think she *really* thought
that she had to wear dresses in order to remain female.

> > It didn't get built on my machine because libgdal was missing.
>
> By default, r.in.gdal should be built regardless of whether you have
> libgdal. However, it won't actually run unless libgdal is present.

Yes, I thought it was built improperly because it didn't run.

> > > For example the issue of adapting the region
> > > to displayed map (as Carl has mentioned before) would drive you crazy
> > > if you are doing some modeling using a larger number of maps with
> > > different extent and resolutions and you need to preview those maps,
> >
> > Wait a second. You mean that the region is only used for viewing??
>
> No. As well as viewing, the region is also used when generating new
> raster maps (which is probably *the* most important function of
> GRASS).

Double aha! Okay, so I suggest these changes:

1) don't ask for a default region. If a program needs one, it should
   say "Please set the region that this program should write to using g.region".
2) if there is no default region, then
   a) the first d.WHATEVER should set a region for the monitor (and
      say "No default region. Using a region that fits the WHATEVER".)
   b) it should stay set until d.erase, and
   c) if a data set is displayed but no part of it overlaps the
      monitor's region, then the displaying program should say so.
      "No part of this dataset was in the region".

I think some people are going to say "Well, but if you'd only *learn*
how to use GRASS, you wouldn't *want* these features." They're
probably right, but they're already past the steep part of the
learning curve. They've forgotten what it's like to be totally
clueless. I'm already starting, which is why I'm being so
vociferous and voluminous. Newbie experiences are precious because
they're not repeatable.

--
-russ nelson http://russnelson.com | Okay, enough is enough!
Crynwr sells support for free software | PGPok | Can we PLEASE all stop
521 Pleasant Valley Rd. | +1 315 268 1925 voice | using insecure Microsoft
Potsdam, NY 13676-3213 | +1 315 268 9201 FAX | email products???

Russell Nelson wrote:

> > > For example the issue of adapting the region
> > > to displayed map (as Carl has mentioned before) would drive you crazy
> > > if you are doing some modeling using a larger number of maps with
> > > different extent and resolutions and you need to preview those maps,
> >
> > Wait a second. You mean that the region is only used for viewing??
>
> No. As well as viewing, the region is also used when generating new
> raster maps (which is probably *the* most important function of
> GRASS).

Even more significantly, it's also used when reading existing raster
maps. With a few exceptions, input maps are resampled according to the
current region settings.

Double aha! Okay, so I suggest these changes:

1) don't ask for a default region. If a program needs one, it should
   say "Please set the region that this program should write to using g.region".

But *most* programs need a region. The region concept is so pervasive
that it just isn't worth complicating the majority of programs to
allow for the possibility of there not being a current region.
Especially when all that it would achieve would be to allow newbies to
defer learning about the region for a minute or two.

It might be worth making it easier to automatically create a suitable
location when importing a raster. But the main problem there is that
the data being imported is frequently uncorrelated, so the projection
and the coordinates *must* be specified by the user.

--
Glynn Clements <glynn.clements@virgin.net>

Russell Nelson wrote:

Let me explain the problem that I'm trying to solve. I want to reduce
the learning curve. I want early rewards. I want a new grass user to
be able to see her map by running three commands: "grass5, r.in.png
image, d.rast".

You can see it in one command: "display image.png" (replace "display"
with your preferred image viewer).

If all that you are going to do is import an image then look at it,
GRASS is the wrong package. GRASS isn't an image viewer, and it isn't
a cartographic package. It's primary function is analysis, and the
"boilerplate" involved in setting-up is trival compared to (intended)
typical usage.

> > Third, when a map is georeferenced, *then* it goes into a location.
>
> Georeferencing a bitmap should move it to a different database location?
> Regardless of how it becomes georeferenced? I think again that this is the
> responsibility of the user.

Remember: you understand how GRASS works now. A newbie understands
how grass *should* work. A user makes a mental model of how things
work, and they quickly get frustrated if that mental model never
results in useful predictions. And then they become a former user,
and GRASS hater. "Yeah, I tried GRASS, fiddled with it for a couple
of hours, but never got it to do anything."

The kind of user for which GRASS is likely to be the right solution is
probably not going to evaluate it by "fiddling with it for a couple of
hours".

When it comes to the simplicity-vs-functionality tradeoff, GRASS leans
more heavily towards the functionality end of the scale than is the
norm these days. Sure, simplicity is important; but reliability,
flexibility and functionality are more important, IMHO.

BTW, I'm not suggesting that GRASS is particuarly excellent on those
aspects either. There is a lot of code (comparable to XFree86), much
of which has rough edges, and only around a dozen developers (of
varying degrees of activity).

> > Third, no, wait, Fourth, the scope of a location should be determined
> > by the data stored in that location. Since all such data is
> > georeferenced (see "Third"), the bounds of the data set the scope of
> > the location, not vice-versa.
>
> I'm not sure what you mean by "scope of the location." I think you mean the
> default region, but you might mean some kind of automatically set current
> region. As near as I can tell, I think that would be a bad idea. Let me
> give an example.

I'm asking for reasonable defaults. If I load a georeferenced map
(e.g. GeoTIFF) into an empty location, is there any reason not to set
the default region to that of the map?

Yes; the default region is explicitly chosen by the user. Same for the
current region. The only time that the current region is changed is if
the user decides to change it.

If the user wants to change the region to match a particular map, they
can use e.g. "g.region rast=map".

> I think all of the user modules use the same parser. That has good side
> effects (simple programming, consistent interface) and some bad side effects
> (not much individual flexibility). In general the first argument is *not*
> input and the second argument is *not* output.

tagged arguments are fine when the arguments are optional. If the
arguments are required, they may as well be positional.

Tags have a mnemonic value which positions lack. The case where you
have one "input" and one "output" parameter isn't sufficiently common
to make it a special case. Many commands have either multiple outputs,
multiple inputs, or a choice as to the form of the input.

> > Yeah, I know, d.rast wants a filename. If there's only one raster
> > filename, why bother prompting for it?
>
> We should program in an exception for the fairly bizarre instance of a mapset
> with only one raster file?

When a newbie first loads a raster, that's the only raster he's going
to have.

Not necessarily; the user may well have access to pre-existing maps,
installed by their co-workers, tutor, or even the default GRASS
installation.

That is not a "fairly bizarre instance". From the newbie's
point of view, it's normal (everything a newbie does is normal).

"Bizarre" is a subjective term, but having exactly one raster map
available is objectively an unusual situation. Sufficiently unusual
that it's not worth adding special-case code for.

There's also the consistency issue. IMHO, it's preferable for an
option to always be required than for it to almost always be required.

It's one thing if an option is required or not depending upon other
options (i.e. you have to specify either "foo=..." or "bar=..."), but
introducing a dependency upon environment (e.g. how many raster maps
are in the current location) complicates the general case to simplify
a special case.

> Personally I think there's a lot more important issues.

I *did* point out that I'm not unwilling to submit patches.

The adding code isn't just about whether the code is available. One of
GRASS' main problems is the sheer volume of code present, given the
small number of active developers. Any increase in quantity or
complexity has to be justified.

> > And another thing: when I go into a location, grass should change my
> > current directory to be that of the location. And all of my datasets
> > should have an empty filename there, e.g. r.O44075.
>
> Absolutely not. I think you misunderstand the role and structure of the
> GRASS database.

No, I'm not that kind of a newbie. I'm a newbie who is completely
familiar with Unix, and databases and data structures. I can see that
different data is stored in different files. What I'm asking for is
the ability to use the Unix shell's ability to expand a filename found
in the current directory. As long as we're going to have to type into
a shell, we may as well work *with* the shell instead of against it.

The same problem applies to anything which accepts "names" as input.
Having tab completion would be nice, but it isn't the one-and-only
factor in determining the structure of the database.

--
Glynn Clements <glynn.clements@virgin.net>

On May 3, Glynn Clements wrote:
> > 1) don't ask for a default region. If a program needs one, it should
> > say "Please set the region that this program should write to using g.region".
>
> But *most* programs need a region. The region concept is so pervasive
> that it just isn't worth complicating the majority of programs to
> allow for the possibility of there not being a current region.
> Especially when all that it would achieve would be to allow newbies to
> defer learning about the region for a minute or two.

I don't agree with this.

Most vector modules have no use whatsoever for a region.

Most raster modules do use the region, but in most cases, it would be
suitable for these modules to just operate based on the input provided
to them, (extents determined by the union of maps, and resolution
determined by maximum).

I know that experienced GRASS users will say, "But that would bloat my
data! I want to be able to specify a default region to control what
happens!". To which I say, yes, set the region as you want it. But
there really is no reason that I can see that a user *must* set a
default region for the majority of GRASS commands.

Similarly, there are some modules that are currently discarding data
based on the default region. This caused me no end of confusion as a
new GRASS user. I wrestled with the same problem Russell has. "How do
I make suer my region is big enough? When I import data, will it clip
my data according to my region? I know my data is already
georeferenced, but I don't know the details of the file format to be
able to dig into it manually and figure out its extents in advance to
create a region -- besides, that's the computer's job and not
mine. So, what do I do? I'd better make the region huge and the
resolution extremely precise just to be safe..."

This chain of thought led me to do things that were much less optimal
in terms of storage/processing power required than if I could just
GRASS to deal with extents/resolutions based on what it is given and
not destroy information unless I specifically requested that, (eg. by
setting a default "clip_region" or some such).

Also, the current sharing of one region for separate purposes,
(eg. determining raster generation resolution, determining monitor
viewing parameters, clipping the output of modules), is extremely
problematic. I've zoomed in on a monitor to see something in more
detail, then been baffled when I couldn't get s.out.ascii to give any
output when it had been working previously.

Again, the principles should be:

  Provide sane defaults for everything.

  Don't require the user to provide more information than is
  truly necessary to get the job done. The job might not be done
  in the most optimal fashion, but rely on the sane defaults,
  (see above), to still be able to function with less user
  input.

  Never destroy information without the user explicitly
  requesting it.

-Carl

--
Carl Worth
USC Information Sciences Institute cworth@east.isi.edu
3811 N. Fairfax Dr. #200, Arlington VA 22203 703-812-3725

Russell Nelson wrote:

Carl Worth writes:
> Maybe if a display command is given a map which is entirely outside
> the current region a useful message could be generated informing
> the user what happened and what could be done to fix it?).

That's an excellent idea. Tell the user "You asked for a view
entirely off the selected map. Use d.region rast=map to move the view
onto the location of your map."

Maybe we can also add a flag (-a for "all" ?) to d.rast, d.vect and d.site.
The effect would be to change the current region so it will reflect the
raster, vector or dite file geographic extension before display ?

I guess this is relatively straithforward (some 20-30 lines of code :
a new flag to add in the parser, a call to G_put_window(), and run
d.erase before displaying the raster file.

A script that call g.region, d.erase and d.rast will do the same...

--
Michel WURTZ - DIG - Maison de la télédétection
               500, rue J.F. Breton
               34093 MONTPELLIER Cedex 5

On May 3, Glynn Clements wrote:
  > Yes; the default region is explicitly chosen by the user. Same for the
> current region. The only time that the current region is changed is if
> the user decides to change it.

Except when the suer is just panning/zooming around a map and the
region is being adjusted all the time. :wink:

A d.* command like d.zoom should really not be causing effects similar
to what happens with a g.* command such as g.region.

I think that monitors should keep track of their own
extents/resolution independent of the "current region". If the user
does want to set the current region to that of a monitor, then that
should be through:

  g.region monitor=x0

or some such.

> > tagged arguments are fine when the arguments are optional. If the
> > arguments are required, they may as well be positional.
>
> Tags have a mnemonic value which positions lack. The case where you
> have one "input" and one "output" parameter isn't sufficiently common
> to make it a special case. Many commands have either multiple outputs,
> multiple inputs, or a choice as to the form of the input.

Uhm, doesn't the GRASS option parser already allow for a single
positional parameter? If I recall correctly, the notion is that if a
parameter is missing a tag then is taken to be the value of the first
parameter identified by the programmer.

This is extremely useful for many modules which need only a single
parameter.

It seems to me to that Russell is merely suggesting a generalization
of that technique to allow both positional and tagged parameters when
that makes sense. He also provided a useful criterion for determining
when positional parameter could be used:

  tagged arguments are fine when the arguments are optional. If the
  arguments are required, they may as well be positional.

And nothing needs to be "special cased" here. Obviously, this is
functionality that can be abstracted and exported by the options
parser.

There's one very simple way to do this that would be a natural
extension of the existing rule and would be immediately useful for
many modules:

  For each argument provided without a tag name, take it as the
  value for each option defined by the module.

One way to end up with fewer required parameters is to, again, adopt
sane defaults. For example:

  r.in.tiff roads.tiff

might as well create a GRASS raster named roads. If you respond that,
"Yes, but all my tiffs have names like TR01CATD that are not only not
useful, but clash across different datasets!", then my response would
be to use:

  r.in.tiff TR01CATD.tiff out=roads

or, even better, combining with my discussion of positional parameters
above:

  r.in.tiff TR01CATD.tiff roads

-Carl

--
Carl Worth
USC Information Sciences Institute cworth@east.isi.edu
3811 N. Fairfax Dr. #200, Arlington VA 22203 703-812-3725

Carl Worth writes:
> Again, the principles should be:
>
> Provide sane defaults for everything.
>
> Don't require the user to provide more information than is
> truly necessary to get the job done. The job might not be done
> in the most optimal fashion, but rely on the sane defaults,
> (see above), to still be able to function with less user
> input.
>
> Never destroy information without the user explicitly
> requesting it.

I agree with everything Carl said above.

I'm a little disturbed by some of what some people have written.
There seems to be this idea of "Well, GIS is hard, so don't be
surprised if GRASS isn't easy to use." I think that's entirely the
wrong idea. It should be exactly the other way around: "Well, GIS is
hard, so we should make GRASS easy to use."

--
-russ nelson http://russnelson.com | Okay, enough is enough!
Crynwr sells support for free software | PGPok | Can we PLEASE all stop
521 Pleasant Valley Rd. | +1 315 268 1925 voice | using insecure Microsoft
Potsdam, NY 13676-3213 | +1 315 268 9201 FAX | email products???

Glynn Clements writes:
> Even more significantly, it's also used when reading existing raster
> maps. With a few exceptions, input maps are resampled according to the
> current region settings.

Didn't people just tell me that I could change it any time I wanted?
How can I do that if my input maps got resampled?

Okay, so in order to learn anything, I have to know everything?? This
is NOT good. GRASS should allow me to import a raster map, and should
set the region to match it, if it's the first map loaded. If I import
another map, and it's going to be clipped (I don't know -- is it??),
or resampled (apparently), then the r.in.* program should say so.

GRASS should *always* do the right thing by default, and say what it
did. If a user asks it to do something that doesn't make sense, GRASS
should do it anyway, and print a warning.

> But *most* programs need a region. The region concept is so pervasive
> that it just isn't worth complicating the majority of programs to
> allow for the possibility of there not being a current region.

You could be quite right. Please respect my newbie experience telling
you that region-setting is difficult and confusing. The defaults are
not reasonable and have no relationship to the data I'm trying to
import or view.

> Especially when all that it would achieve would be to allow newbies to
> defer learning about the region for a minute or two.

Even if all they can do is run grass and type "help", that is a
valuable addition. I think you've forgotten how frustrating it is not
even to be able to start up a program without needing to be an expert!
I appreciate your expertise, and thank you for responding to my
concerns. But understand that my ignorance is valuable, too (while it
lasts :).

> It might be worth making it easier to automatically create a suitable
> location when importing a raster. But the main problem there is that
> the data being imported is frequently uncorrelated, so the projection
> and the coordinates *must* be specified by the user.

Unless it's already georeferenced. I thought that was the whole point
of GeoTIFF -- to carry the projection and coordinates around with the
raster data itself.

--
-russ nelson http://russnelson.com | Okay, enough is enough!
Crynwr sells support for free software | PGPok | Can we PLEASE all stop
521 Pleasant Valley Rd. | +1 315 268 1925 voice | using insecure Microsoft
Potsdam, NY 13676-3213 | +1 315 268 9201 FAX | email products???

Glynn Clements writes:
> Russell Nelson wrote:
>
> > Let me explain the problem that I'm trying to solve. I want to reduce
> > the learning curve. I want early rewards. I want a new grass user to
> > be able to see her map by running three commands: "grass5, r.in.png
> > image, d.rast".
>
> If all that you are going to do is import an image then look at it,
> GRASS is the wrong package.

What's the *very* first thing a newbie is going to want to do? Load a
raster map and look at it. If you give somebody a hammer and a nail,
they're going to go looking for a piece of wood! That doesn't mean
that they don't want to do anything else! What it means is that they
want early feedback on whether their mental model of GRASS operation
is correct.

You don't have to believe me. Take one of your colleagues who has
never run GRASS, and sit them at the Unix prompt. Tell them to start
up grass5, give them a sample raster map, and watch what they do.
Heck, the very first tutorial I downloaded basically said "select the
spearfish location, start up a monitor and view a raster".

It can be very enlightening to watch a newbie try to use your
software. Some companies go so far as to videotape newbies as they
struggle (or not) with the software.

> The kind of user for which GRASS is likely to be the right solution is
> probably not going to evaluate it by "fiddling with it for a couple of
> hours".

You're right. They're not even going to play with it for that
long. They're going to fiddle with it for fifteen minutes, then go get
a purchase requisition for ARCInfo. C'mon, get real. It's not like
you have no competition. "GRASS sucks, but it's free" is not a very
persuasive advertising slogan!

If you think I'm nutso, I was just talking to someone from the NPS who
makes cave drainage maps. I asked if he used GRASS. He said "We used
to, but now we use ARCInfo".

> When it comes to the simplicity-vs-functionality tradeoff, GRASS leans
> more heavily towards the functionality end of the scale than is the
> norm these days. Sure, simplicity is important; but reliability,
> flexibility and functionality are more important, IMHO.

So is a shallow learning curve, if you want to have any users besides
dedicated free software partisans and people who are already experts
at GRASS and/or GIS.

> > I'm asking for reasonable defaults. If I load a georeferenced map
> > (e.g. GeoTIFF) into an empty location, is there any reason not to set
> > the default region to that of the map?
>
> Yes; the default region is explicitly chosen by the user. Same for the
> current region. The only time that the current region is changed is if
> the user decides to change it.

That is how it currently works. I am asking you to change it.

> If the user wants to change the region to match a particular map, they
> can use e.g. "g.region rast=map".

And if it's been resampled because I had no clue what I was doing when
I loaded the map???

> > When a newbie first loads a raster, that's the only raster he's going
> > to have.
>
> Not necessarily; the user may well have access to pre-existing maps,
> installed by their co-workers, tutor, or even the default GRASS
> installation.

Then they'll already have a default region set *for* them by somebody
who already knows what they're doing. Wouldn't it be nice if
everybody had that benefit?

> > That is not a "fairly bizarre instance". From the newbie's
> > point of view, it's normal (everything a newbie does is normal).
>
> "Bizarre" is a subjective term, but having exactly one raster map
> available is objectively an unusual situation. Sufficiently unusual
> that it's not worth adding special-case code for.

Everybody who first runs GRASS is going to have to go from zero maps
loaded to having one. It's not unusual at all.

> There's also the consistency issue. IMHO, it's preferable for an
> option to always be required than for it to almost always be required.

I think you're confusing consistency with user expectations. People
do not always expect consistency!

> It's one thing if an option is required or not depending upon other
> options (i.e. you have to specify either "foo=..." or "bar=..."), but
> introducing a dependency upon environment (e.g. how many raster maps
> are in the current location) complicates the general case to simplify
> a special case.

If that's what the user expects, then it's correct. Doesn't matter if
it makes the code more complicated. The customer is always correct --
and so is the user.

> > > Personally I think there's a lot more important issues.
> >
> > I *did* point out that I'm not unwilling to submit patches.
>
> The adding code isn't just about whether the code is available. One of
> GRASS' main problems is the sheer volume of code present, given the
> small number of active developers. Any increase in quantity or
> complexity has to be justified.

Perhaps, then, GRASS is not well organized. Rather than being a
single body of code, perhaps it should be a standard, and set of
programs? Unix has a well-defined API and many programs run under
Unix, and can interoperate with each other.

> The same problem applies to anything which accepts "names" as input.
> Having tab completion would be nice, but it isn't the one-and-only
> factor in determining the structure of the database.

Then maybe GRASS should use the GNU Readline library and explicitly
hand the name completion list to the library?

--
-russ nelson http://russnelson.com | Okay, enough is enough!
Crynwr sells support for free software | PGPok | Can we PLEASE all stop
521 Pleasant Valley Rd. | +1 315 268 1925 voice | using insecure Microsoft
Potsdam, NY 13676-3213 | +1 315 268 9201 FAX | email products???

On Fri, May 03, 2002 at 10:11:54AM -0400, Russell Nelson wrote:

Glynn Clements writes:
> Even more significantly, it's also used when reading existing raster
> maps. With a few exceptions, input maps are resampled according to the
> current region settings.

Didn't people just tell me that I could change it any time I wanted?
How can I do that if my input maps got resampled?

To clear up confusion: pretty much all import routines use the extents
and resolution of the source data. I'm not sure if there are any that
don't behave that way. And, pretty much every raster operation uses
the current region except where the semantics dictate working on the
whole extent/resolution of the raster (r.null, etc...).

GRASS should *always* do the right thing by default, and say what it
did. If a user asks it to do something that doesn't make sense, GRASS
should do it anyway, and print a warning.

Just having this discussion proves there isn't necessarily a "right
thing." You may have certain expectations based on other experiences
but other folks are just as likely to have different expectations.

> But *most* programs need a region. The region concept is so pervasive
> that it just isn't worth complicating the majority of programs to
> allow for the possibility of there not being a current region.

You could be quite right. Please respect my newbie experience telling
you that region-setting is difficult and confusing. The defaults are
not reasonable and have no relationship to the data I'm trying to
import or view.

It is a recognized fact, that the region concept trips up people new to
GRASS. However, it doesn't take long to get used to it, and it comes in
real handy at times as well (you'll just have to take my word on that :wink:

> Especially when all that it would achieve would be to allow newbies to
> defer learning about the region for a minute or two.

Even if all they can do is run grass and type "help", that is a
valuable addition. I think you've forgotten how frustrating it is not
even to be able to start up a program without needing to be an expert!
I appreciate your expertise, and thank you for responding to my
concerns. But understand that my ignorance is valuable, too (while it
lasts :).

Yes, GRASS could use some more introductory material. There used to be
a command called g.help, but it got woefully out of date and nobody
wanted to work on it. There've been some other discussions about
writing some tutorial documents that are current, so hopefully those
folks are charging ahead.

> It might be worth making it easier to automatically create a suitable
> location when importing a raster. But the main problem there is that
> the data being imported is frequently uncorrelated, so the projection
> and the coordinates *must* be specified by the user.

Unless it's already georeferenced. I thought that was the whole point
of GeoTIFF -- to carry the projection and coordinates around with the
raster data itself.

r.in.gdal fully supports GeoTIFF (among others). There are import
routines for some image types that don't have such information. r.in.bin
supports generic raw binary formats, for instance.

--
Eric G. Miller <egm2@jps.net>

On Fri, May 03, 2002 at 10:32:06AM -0400, Russell Nelson wrote:

Glynn Clements writes:

> The kind of user for which GRASS is likely to be the right solution is
> probably not going to evaluate it by "fiddling with it for a couple of
> hours".

You're right. They're not even going to play with it for that
long. They're going to fiddle with it for fifteen minutes, then go get
a purchase requisition for ARCInfo. C'mon, get real. It's not like
you have no competition. "GRASS sucks, but it's free" is not a very
persuasive advertising slogan!

If you think I'm nutso, I was just talking to someone from the NPS who
makes cave drainage maps. I asked if he used GRASS. He said "We used
to, but now we use ARCInfo".

If you are under the mistaken impression that Arc/Info is easier than
GRASS, you haven't used Arc/Info. There are a number of similarities
between the two.

There are several reasons most US gov't agencies use Arc/Info, not the
least of which has to do with file format compatibility and politics,
yes politics. It is the US federal governments policy not to produce
software that competes with commercial software. GRASS definitely was
in the category of competing with commercial software.

> The adding code isn't just about whether the code is available. One of
> GRASS' main problems is the sheer volume of code present, given the
> small number of active developers. Any increase in quantity or
> complexity has to be justified.

Perhaps, then, GRASS is not well organized. Rather than being a
single body of code, perhaps it should be a standard, and set of
programs? Unix has a well-defined API and many programs run under
Unix, and can interoperate with each other.

There are, what 200? different modules in GRASS. Each is basically a
separate command/program that uses a common API (or set of API's).
There is a lot of "environment" or "state" info that programs need to be
able to access. Anyway, the point is, there are only a few people
working on GRASS, on mostly on a part-time, sporadic basis. Big changes
by one party to can have a huge impact on everyone else. The API's for
GRASS have remained mostly stable for several years.

> The same problem applies to anything which accepts "names" as input.
> Having tab completion would be nice, but it isn't the one-and-only
> factor in determining the structure of the database.

Then maybe GRASS should use the GNU Readline library and explicitly
hand the name completion list to the library?

GRASS doesn't implement it's own shell and commands are separate
programs, so Readline isn't a magic bullet for argument completion.
If you don't know the arguments: "GRASS> command help" prints a
summary.

--
Eric G. Miller <egm2@jps.net>