[GRASS-user] Programmatically create location?

Hi all,

I have a program which will generate products based on
a (disposable) user-defined lat/lon box, which could be
located anywhere in the world. How do I go about programmatically
creating a new location? I looked over the various docs and
wiki entries and didn't see anything that looked like it.

If there isn't a way then I think I'll create a sample
location, have the program copy/link the whole dir structure
to a temp place and sed my way from there. Does anybody
see anything wrong with that approach? Can you suggest
a better one?

--
Paul Pick <paul.pick@ec.gc.ca>
Informatics Services Unit Gagetown
Chief Information Officer Branch, Environment Canada
[CSN] 432 2082 [CIV] 506 422 2000 x 2082 [FAX] 506 422 1443

Paul Pick wrote:

I have a program which will generate products based on
a (disposable) user-defined lat/lon box, which could be
located anywhere in the world. How do I go about programmatically
creating a new location? I looked over the various docs and
wiki entries and didn't see anything that looked like it.

To create a location, create the location directory, the PERMANENT
directory, and the DEFAULT_WIND file. If you need projection
information, also create the PROJ_INFO and PROJ_UNITS files (see
g.setproj for reference; g.setproj is interactive, so you can't use it
from another program).

To create a new mapset, create the mapset directory and copy the
DEFAULT_WIND file as the WIND file.

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