[GRASS-dev] creating location from the command line

Glynn Clements glynn at gclements.plus.com
Sun Apr 6 11:55:54 EDT 2008


Ivan Shmakov wrote:

>  >> I tinkered with the grass.sh script in
>  >> /Apps.../Grass-6.3.app/Contents/MacOS to bypass any of the GUI setup
>  >> (X and Terminal windows) when GRASS_BATCH_JOB is non-empty.  That
>  >> provided the behavior I was after and didn't interfere with
>  >> interactive use, so setting and acting upon a switch to indicate
>  >> background execution will work.
> 
>  > GRASS_BATCH_JOB is a bit of a hack. You would be better off
>  > bypassing Init.sh altogether.
> 
> 	I wonder, is there a way to create locations non-interactively?

	g.proj -c location=...

> 	Or, does GRASS use architecture-dependent formats within its
> 	locations?

AFAICT, the core library functions use portable formats; however:

1. Individual modules can write whatever they want under cell_misc. 
E.g. the fftreal and fftimag files written by i.fft are in host byte
order.

2. Even when portable formats are used, the precise choice of format
may be platform-specific.

E.g. the row indices in the raster files can be 4 or 8 bytes,
depending up the size of off_t in the code which creates them. The
actual size is stored in the file, and the code which reads them can
handle the case where the size used in the file doesn't match the
off_t used in the code, so long as the actual values fit within an
off_t.

For text formats, there's the issue that the MSVCRT version of
printf's %e and %g always use a 3-digit exponent, while other
implementations follow ANSI and only use 3 digits where necessary.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list