[GRASS5] v.in.arc: import files

Hi all,

I have a wish concerning v.in.arc (there was a thread on it recently):

Is it possible to modify it that v.in.arc reads the file from the
current directory instead of $LOCATION/arc/ ?

I have to import many ungenerate-files and rather dislike the
current behaviour.

Comments (or a modification!) are welcome,

Markus

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

On Tue, 17 Apr 2001, Markus Neteler wrote:

Is it possible to modify it that v.in.arc reads the file from the
current directory instead of $LOCATION/arc/ ?

Markus,

  Seems to me that a number of file location issues have surfaced recently
because there is little consistency, apparently, among modules. I would like
to suggest a change to be incorporated into 5.1.

  The default location for all foreign-format source files (perhaps, for all
files) will be the current working directory. This needs to be thought
through and made consistent for the entire system. Also, such a change needs
to be presented early in the documentation so new users understand the
default behavior.

Rich

Dr. Richard B. Shepard, President

                       Applied Ecosystem Services, Inc. (TM)
            2404 SW 22nd Street | Troutdale, OR 97060-1247 | U.S.A.
+ 1 503-667-4517 (voice) | + 1 503-667-8863 (fax) | rshepard@appl-ecosys.com

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

On Tue, Apr 17, 2001 at 09:07:57AM -0700, Rich Shepard wrote:

On Tue, 17 Apr 2001, Markus Neteler wrote:

> Is it possible to modify it that v.in.arc reads the file from the
> current directory instead of $LOCATION/arc/ ?

Markus,

  Seems to me that a number of file location issues have surfaced recently
because there is little consistency, apparently, among modules. I would like
to suggest a change to be incorporated into 5.1.

  The default location for all foreign-format source files (perhaps, for all
files) will be the current working directory. This needs to be thought
through and made consistent for the entire system. Also, such a change needs
to be presented early in the documentation so new users understand the
default behavior.

Rich,

the v.in.arc is the exception from above rule: It does *not* read from
the current working directory but only from $LOCATION/arc/ (like the
v.in.dxf, too). All other import modules read from current working
directory. Therefore I propose a change in v.in.arc/v.out.arc |
v.in.dxf/v.out.dxf to reach the wanted consistency.

Markus

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

On Tue, 17 Apr 2001, Markus Neteler wrote:

the v.in.arc is the exception from above rule: It does *not* read from
the current working directory but only from $LOCATION/arc/ (like the
v.in.dxf, too). All other import modules read from current working
directory. Therefore I propose a change in v.in.arc/v.out.arc |
v.in.dxf/v.out.dxf to reach the wanted consistency.

Markus,

  Well-l-l, ... m.in.e00, v.in.mif, and v.in.shape all require the
fully-qualified path name to work. Just the current directory won't do.
That's why I thought the issue was more general.

Rich

Dr. Richard B. Shepard, President

                       Applied Ecosystem Services, Inc. (TM)
            2404 SW 22nd Street | Troutdale, OR 97060-1247 | U.S.A.
+ 1 503-667-4517 (voice) | + 1 503-667-8863 (fax) | rshepard@appl-ecosys.com

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Rich Shepard wrote:

  Well-l-l, ... m.in.e00, v.in.mif, and v.in.shape all require the
fully-qualified path name to work. Just the current directory won't do.

Uh? I used recently v.in.shape and m.in.e00, and they worked with the
standard sheme of unix filename, relative path if the name doesn't
begin with a slash, absolute path if the name begins with a slash...

BTW, I will take a look tonight at v.in.arc and v.[in|out].dxf to see
what is the amount of change needed. If possible, I will commit the
changes. Markus, should I use a tag my CVS tree to change all in the
right place (5.0.0, 5.1, ???)

--
Michel WURTZ - DIG - Maison de la télédétection
               500, rue J.F. Breton
               34093 MONTPELLIER Cedex 5

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

On Tue, Apr 17, 2001 at 09:27:49AM -0700, Rich Shepard wrote:

On Tue, 17 Apr 2001, Markus Neteler wrote:

> the v.in.arc is the exception from above rule: It does *not* read from
> the current working directory but only from $LOCATION/arc/ (like the
> v.in.dxf, too). All other import modules read from current working
> directory. Therefore I propose a change in v.in.arc/v.out.arc |
> v.in.dxf/v.out.dxf to reach the wanted consistency.

Markus,

  Well-l-l, ... m.in.e00, v.in.mif, and v.in.shape all require the
fully-qualified path name to work. Just the current directory won't do.
That's why I thought the issue was more general.

Rich,

here I don't need a fully-qualified path name for m.in.e00 and v.in.shape,
I can simply specify the map name. Should be possible all over the world!

Example:

cd /home/neteler/data
ls -la linienneu.shp
-rw-r--r-- 1 neteler users 1073428 Jan 23 13:05 linienneu.shp

v.in.shape -l in=linienneu.shp
Attributes available in linienneu.shp
AOBJID
FOLIE
OBJART
AK
TEIL
POS
ART
SIG
TEXT
KLARTEXT

Works perfectly for me. If it is not working on your machine, it must
be a bug which we should fix.

Regards

Markus

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

On Tue, Apr 17, 2001 at 04:56:22PM +0000, Michel Wurtz wrote:

Rich Shepard wrote:
> Well-l-l, ... m.in.e00, v.in.mif, and v.in.shape all require the
> fully-qualified path name to work. Just the current directory won't do.

Uh? I used recently v.in.shape and m.in.e00, and they worked with the
standard sheme of unix filename, relative path if the name doesn't
begin with a slash, absolute path if the name begins with a slash...

BTW, I will take a look tonight at v.in.arc and v.[in|out].dxf to see
what is the amount of change needed. If possible, I will commit the
changes. Markus, should I use a tag my CVS tree to change all in the
right place (5.0.0, 5.1, ???)

Thanks Michel,

I suggest only to change the release_branch. Later we will merge back
into the exp tree (hopefully soon). The 5.1 is quite different, so it
may not be affected these days.

Regards

Markus

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Rich Shepard wrote:

On Tue, 17 Apr 2001, Markus Neteler wrote:

> the v.in.arc is the exception from above rule: It does *not* read from
> the current working directory but only from $LOCATION/arc/ (like the
> v.in.dxf, too). All other import modules read from current working
> directory. Therefore I propose a change in v.in.arc/v.out.arc |
> v.in.dxf/v.out.dxf to reach the wanted consistency.

Markus,

  Well-l-l, ... m.in.e00, v.in.mif, and v.in.shape all require the
fully-qualified path name to work. Just the current directory won't do.
That's why I thought the issue was more general.

Rich

Rich, Markus

Some changes to v.in.mif now mean it should open a file given any valid
unix path name.

ie. Supply for input a full path, relative path or just a file name of
*.mif, *.mid or just the base name *.

Default output is the base name of the file, if `output' is supplied it
over-rides this. So output would always be an optional parameter.

Can I suggest this as appropriate default behaviour for any external
file import?

David

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

On Tue, 17 Apr 2001, David D Gray wrote:

Some changes to v.in.mif now mean it should open a file given any valid
unix path name.

ie. Supply for input a full path, relative path or just a file name of
*.mif, *.mid or just the base name *.

Default output is the base name of the file, if `output' is supplied it
over-rides this. So output would always be an optional parameter.

Can I suggest this as appropriate default behaviour for any external
file import?

  Works for me.

  My comments were prompted by my efforts to run the import modules using
only the source file name. I kept getting a "file not found" error unless I
specified the absolute path name. Shrug. Perhaps it's the drought out here.

Rich

Dr. Richard B. Shepard, President

                       Applied Ecosystem Services, Inc. (TM)
            2404 SW 22nd Street | Troutdale, OR 97060-1247 | U.S.A.
+ 1 503-667-4517 (voice) | + 1 503-667-8863 (fax) | rshepard@appl-ecosys.com

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

David D Gray wrote:

Some changes to v.in.mif now mean it should open a file given any valid
unix path name.

ie. Supply for input a full path, relative path or just a file name of
*.mif, *.mid or just the base name *.

Default output is the base name of the file, if `output' is supplied it
over-rides this. So output would always be an optional parameter.

Can I suggest this as appropriate default behaviour for any external
file import?

I think v.in.arc should be modified in that way... m.in.e00 doesn't ask
for an output name, so this could be added...

--
Michel WURTZ - DIG - Maison de la télédétection
               500, rue J.F. Breton
               34093 MONTPELLIER Cedex 5

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Hi all,

Michel Wurtz has been modifying v.in.arc and v.out.arc to accept
relative and absolute pathname. It even reads from the current
directory now. It's in CVS now, the html page got such a hint.

Perhaps he will update v.in./out.dxf/2 as well,
then consistency should be back.

Thanks to Michel,

Markus

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Markus Neteler wrote:

Perhaps he will update v.in./out.dxf/2 as well,
then consistency should be back.

Ok, I had a look at v.[in|out].dxf{2} :

I've synchronised v.in.dxf and v.in.dxf2 (merging the
modifications done in both versions) : Markus, you can
throw away v.in.dxf2 : v.in.dxf is the updated version
(I have commited the changes in the current CVS tree)
BTW, you can also delete the nps_dxf directory in v.in.dxf :
it contains old stuff that is no more usefull (put it in
the attic :slight_smile:

I looked also v.out.dxf and the actual export sheme is the
following, with
  GBVF = Grass Binary Vector File (in $LOCATION/dig...)
  GAVF = Grass Ascii Vector file (in $LOCATION/dig_ascii)

GBVF <-- v.in.arc <------------------------------ ESRI ungenerate files
GBVF --> v.out.arc -----------------------------> ESRI ungenerate files
GBVF <-- v.in.shape <---------------------------- ESRI shapefile
GBVF --> v.out.shape ---------------------------> ESRI shapefile
GBVF <-- m.in.e00 <------------------------------ .e00 ESRI export file
GBVF --> v.out.e00 -----------------------------> .e00 ESRI export file
GBVF <-- v.in.mif <------------------------------ mif/mid Mapinfo
GBVF --> v.out.mapinfo -------------------------> mif/mid Mapinfo

GBVF <--------------------------- v.in.dxf <----- .dxf file
GBVF <-- v.in.ascii <--- GABF <-- v.in.dxf -a <-- .dxf file
GBCF --> v.out.ascii --> GABF --> v.out.dxf ----> .dxf file

Conclusion :
1- The dig_ascii directory seems only usefull for v.out.dxf, which
should be rewritten to read binary vector files. After that,
v.[in|out].ascii should write anywhere (same thing as other import/
export programs), and act as a general utility.

2- v.out.mapinfo should certainly be named v.out.mif for consistency
  (or v.in.mif renamed v.in.mapinfo)

3- v.in.dlg and v.out.dlg seems to use a DLG directory in $LOCATION

4- I didn't look at v.[in|out].atlas, nor v.in.gshhs, nor v.out.moss
(is moss output really usefull ?)

--
Michel WURTZ - DIG - Maison de la télédétection
               500, rue J.F. Breton
               34093 MONTPELLIER Cedex 5

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Hi Michel, Hi Markus,

please do not remove the dig_ascii directory or change v.in/out.ascii,
as some (many?) scripts rely on writing to/reading from dig_ascii. This
should be done with GRASSS 5.1, but not yet.

cu,

Andreas

Michel Wurtz wrote:

Conclusion :
1- The dig_ascii directory seems only usefull for v.out.dxf, which
should be rewritten to read binary vector files. After that,
v.[in|out].ascii should write anywhere (same thing as other import/
export programs), and act as a general utility.

--
Andreas Lange, 65187 Wiesbaden, Germany, Tel. +49 611 807850
Andreas.Lange@Rhein-Main.de - A.C.Lange@GMX.net

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

On Thu, Apr 19, 2001 at 09:05:42AM +0000, Michel Wurtz wrote:

Markus Neteler wrote:

> Perhaps he will update v.in./out.dxf/2 as well,
> then consistency should be back.

Ok, I had a look at v.[in|out].dxf{2} :

I've synchronised v.in.dxf and v.in.dxf2 (merging the
modifications done in both versions) : Markus, you can
throw away v.in.dxf2 : v.in.dxf is the updated version
(I have commited the changes in the current CVS tree)

Thanks, Michel. I have updated the release branch now (as
you wrote into the exp tree) and removed the v.in.dxf2.

BTW, you can also delete the nps_dxf directory in v.in.dxf :
it contains old stuff that is no more usefull (put it in
the attic :slight_smile:

O.k., done.

I looked also v.out.dxf and the actual export sheme is the
following, with
  GBVF = Grass Binary Vector File (in $LOCATION/dig...)
  GAVF = Grass Ascii Vector file (in $LOCATION/dig_ascii)

GBVF <-- v.in.arc <------------------------------ ESRI ungenerate files
GBVF --> v.out.arc -----------------------------> ESRI ungenerate files
GBVF <-- v.in.shape <---------------------------- ESRI shapefile
GBVF --> v.out.shape ---------------------------> ESRI shapefile
GBVF <-- m.in.e00 <------------------------------ .e00 ESRI export file
GBVF --> v.out.e00 -----------------------------> .e00 ESRI export file
GBVF <-- v.in.mif <------------------------------ mif/mid Mapinfo
GBVF --> v.out.mapinfo -------------------------> mif/mid Mapinfo

GBVF <--------------------------- v.in.dxf <----- .dxf file
GBVF <-- v.in.ascii <--- GABF <-- v.in.dxf -a <-- .dxf file
GBCF --> v.out.ascii --> GABF --> v.out.dxf ----> .dxf file

Conclusion :
1- The dig_ascii directory seems only usefull for v.out.dxf, which
should be rewritten to read binary vector files. After that,
v.[in|out].ascii should write anywhere (same thing as other import/
export programs), and act as a general utility.

Here David and Radim may propose a solution.

2- v.out.mapinfo should certainly be named v.out.mif for consistency
  (or v.in.mif renamed v.in.mapinfo)

We have both v.out.mapinfo and v.out.mif. Which one is current and
working (hi David)? We should remove any old version.

3- v.in.dlg and v.out.dlg seems to use a DLG directory in $LOCATION

Oh - another candidate... :slight_smile:

4- I didn't look at v.[in|out].atlas, nor v.in.gshhs, nor v.out.moss
(is moss output really usefull ?)

I am not sure if v.[in|out].atlas is really working? Does anyone know?
And: shall we keep v.out.moss?

v.in.gshhs should read from the current directory (it uses fopen).
It is in working condition.

Thanks for the update, Michel,

Markus

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Markus Neteler wrote:

On Thu, Apr 19, 2001 at 09:05:42AM +0000, Michel Wurtz wrote:

[...]
> 2- v.out.mapinfo should certainly be named v.out.mif for consistency
> (or v.in.mif renamed v.in.mapinfo)

We have both v.out.mapinfo and v.out.mif. Which one is current and
working (hi David)? We should remove any old version.

I will look at these and see what is best, and if functionality can be
merged. I had been working on v.out.mif.

I suggest v.in/out.mif as v.in/out.mapinfo is ambiguous and we might
want to reserve it for possible use in importing binary mapinfo in
future.

David

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

David D Gray wrote:

I suggest v.in/out.mif as v.in/out.mapinfo is ambiguous and we might
want to reserve it for possible use in importing binary mapinfo in
future.

I agree with you. BTW, all import export program use the same
naming convention : v.in.xxx or v.out.xxx with xxx = e00, mif, dxf, ...
at the exception of shape (should we call them v.in.shp and
v.out.shp instead of v.in.shape and v.out.shape ?)

--
Michel WURTZ - DIG - Maison de la télédétection
               500, rue J.F. Breton
               34093 MONTPELLIER Cedex 5

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Michel Wurtz wrote:

David D Gray wrote:
> I suggest v.in/out.mif as v.in/out.mapinfo is ambiguous and we might
> want to reserve it for possible use in importing binary mapinfo in
> future.

I agree with you. BTW, all import export program use the same
naming convention : v.in.xxx or v.out.xxx with xxx = e00, mif, dxf, ...
at the exception of shape (should we call them v.in.shp and
v.out.shp instead of v.in.shape and v.out.shape ?)

--

Michel

Yes, for the sake of compatibility, using the conventional extension
makes it clearer from the outset. People not familiar with GRASS might
think v.*.shape and i.shape are related for example. I'm not sure that
this change should be made now in the stable branch as it might cause
more confusion, but maybe for the next minor release.

David

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'