[GRASSLIST:5991] Re: moving layers from one machine to another

On Thu, 3 Mar 2005, Chris Fonnesbeck wrote:

On Thu, 3 Mar 2005 19:47:17 +0100 (CET), Roger Bivand
<Roger.Bivand@nhh.no> wrote:
> On Thu, 3 Mar 2005, Chris Fonnesbeck wrote:
>
> > That makes sense. So, what is the recommended way, then, of moving
> > GRASS layers among platforms?
>
> I'm returning Chris' question to the list, so that the answer gets into
> the archives. Chris, could you state which GRASS version you are using on
> both platforms? I guess this is 5.7 or 6.0 - could somebody who knows the
> vector storage formats comment please?
>

This is version 6, beta 2. I am using Lorenzo Moretti's OS X binary,
to be specific. The imported file is a vector shapefile.

PLEASE reply to the list too - it is polite to keep the list informed on a
matter of some importance. You have not said what the GRASS version on
which Linux was.

The documentation is in the last resort in the 6.0.0 beta2 sources.
lib/gis/Makefile has EXTRA_LIBS = $(XDRLIB) ..., but lib/vector/*/Makefile
don't, as far as I can see. $(XDRLIB) is in: form/Makefile, gis/Makefile,
init/Makefile, vector/diglib/Makefile: this final directory includes
reference to a portable vector format. Neither "XDR" nor "portable" appear
in the grass60vlib reference manual, but the portable functions seem to be
called in Vector_read_nat() and elsewhere in Vlib.

The release notes for 6.0.0 beta2 say "The new internal vector data format
is portable between 32bit and 64bit platforms", and googling the GRASS
site for portable and vector gives lots of hits, but no specific
declaration that you can validly do what you want to do, or that you
can't. A good deal of work seems to have gone into trying to provide
endian portability, so maybe there is something else involved.

--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand@nhh.no

On Thu, 3 Mar 2005 20:59:45 +0100 (CET), Roger Bivand
<Roger.Bivand@nhh.no> wrote:

On Thu, 3 Mar 2005, Chris Fonnesbeck wrote:

> On Thu, 3 Mar 2005 19:47:17 +0100 (CET), Roger Bivand
> <Roger.Bivand@nhh.no> wrote:
> > On Thu, 3 Mar 2005, Chris Fonnesbeck wrote:
> >
> > > That makes sense. So, what is the recommended way, then, of moving
> > > GRASS layers among platforms?
> >
> > I'm returning Chris' question to the list, so that the answer gets into
> > the archives. Chris, could you state which GRASS version you are using on
> > both platforms? I guess this is 5.7 or 6.0 - could somebody who knows the
> > vector storage formats comment please?
> >
>
> This is version 6, beta 2. I am using Lorenzo Moretti's OS X binary,
> to be specific. The imported file is a vector shapefile.
>

PLEASE reply to the list too - it is polite to keep the list informed on a
matter of some importance. You have not said what the GRASS version on
which Linux was.

The documentation is in the last resort in the 6.0.0 beta2 sources.
lib/gis/Makefile has EXTRA_LIBS = $(XDRLIB) ..., but lib/vector/*/Makefile
don't, as far as I can see. $(XDRLIB) is in: form/Makefile, gis/Makefile,
init/Makefile, vector/diglib/Makefile: this final directory includes
reference to a portable vector format. Neither "XDR" nor "portable" appear
in the grass60vlib reference manual, but the portable functions seem to be
called in Vector_read_nat() and elsewhere in Vlib.

The release notes for 6.0.0 beta2 say "The new internal vector data format
is portable between 32bit and 64bit platforms", and googling the GRASS
site for portable and vector gives lots of hits, but no specific
declaration that you can validly do what you want to do, or that you
can't. A good deal of work seems to have gone into trying to provide
endian portability, so maybe there is something else involved.

Sorry, I *meant* to hit "reply all" and this hit the list as well, but did not.

That may be the problem -- I imported the file in 5.7 and then tried
moving it over to 6.0. I will build 6.0 on my Linux box and try again.

gut feeling: endian bug.

I know my r.in.mat/r.out.mat modules which should deal with big/little
endian problems are buggy right now & you can't use them by way of
r.pack/r.unpack[*] to transfer raster maps to OSX. On my TODO list.

[*] http://grass.itc.it/pipermail/grass5/2004-July/014923.html

these modules + vector libs should all be using G_is_little_endian() but
don't??

suggested short term remedy: set up import on OSX before leaving work on
Friday and by the time you are back at work mon AM it will be done.

Hamish

Binary files are portable and the library is tested during compilation (it writes/reads both little an big endians for all data types and compares with 'etalon').

Chris, could you try to convert head and dbln files from UNIX to Mac (newline characters)?

Radim

Chris Fonnesbeck wrote:

On Thu, 3 Mar 2005 20:59:45 +0100 (CET), Roger Bivand
<Roger.Bivand@nhh.no> wrote:

On Thu, 3 Mar 2005, Chris Fonnesbeck wrote:

On Thu, 3 Mar 2005 19:47:17 +0100 (CET), Roger Bivand
<Roger.Bivand@nhh.no> wrote:

On Thu, 3 Mar 2005, Chris Fonnesbeck wrote:

That makes sense. So, what is the recommended way, then, of moving
GRASS layers among platforms?

I'm returning Chris' question to the list, so that the answer gets into
the archives. Chris, could you state which GRASS version you are using on
both platforms? I guess this is 5.7 or 6.0 - could somebody who knows the
vector storage formats comment please?

This is version 6, beta 2. I am using Lorenzo Moretti's OS X binary,
to be specific. The imported file is a vector shapefile.

PLEASE reply to the list too - it is polite to keep the list informed on a
matter of some importance. You have not said what the GRASS version on
which Linux was.

The documentation is in the last resort in the 6.0.0 beta2 sources.
lib/gis/Makefile has EXTRA_LIBS = $(XDRLIB) ..., but lib/vector/*/Makefile
don't, as far as I can see. $(XDRLIB) is in: form/Makefile, gis/Makefile,
init/Makefile, vector/diglib/Makefile: this final directory includes
reference to a portable vector format. Neither "XDR" nor "portable" appear
in the grass60vlib reference manual, but the portable functions seem to be
called in Vector_read_nat() and elsewhere in Vlib.

The release notes for 6.0.0 beta2 say "The new internal vector data format
is portable between 32bit and 64bit platforms", and googling the GRASS
site for portable and vector gives lots of hits, but no specific
declaration that you can validly do what you want to do, or that you
can't. A good deal of work seems to have gone into trying to provide
endian portability, so maybe there is something else involved.

Sorry, I *meant* to hit "reply all" and this hit the list as well, but did not.

That may be the problem -- I imported the file in 5.7 and then tried
moving it over to 6.0. I will build 6.0 on my Linux box and try again.

On Fri, 4 Mar 2005, Radim Blazek wrote:

Binary files are portable and the library is tested during compilation
(it writes/reads both little an big endians for all data types and
compares with 'etalon').

Thanks, Radim, this is authoritative.

Roger

Chris, could you try to convert head and dbln files from UNIX to Mac
(newline characters)?

Radim

Chris Fonnesbeck wrote:
> On Thu, 3 Mar 2005 20:59:45 +0100 (CET), Roger Bivand
> <Roger.Bivand@nhh.no> wrote:
>
>>On Thu, 3 Mar 2005, Chris Fonnesbeck wrote:
>>
>>
>>>On Thu, 3 Mar 2005 19:47:17 +0100 (CET), Roger Bivand
>>><Roger.Bivand@nhh.no> wrote:
>>>
>>>>On Thu, 3 Mar 2005, Chris Fonnesbeck wrote:
>>>>
>>>>
>>>>>That makes sense. So, what is the recommended way, then, of moving
>>>>>GRASS layers among platforms?
>>>>
>>>>I'm returning Chris' question to the list, so that the answer gets into
>>>>the archives. Chris, could you state which GRASS version you are using on
>>>>both platforms? I guess this is 5.7 or 6.0 - could somebody who knows the
>>>>vector storage formats comment please?
>>>>
>>>
>>>This is version 6, beta 2. I am using Lorenzo Moretti's OS X binary,
>>>to be specific. The imported file is a vector shapefile.
>>>
>>
>>PLEASE reply to the list too - it is polite to keep the list informed on a
>>matter of some importance. You have not said what the GRASS version on
>>which Linux was.
>>
>>The documentation is in the last resort in the 6.0.0 beta2 sources.
>>lib/gis/Makefile has EXTRA_LIBS = $(XDRLIB) ..., but lib/vector/*/Makefile
>>don't, as far as I can see. $(XDRLIB) is in: form/Makefile, gis/Makefile,
>>init/Makefile, vector/diglib/Makefile: this final directory includes
>>reference to a portable vector format. Neither "XDR" nor "portable" appear
>>in the grass60vlib reference manual, but the portable functions seem to be
>>called in Vector_read_nat() and elsewhere in Vlib.
>>
>>The release notes for 6.0.0 beta2 say "The new internal vector data format
>>is portable between 32bit and 64bit platforms", and googling the GRASS
>>site for portable and vector gives lots of hits, but no specific
>>declaration that you can validly do what you want to do, or that you
>>can't. A good deal of work seems to have gone into trying to provide
>>endian portability, so maybe there is something else involved.
>>
>
>
> Sorry, I *meant* to hit "reply all" and this hit the list as well, but did not.
>
> That may be the problem -- I imported the file in 5.7 and then tried
> moving it over to 6.0. I will build 6.0 on my Linux box and try again.

--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand@nhh.no

Radim Blazek wrote:

Binary files are portable and the library is tested during compilation (it writes/reads both little an big endians for all data types and compares with 'etalon').

Chris, could you try to convert head and dbln files from UNIX to Mac (newline characters)?

I have added G_getl2(char *buf, int n, FILE *fd) which should read one line from text file regardless where it was written (ie \n, \r, \r\n). Newline character is not written, buffer must be n+1.

Vector library now calls this function for vector ascii files.

Chris, if my previous suggestion helped, please update GRASS from CVS and try to read original file from Linux without conversion of text files.

If you have access to more platform, please try to move more vectors both Linux->Mac, Mac-Linux.

Hamish, will you try G_getl2 in v.in.ascii?

Radim