[GRASS-dev] Re: testing native winGRASS

Paul Kelly paul-grass at stjohnspoint.co.uk
Wed Mar 14 10:48:35 EDT 2007


On Wed, 14 Mar 2007, Moritz Lennert wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 13/03/07 23:34, Paul Kelly wrote:
>> Hello Moritz
>>
>> On Tue, 13 Mar 2007, Moritz Lennert wrote:
>>
>>> 1) Create location with projection values: location created but mapset
>>> (other than PERMANENT) invalid
>>
>> Could you try the patch below for lib/gis/getl.c and see if GRASS can
>> then handle the newly created location? I think the problem is the
>> created location contains Windows line endings in some of the files and
>> other GRASS functions can't handle them. G_getl2() handles Windows line
>> endings whereas G_getl() does not. I have a hunch this may apply in many
>> places.
>
> I will try this tonight, but just to make clear what is going wrong:
> creating the location works and there is a valid PERMANENT mapset
> created whatever I do, but if (in the console window where you enter the
> name of the new location) I give a mapset name other than PERMANENT,
> this mapset is then created (together with PERMANENT), but when I try to
> enter it, I get an "invalid mapset" error, which is understandable since
> the mapset directory is empty except for a dbf directory (IIRC).

Ah OK. I believe the problem is this in lib/init/mke_mapset.c:

/* give the mapset a default window for the entire location */
         sprintf(buffer,"cat '%s'/PERMANENT/DEFAULT_WIND  > '%s'/'%s'/WIND",
                 location, location, mapset) ;
         system(buffer) ;

but at the minute my mind has gone blank as to the portable way to replace 
that. I general audit of calls to system() would have caught that if we're 
able to get round to doing it I suppose.

Paul




More information about the grass-dev mailing list