Re: [GRASS-user] Original location: Hot to create from the command line ?

2009-01-20 Thread Peter Löwe


> >> > To be precise: If GRASS is started for the first time in "-text" mode
> >> > (=no GUI) ** without having a sample location like Spearfish or North
> >> > Carolina around**, how can location parameters (projection, extent,
> >> > EPSG...) be handed over to set up a very first location ?
> >>
> >> Just type in the name of the location you want to create and GRASS will
> >> prompt you for the parameters.
> >>
> >> Moritz
> >
> > That's true. But is there also a way to provide the parameters _without_
> interaction
> > with the user (-> GRASS scripting & automation) ?
> 
> Sure.
> An older version of a shell script is here:
>  http://www.grassbook.org/examples_menu2nd.php
>  -> create_location.sh
> 
> Keeping in mind
> http://grass.osgeo.org/wiki/GRASS_and_Shell#GRASS_Batch_jobs
> it should be even easier to write it.
> 
> Markus

Well, there seem still to be some issues to be dealt with:

I am defining all basic requirements for a location and GRASS session:

  #generate folders for temporal LOCATION and MAPSET
  mkdir -p $CURRENT_DIR/$THE_LOCATION/$THE_MAPSET

  #Set up a temporary grassrc-File:
  echo "GISDBASE: $CURRENT_DIR
  LOCATION_NAME: $THE_LOCATION
  MAPSET: $THE_MAPSET
  " > $TMPDIR/$THE_GRASSRC

 # Lets export the variables:
  export GISBASE=/opt/grass
  export PATH=$PATH:$GISBASE/bin:$GISBASE/scripts
  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GISBASE/lib

  # use process ID (PID) as lock file number:
  export GIS_LOCK=$$

The steps described so far (should) be sufficient to define a GRASS session, 
with newly created directories for the location and mapset.

Until this point, no information has been provided about the projection 
parameters.

This should be handled by the following commands:
g.proj -p [to see what the (default ?) project 
is]
g.proj -c epsg=4326  [to override the projection information]
g.region -s  n=90 s=-90 w=-180 e=180 res=1 [to define the default (-> -s flag) 
region]
g.region -p[to check 
the results]

Unfortunately this results in:
ERROR: default region is not set
ERROR: default region is not set
ERROR: default region is not set
ERROR: default region is not set

What's missing ?

Peter



-- 
Dr. Peter Löwe






Pt! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: 
http://www.gmx.net/de/go/multimessenger
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Original location: Hot to create from the command line ?

2009-01-20 Thread Markus Neteler
On Tue, Jan 20, 2009 at 6:10 AM, Marco Lechner - FOSSGIS e.V.
 wrote:
> Hi Markus,
>
> by the way. These links on the GRASS Tutor example page
> (http://www.grassbook.org/examples_menu2nd.php) seem to be broken:
> http://grass.itc.it/statsgrass/index.html#grassgstat
> http://grass.itc.it/statsgrass/index.html#grassR

Thanks, fixed to:
 http://grass.itc.it/statsgrass/index.php#grassgstat
 http://grass.itc.it/statsgrass/index.php#grassR

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


Re: [GRASS-user] Original location: Hot to create from the command line ?

2009-01-19 Thread Marco Lechner - FOSSGIS e.V.
Hi Markus,

by the way. These links on the GRASS Tutor example page
(http://www.grassbook.org/examples_menu2nd.php) seem to be broken:
http://grass.itc.it/statsgrass/index.html#grassgstat
http://grass.itc.it/statsgrass/index.html#grassR

Marco

Markus Neteler schrieb:
> On Mon, Jan 19, 2009 at 12:06 PM, "Peter Löwe"  wrote:
>   
 is there an (easy) recipe to create a completely new location from
 scratch without using a GUI ?

 To be precise: If GRASS is started for the first time in "-text" mode
 (=no GUI) ** without having a sample location like Spearfish or North
 Carolina around**, how can location parameters (projection, extent,
 EPSG...) be handed over to set up a very first location ?
 
>>> Just type in the name of the location you want to create and GRASS will
>>> prompt you for the parameters.
>>>
>>> Moritz
>>>   
>> That's true. But is there also a way to provide the parameters _without_ 
>> interaction
>> with the user (-> GRASS scripting & automation) ?
>> 
>
> Sure.
> An older version of a shell script is here:
>  http://www.grassbook.org/examples_menu2nd.php
>  -> create_location.sh
>
> Keeping in mind
> http://grass.osgeo.org/wiki/GRASS_and_Shell#GRASS_Batch_jobs
> it should be even easier to write it.
>
> Markus
> ___
> 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] Original location: Hot to create from the command line ?

2009-01-19 Thread Markus Neteler
On Mon, Jan 19, 2009 at 12:06 PM, "Peter Löwe"  wrote:
>
>> > is there an (easy) recipe to create a completely new location from
>> > scratch without using a GUI ?
>> >
>> > To be precise: If GRASS is started for the first time in "-text" mode
>> > (=no GUI) ** without having a sample location like Spearfish or North
>> > Carolina around**, how can location parameters (projection, extent,
>> > EPSG...) be handed over to set up a very first location ?
>>
>> Just type in the name of the location you want to create and GRASS will
>> prompt you for the parameters.
>>
>> Moritz
>
> That's true. But is there also a way to provide the parameters _without_ 
> interaction
> with the user (-> GRASS scripting & automation) ?

Sure.
An older version of a shell script is here:
 http://www.grassbook.org/examples_menu2nd.php
 -> create_location.sh

Keeping in mind
http://grass.osgeo.org/wiki/GRASS_and_Shell#GRASS_Batch_jobs
it should be even easier to write it.

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


Re: [GRASS-user] Original location: Hot to create from the command line ?

2009-01-19 Thread Peter Löwe

> > is there an (easy) recipe to create a completely new location from
> > scratch without using a GUI ?
> > 
> > To be precise: If GRASS is started for the first time in "-text" mode
> > (=no GUI) ** without having a sample location like Spearfish or North
> > Carolina around**, how can location parameters (projection, extent,
> > EPSG...) be handed over to set up a very first location ?
> 
> Just type in the name of the location you want to create and GRASS will 
> prompt you for the parameters.
> 
> Moritz

That's true. But is there also a way to provide the parameters _without_ 
interaction with the user (-> GRASS scripting & automation) ?

Peter
-- 
Dr. Peter Löwe






Sensationsangebot verlängert: GMX FreeDSL - Telefonanschluss + DSL 
für nur 16,37 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K1308T4569a
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Original location: Hot to create from the command line ?

2009-01-19 Thread Moritz Lennert

On 19/01/09 10:47, peter.lo...@gmx.de wrote:

Hi,

is there an (easy) recipe to create a completely new location from
scratch without using a GUI ?

To be precise: If GRASS is started for the first time in "-text" mode
(=no GUI) ** without having a sample location like Spearfish or North
Carolina around**, how can location parameters (projection, extent,
EPSG...) be handed over to set up a very first location ?


Just type in the name of the location you want to create and GRASS will 
prompt you for the parameters.


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


[GRASS-user] Original location: Hot to create from the command line ?

2009-01-19 Thread peter . loewe
Hi,

is there an (easy) recipe to create a completely new location from scratch 
without using a GUI ?

To be precise: 
If GRASS is started for the first time in "-text" mode (=no GUI) ** without 
having a sample location like Spearfish or North Carolina around**, how can 
location parameters (projection, extent, EPSG...) be handed over to set up a 
very first location ?

Peter
-- 
Dr. Peter Löwe






Pt! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: 
http://www.gmx.net/de/go/multimessenger
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user