[GRASS-user] Import vector: illegal filename

Here is a link to a previous discussion about the following error message:
"Illegal filename. Character not allowed."

http://osgeo-org.1803224.n2.nabble.com/List-of-illegal-characters-for-filenames-td5669950.html#a5671015
http://osgeo-org.1803224.n2.nabble.com/List-of-illegal-characters-for-filenames-td5669950.html#a5671015

Do these rules also apply to field names in attribute tables? I ask b/c I
get an error with the following filenames, which appear to conform with the
rules (as underscores are permitted):

My input vector layer = "Forest_District"
My output vector map = "Forest_District"

I have yet to succeed in opening a single shapefile in GRASS. I am using
the QGIS interface currently and I can provide any information the forum
requires.

Deagon

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Import-vector-illegal-filename-tp6638439p6638439.html
Sent from the Grass - Users mailing list archive at Nabble.com.

deagon wrote:

Here is a link to a previous discussion about the following error message:
"Illegal filename. Character not allowed."

http://osgeo-org.1803224.n2.nabble.com/List-of-illegal-characters-for-filenames-td5669950.html#a5671015
http://osgeo-org.1803224.n2.nabble.com/List-of-illegal-characters-for-filenames-td5669950.html#a5671015

Do these rules also apply to field names in attribute tables?

Database column and table names are limited by the SQL standard, as
well as the particular database back-end.

I ask b/c I
get an error with the following filenames, which appear to conform with the
rules (as underscores are permitted):

My input vector layer = "Forest_District"
My output vector map = "Forest_District"

I have yet to succeed in opening a single shapefile in GRASS.

I believe that the DBF driver limits column names to 10 characters. I
don't know whether that also applies to table names.

--
Glynn Clements <glynn@gclements.plus.com>

Thank you for the feedback Glynn. Let's have a look at this simple example.

The input and output names are both 'NL1980s'.

The column names are as follows: 'id', 'day', 'x', 'y', 'col_type', 'herd',
'year', 'month', 'coords_x1', 'coords_x2'

All names are less than 10 characters and only use letters, digits and/or
underscore....
I don't believe any are SQL keywords (please correct me if I'm wrong)....

Do you see any errors with this? Here is the message I get:

v.in.ogr -o dsn=C:/GIS/NL/NL1980s.shp output=NL1980s snap=-1 min_area=0.0001
Illegal filename. Character not allowed.

Over-riding projection check
Illegal filename. Character not allowed.
Illegal filename. Character not allowed.
Illegal filename. Character not allowed.

Layer: NL1980s

Counting polygons for 8036 features...

Importing map 8036 features...

-----------------------------------------------------

Building topology for vector map ...

Registering primitives...
     1000 2000 3000 4000
5000 6000 7000 8000
8036 primitives registered

8036 vertices registered

Number of nodes: 6466

Number of primitives: 8036

Number of points: 8036

Number of lines: 0

Number of boundaries: 0

Number of centroids: 0

Number of areas: -

Number of isles: -
Illegal filename. Character not allowed.

Vector map not found
Finished with error

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Import-vector-illegal-filename-tp6638439p6638853.html
Sent from the Grass - Users mailing list archive at Nabble.com.

deagon wrote:

v.in.ogr -o dsn=C:/GIS/NL/NL1980s.shp output=NL1980s snap=-1 min_area=0.0001
Illegal filename. Character not allowed.

Over-riding projection check
Illegal filename. Character not allowed.
Illegal filename. Character not allowed.
Illegal filename. Character not allowed.

This error comes from G_legal_filename():

  if (*s == '/' || *s == '"' || *s == '\'' || *s <= ' ' ||
      *s == '@' || *s == ',' || *s == '=' || *s == '*' || *s > 0176) {
      G_warning(_("Illegal filename <%s>. Character <%c> not allowed.\n"), name, *s);
      return -1;
  }

It appears that an invalid (and non-printable) character has crept in
to the value of the output= option.

Unfortunately, I don't have any ideas as to how to track this down.

How is the command being entered? In QGIS? the wxGUI? bash? cmd.exe?
If it's QGIS, I can only suggest taking it up with the QGIS
developers. If you can reproduce the error within GRASS itself, please
provide details.

--
Glynn Clements <glynn@gclements.plus.com>