Sat, Apr 12 2003
15:48:18
|
|
Request created by guest
|
|
Subject: v.in.dxf writes bad dig_att file for labels
Platform: GNU/Linux/i386
grass obtained from: Trento Italy site
grass binary for platform: Compiled from Sources
GRASS Version: cvs 4/3/2003
This is a known problem most recently discussed in [GRASSLIST:5986] with Paul
Kelly's response [GRASSLIST:5992]. I know what the problem is.
In label_box.c,
fprintf (label_fd->fd, "L %f %f %s\n",xinfo(0),yinfo(0),label);
clearly prints the label information in the dig_att file, which is wrong.
I have more details if someone can help me with the coding.
We need to add an index for the dig_att file and open the dig_cat file.
John Gillette
jg-Linux@NOSPAMtriad.rr.com
|
|
Sun, Apr 13 2003
21:47:23
|
|
Mail sent by paul-grass@stjohnspoint.co.uk
|
|
Return-Path |
<paul-grass@stjohnspoint.co.uk>
|
Delivered-To |
grass-bugs@lists.intevation.de
|
Date |
Sun, 13 Apr 2003 20:47:18 +0100 (BST)
|
From |
Paul Kelly <paul-grass@stjohnspoint.co.uk>
|
X-X-Sender |
paulk@agrippa.ukshells.co.uk
|
To |
jg-Linux@triad.rr.com, grass-bugs@intevation.de
|
Cc |
grass5@grass.itc.it
|
Subject |
Re: [GRASS5] [bug #1798] (grass) v.in.dxf writes bad dig_att file for labels
|
In-Reply-To |
<20030412134818.E02C913B50@lists.intevation.de>
|
Message-ID |
<Pine.LNX.4.53.0304132033540.8004@agrippa.ukshells.co.uk>
|
References |
<20030412134818.E02C913B50@lists.intevation.de>
|
MIME-Version |
1.0
|
Content-Type |
TEXT/PLAIN; charset=US-ASCII
|
X-Spam-Status |
No, hits=-1.1 required=5.0 tests=IN_REP_TO,REFERENCES,SPAM_PHRASE_00_01,USER_AGENT_PINE version=2.44
|
X-Spam-Level |
|
This change at the top of the label_box.c looks relevant:
...
** Modified by Benjamin Horner-Johnson 1998-OCT-01
** changed label from int to char, allowed 1 character labels
...
Before that if the label was an integer it would have been OK to have it
only in the dig_att file but to properly implement this improvement it
maybe should have been changed to write the cats file as well.
m.in.e00 might have some clues, as it seems to handle this fairly well. I
notice in src/misc/m.in.e00/info.c it calls the function
G_write_vector_cats() which seems to be the way to go; it doesn't write
the dig_cats file directly (although it does directly create the dig_att).
I could have a go at some of this but I would need to look into it more
and don't have that much time at the minute. It would be really good to be
able to merge the functionality of v.in.dxf3d into v.in.dxf as well. The
z-values of the lines should also be in the dig_cats file (and also are
handled incorrectly by v.in.dxf3d). Is it possible for there to be a
z-value and a label or more than one label for each line in the DXF file?
We might need to have separate dig_cats files that could be renamed if
necessary like m.in.e00 does.
Also v.in.dxf3d assumes the z-values are in the '30' field in the DXF file,
but I have a dxf file from an architecture source (heights of buildings)
where they are in the '38' field. This could be made a command-line option
with a default of 30 but we need to know all the possibilities (or have a
good idea of them).
But apart from fixing these obvious bugs we really shouldn't do any more
as GRASS 5.1 already has v.in.dwg which is probably better.
Paul
|
|
Mon, Apr 14 2003
18:33:21
|
|
Mail sent by JGillette@rfmd.com
|
|
Return-Path |
<JGillette@rfmd.com>
|
Delivered-To |
grass-bugs@lists.intevation.de
|
X-MimeOLE |
Produced By Microsoft Exchange V6.0.6249.0
|
content-class |
urn:content-classes:message
|
MIME-Version |
1.0
|
Content-Type |
text/plain; charset="iso-8859-1"
|
Content-Transfer-Encoding |
quoted-printable
|
Subject |
RE: [GRASS5] [bug #1798] (grass) v.in.dxf writes bad dig_att file for labels
|
Date |
Mon, 14 Apr 2003 12:32:43 -0400
|
Message-ID |
<8EC17EE03C13464E8049ADA41C53EB9E7596A6@mail3.internal.rfmd.com>
|
X-MS-Has-Attach |
|
X-MS-TNEF-Correlator |
|
Thread-Topic |
[GRASS5] [bug #1798] (grass) v.in.dxf writes bad dig_att file for labels
|
Thread-Index |
AcMB9glBtv2G/sVpTUCyFUuEugvQRgApzjuw
|
From |
"John Gillette" <JGillette@rfmd.com>
|
To |
"Paul Kelly" <paul-grass@stjohnspoint.co.uk>, <grass-bugs@intevation.de>
|
Cc |
<grass5@grass.itc.it>
|
X-OriginalArrivalTime |
14 Apr 2003 16:34:29.0593 (UTC) FILETIME=[B890D490:01C302A3]
|
X-Spam-Status |
No, hits=0.0 required=5.0 tests=QUOTED_EMAIL_TEXT,SPAM_PHRASE_00_01 version=2.44
|
X-Spam-Level |
|
> From: Paul Kelly
> Subject: Re: [GRASS5] [bug #1798] (grass) v.in.dxf writes bad dig_att
>=20
> This change at the top of the label_box.c looks relevant:
> ...
> ** Modified by Benjamin Horner-Johnson 1998-OCT-01
> ** changed label from int to char, allowed 1 character labels
> ...
> Before that if the label was an integer it would have been OK=20
> to have it
> only in the dig_att file but to properly implement this improvement it
> maybe should have been changed to write the cats file as well.
I agree. I don't understand why it was changed since writing non-
integer to the dig_att file is incorrect. Am I missing something?
> m.in.e00 might have some clues, as it seems to handle this=20
> fairly well. I
> notice in src/misc/m.in.e00/info.c it calls the function
> G_write_vector_cats() which seems to be the way to go; it=20
> doesn't write
> the dig_cats file directly (although it does directly create=20
> the dig_att).
I have something which appears to work. I need more testing. I
use G_init_cats, G_write_vector_cats, and G_set_cat. I haven't
looked at m.in.e00. I will do that. =20
I looked at a couple examples that use G_fopen_new to open the=20
dig_att file and they use fprintf to write directly to it. Are
you sure G_write_vector_cats creates the dig_att file?
=20
> I could have a go at some of this but I would need to look=20
> into it more
> and don't have that much time at the minute. It would be=20
> really good to be
> able to merge the functionality of v.in.dxf3d into v.in.dxf=20
> as well. The
> z-values of the lines should also be in the dig_cats file=20
> (and also are
> handled incorrectly by v.in.dxf3d). Is it possible for there to be a
> z-value and a label or more than one label for each line in=20
> the DXF file?
I don't know that one. I only use the less expensive 2D cad programs
so I don't have access to 3D dxf files. I have not looked at v.in.dxf3d
yet but I'll try to do that.
> We might need to have separate dig_cats files that could be renamed if
> necessary like m.in.e00 does.
>=20
> Also v.in.dxf3d assumes the z-values are in the '30' field in=20
> the DXF file,
> but I have a dxf file from an architecture source (heights of=20
> buildings)
> where they are in the '38' field. This could be made a=20
> command-line option
> with a default of 30 but we need to know all the=20
> possibilities (or have a
> good idea of them).
>=20
> But apart from fixing these obvious bugs we really shouldn't=20
> do any more
> as GRASS 5.1 already has v.in.dwg which is probably better.
There are a LOT of cheaper programs out that support dxf files and
several local government sites in the US give dxf files as one possible
data type so my opinion is that Grass should definitely continue to=20
support dxf. I haven't looked at v.in.dwg. Perhaps it also supports
dxf?
My interest in fixing v.in.dxf is for use with v.cadlabel and vector
contour maps.
In conclusion, I did get something working. When I get it more tested
I will let you know exactly what I did and why and maybe you can double
check me.=20
John
|
|
Mon, Apr 14 2003
20:04:55
|
|
Mail sent by neteler@itc.it
|
|
Return-Path |
<neteler@itc.it>
|
Delivered-To |
grass-bugs@lists.intevation.de
|
Date |
Mon, 14 Apr 2003 18:53:46 +0200
|
From |
Markus Neteler <neteler@itc.it>
|
To |
John Gillette <JGillette@rfmd.com>
|
Cc |
Paul Kelly <paul-grass@stjohnspoint.co.uk>, grass-bugs@intevation.de, grass5@grass.itc.it
|
Subject |
Re: [GRASS5] [bug #1798] (grass) v.in.dxf writes bad dig_att file for labels
|
Message-ID |
<20030414185346.O20076@itc.it>
|
Mail-Followup-To |
John Gillette <JGillette@rfmd.com>, Paul Kelly <paul-grass@stjohnspoint.co.uk>, grass-bugs@intevation.de, grass5@grass.itc.it
|
References |
<8EC17EE03C13464E8049ADA41C53EB9E7596A6@mail3.internal.rfmd.com>
|
Mime-Version |
1.0
|
Content-Type |
text/plain; charset=us-ascii
|
Content-Disposition |
inline
|
User-Agent |
Mutt/1.2.5.1i
|
In-Reply-To |
<8EC17EE03C13464E8049ADA41C53EB9E7596A6@mail3.internal.rfmd.com>; from JGillette@rfmd.com on Mon, Apr 14, 2003 at 12:32:43PM -0400
|
X-Spam-Status |
No, hits=-3.0 required=5.0 tests=IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES,SPAM_PHRASE_00_01, USER_AGENT,USER_AGENT_MUTT version=2.44
|
X-Spam-Level |
|
On Mon, Apr 14, 2003 at 12:32:43PM -0400, John Gillette wrote:
> > From: Paul Kelly
> > Subject: Re: [GRASS5] [bug #1798] (grass) v.in.dxf writes bad dig_att
[...]
> There are a LOT of cheaper programs out that support dxf files and
> several local government sites in the US give dxf files as one possible
> data type so my opinion is that Grass should definitely continue to
> support dxf. I haven't looked at v.in.dwg. Perhaps it also supports
> dxf?
yes, 2D and 3D DWG/DXF:
http://grass.itc.it/grass51/manuals/html51_user/v.in.dwg.html
Note that the OpenDWG toolkit is required which comes with a
strange license.
Maybe not all DXF tags are supported yet, but most of them.
Eg, the tower on the GRASS 5.1 page was a such a 3D DXF file.
Markus
|
|
Mon, Apr 14 2003
20:52:23
|
|
Mail sent by paul-grass@stjohnspoint.co.uk
|
|
Return-Path |
<paul-grass@stjohnspoint.co.uk>
|
Delivered-To |
grass-bugs@lists.intevation.de
|
Date |
Mon, 14 Apr 2003 19:52:10 +0100 (BST)
|
From |
Paul Kelly <paul-grass@stjohnspoint.co.uk>
|
X-X-Sender |
paulk@agrippa.ukshells.co.uk
|
To |
John Gillette <JGillette@rfmd.com>
|
Cc |
grass-bugs@intevation.de, grass5@grass.itc.it
|
Subject |
RE: [GRASS5] [bug #1798] (grass) v.in.dxf writes bad dig_att file for labels
|
In-Reply-To |
<8EC17EE03C13464E8049ADA41C53EB9E7596A6@mail3.internal.rfmd.com>
|
Message-ID |
<Pine.LNX.4.53.0304141948140.24287@agrippa.ukshells.co.uk>
|
References |
<8EC17EE03C13464E8049ADA41C53EB9E7596A6@mail3.internal.rfmd.com>
|
MIME-Version |
1.0
|
Content-Type |
TEXT/PLAIN; charset=US-ASCII
|
X-Spam-Status |
No, hits=-3.5 required=5.0 tests=EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES, SPAM_PHRASE_00_01,USER_AGENT_PINE version=2.44
|
X-Spam-Level |
|
On Mon, 14 Apr 2003, John Gillette wrote:
> > From: Paul Kelly
> > Subject: Re: [GRASS5] [bug #1798] (grass) v.in.dxf writes bad dig_att
> >
> > This change at the top of the label_box.c looks relevant:
> > ...
> > ** Modified by Benjamin Horner-Johnson 1998-OCT-01
> > ** changed label from int to char, allowed 1 character labels
> > ...
...
> I agree. I don't understand why it was changed since writing non-
> integer to the dig_att file is incorrect. Am I missing something?
I would guess before that it didn't support labels at all unless they were
numbers; just ignored them.
> I have something which appears to work. I need more testing. I
> use G_init_cats, G_write_vector_cats, and G_set_cat. I haven't
> looked at m.in.e00. I will do that.
>
> I looked at a couple examples that use G_fopen_new to open the
> dig_att file and they use fprintf to write directly to it. Are
Yes that's exactly the impression I got of how to do it from glancing over
a few source files.
> you sure G_write_vector_cats creates the dig_att file?
(It creates the dig_cats)
> In conclusion, I did get something working. When I get it more tested
> I will let you know exactly what I did and why and maybe you can double
> check me.
I have several dxf files that I could test it with so yes let me know and
if we don't fully integrate v.in.dxf3d into v.in.dxf at least I could
probably merge your fix into it so it writes to dig_cats.
Paul
|
|
Mon, Jul 17 2006
20:44:34
|
|
Mail sent by mneteler
|
|
Hi,
v.in.dxf has been completely rewritten for GRASS 6.1. It works
fairly well now. Will close the report.
Markus |
|
Mon, Jul 17 2006
20:44:37
|
|
Status changed to resolved by mneteler
|
|