[GRASS-user] v.in.dxf modifies field values in "layer" column

Benjamin Ducke benjamin.ducke at oxfordarch.co.uk
Tue Apr 7 05:54:31 EDT 2009


Hmmm,

but the map name is fine! The problem is in the modification done by

G_str_to_sql() in the function get_field_cat() in write_vect.c !

That refers to FIELD NAMES, not map names. I can see how it would
be useful to enforce correct SQL field names, but it actually modifies
FIELD VALUES in the output attribute table! So I end up with an
attribute table that has a field "layer" and modified layer names
as values.

Funny enough, if I use

v.in.dxf -l <dxf-file>

to just list the layer names, they display all fine:

Layer 1: 10000
Layer 2: 10001
Layer 3: 1516
Layer 4: 1517
...

If I actually import the DXF layers, however, the status display at the
end shows:

Following DXF layers found:
Layer 1: x0000
Layer 2: x0001
Layer 3: x516
Layer 4: x517
...

Why would it not leave those names alone? I just can't see how it would
be useful to end up with mangled DXF layer names in the output vector
map attribute table.

Ben


Markus Neteler wrote:
> On Tue, Apr 7, 2009 at 11:27 AM, Benjamin Ducke
> <benjamin.ducke at oxfordarch.co.uk> wrote:
>> Hi all,
>>
>> I have a DXF file that has layers called
>>
>> 1516,
>> 1517,
>> 1518,
>> 2003,
>> ...
>>
>> After importing it using v.in.dxf, I get
>> a column "layer" with values:
>>
>> x516,
>> x517,
>> x518,
>> x003,
>> ...
>>
>> Apparently, the leading digit has been replaced
>> by "x". But why? Is this a bug or a feature?
> 
> Feature.
> 
> The naming convention for vector maps require that map names start with a
> character, not a number (map name scheme: [A-Za-z][A-Za-z0-9_]*).
> 
> Markus
> 


-- 
Benjamin Ducke
Senior Geospatial Consultant

Oxford Archaeology
Janus House
Osney Mead
OX2 0ES
Oxford, U.K.

Tel: +44 (0)1865 263 800 (switchboard)
Tel: +44 (0)1865 980 758 (direct)
Fax :+44 (0)1865 793 496
benjamin.ducke at oxfordarch.co.uk




------
Files attached to this email may be in ISO 26300 format (OASIS Open Document Format). If you have difficulty opening them, please visit http://iso26300.info for more information.



More information about the grass-user mailing list