[GRASS-user] v.in.geonames not importing txt file in GRASS 7.0.0beta3 Windows

Hi,

I'm getting the following error on attempting to import geonames into GRASS
7.0.0beta3 on Windows7.

I've tried to import via the GUI and command console without success.
However, it does import with GRASS 7svn[57721] on Linux.

Richard

(Fri Oct 10 16:47:43 2014)
v.in.geonames input=C:\Users\rcooper\Desktop\TH.txt output=geonames_th
Converting 171472 place names...
cat: =0: No such file or directory
cat: output=geonames_th: No such file or directory
cat: y=5: No such file or directory
cat: input=C:\Users\rcooper\grassdata7/chula_4326/asiapoptha
i/.tmp/unknown/408.0: No such file or directory
cat: columns=geonameid integer,name varchar(200),asciiname
varchar(200),alternatename varchar(4000),latitude double
precision,longitude double precision,featureclass
varchar(1),featurecode varchar(10),countrycode
varchar(2),cc2 varchar(60),admin1code varchar(20),admin2code
varchar(20),admin3code varchar(20),admin4code
varchar(20),population integer,elevation varchar(5),gtopo30
integer,timezone varchar(50),modification date: File or path
name too long
Description:
Creates a vector map from an ASCII points file or ASCII
vector file.
Keywords:
vector, import, ASCII
Usage:
v.in.ascii [-zentbr] input=name output=name [format=string]
   [separator=character] [skip=value] [columns=string]
[x=value]
   [y=value] [z=value] [cat=value] [--overwrite] [--help]
[--verbose]
   [--quiet]
Flags:
  -z Create 3D vector map
  -e Create a new empty vector map and exit. Nothing is
read from input.
  -n Don't expect a header when reading in standard format
  -t Do not create table in points mode
  -b Do not build topology in points mode
  -r Only import points falling within current region
(points mode)
--o Allow output files to overwrite existing files
--h Print usage summary
--v Verbose module output
--q Quiet module output
Parameters:
      input Name of input file to be imported
               '-' for standard input
     output Name for output vector map
     format Input file format
              options: point,standard
              default: point
               point: simple x,y[,z] list
               standard: GRASS vector ASCII format
  separator Field separator
               Special characters: pipe, comma, space, tab,
newline
              default: pipe
       skip Number of header lines to skip at top of input
file (points mode)
              default: 0
    columns Column definition in SQL style (points mode)
               For example: 'x double precision, y double
precision, cat int, name varchar(10)'
          x Number of column used as x coordinate (points
mode)
               First column is 1
              default: 1
          y Number of column used as y coordinate (points
mode)
               First column is 1
              default: 2
          z Number of column used as z coordinate (points
mode)
               First column is 1. If 0, z coordinate is not
used
              default: 0
        cat Number of column used as category (points
mode)
               First column is 1. If 0, unique category is
assigned to each row and written to new column 'cat'
              default: 0
ERROR: Required parameter <input> not set:
        (Name of input file to be imported)
ERROR: Required parameter <output> not set:
        (Name for output vector map)
*ERROR: Vector map <geonames_th> not found*

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/v-in-geonames-not-importing-txt-file-in-GRASS-7-0-0beta3-Windows-tp5166832.html
Sent from the Grass - Users mailing list archive at Nabble.com.

On Fri, Oct 10, 2014 at 11:53 AM, RichardCooper <richtcooper@hotmail.com> wrote:

Hi,

I'm getting the following error on attempting to import geonames into GRASS
7.0.0beta3 on Windows7.

I've tried to import via the GUI and command console without success.
However, it does import with GRASS 7svn[57721] on Linux.

Richard

(Fri Oct 10 16:47:43 2014)
v.in.geonames input=C:\Users\rcooper\Desktop\TH.txt output=geonames_th
Converting 171472 place names...
cat: =0: No such file or directory
cat: output=geonames_th: No such file or directory
cat: y=5: No such file or directory
cat: input=C:\Users\rcooper\grassdata7/chula_4326/asiapoptha
i/.tmp/unknown/408.0: No such file or directory
cat: columns=geonameid integer,name varchar(200),asciiname

...

I have tried with current 7.0.svn using
http://download.geonames.org/export/dump/TH.zip

and did not face any problems (on Linux). The Python indentation was
probably not right (fixed in SVN) but I think that this won't matter.

I wonder if the internally used separator "|" may cause the issue?
Perhaps the internal v.in.ascii call should simply be done with the
existing tabs?

A Windows user is needed to explore that...

Markus

Markus Neteler wrote

On Fri, Oct 10, 2014 at 11:53 AM, RichardCooper &lt;

richtcooper@

&gt; wrote:

Hi,

I'm getting the following error on attempting to import geonames into
GRASS
7.0.0beta3 on Windows7.

I've tried to import via the GUI and command console without success.
However, it does import with GRASS 7svn[57721] on Linux.

Richard

(Fri Oct 10 16:47:43 2014)
v.in.geonames input=C:\Users\rcooper\Desktop\TH.txt output=geonames_th
Converting 171472 place names...
cat: =0: No such file or directory
cat: output=geonames_th: No such file or directory
cat: y=5: No such file or directory
cat: input=C:\Users\rcooper\grassdata7/chula_4326/asiapoptha
i/.tmp/unknown/408.0: No such file or directory
cat: columns=geonameid integer,name varchar(200),asciiname

...

I have tried with current 7.0.svn using
http://download.geonames.org/export/dump/TH.zip

and did not face any problems (on Linux). The Python indentation was
probably not right (fixed in SVN) but I think that this won't matter.

I wonder if the internally used separator "|" may cause the issue?
Perhaps the internal v.in.ascii call should simply be done with the
existing tabs?

A Windows user is needed to explore that...

Markus
_______________________________________________
grass-user mailing list

grass-user@.osgeo

http://lists.osgeo.org/mailman/listinfo/grass-user

tested here with

GRASS Version: 7.1.svn
GRASS SVN Revision: 62255
Erstellungsdatum: 2014-10-15
Build Platform: i686-pc-mingw32
GDAL/OGR: 1.11.0
PROJ.4: 4.8.0
GEOS: 3.4.2
SQLite: 3.7.17
Python: 2.7.4
wxPython: 2.8.12.1
Platform: Windows-7-6.1.7601-SP1 (OSGeo4W)

v.in.geonames --verbose input=C:\tmp\TH\TH.txt output=th
Converting 236734 place names...
Using native format
Scanne die Eingabe zur Ermittelung der Spaltentypen...
Maximale Länge der Inputzeile: 1998
Number of columns: 19
Column: 1 type: integer
Column: 2 type: string length: 114
Column: 3 type: string length: 102
Column: 4 type: string length: 1885
Column: 5 type: double
Column: 6 type: double
Column: 7 type: string length: 1
Column: 8 type: string length: 5
Column: 9 type: string length: 2
Column: 10 type: string length: 2
Column: 11 type: integer
Column: 12 type: integer
Column: 13 type: integer
Column: 14 type: integer
Column: 15 type: integer
Column: 16 type: integer
Column: 17 type: integer
Column: 18 type: string length: 14
Column: 19 type: string length: 10
WARNING: Spalte Nummer 11 <admin1code> ist als string definiert und hat nur
Integer-Werte.
WARNING: Spalte Nummer 12 <admin2code> ist als string definiert und hat nur
Integer-Werte.
WARNING: Spalte Nummer 13 <admin3code> ist als string definiert und hat nur
Integer-Werte.
WARNING: Spalte Nummer 14 <admin4code> ist als string definiert und hat nur
Integer-Werte.
WARNING: Spalte Nummer 16 <elevation> ist als string definiert und hat nur
Integer-Werte.
Importiere Punkte...
Fülle Tabelle...
Erstelle Topologie für die Vektorkarte <th@test>...
Registriere Primitive...
236734 primitives registered
236734 Vertices registriert
Erzeuge Flächen...
0 areas built
0 isles built
Füge Inseln hinzu...
Füge Zentroide hinzu...
Die Topologie wurde erstellt.
Anzahl der Knoten: 0
Anzahl der Primitive: 236734
Anzahl der Punkte: 236734
Anzahl der Linien: 0
Anzahl der Grenzen: 0
Anzahl der Zentroide: 0
Anzahl der Flächen: 0
Anzahl der Inseln: 0

seems to work here.

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/v-in-geonames-not-importing-txt-file-in-GRASS-7-0-0beta3-Windows-tp5166832p5167599.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Please, remove me from the list.

Thank you
Den 15.10.2014 10:34, Helmut Kudrnovsky skrev:

Markus Neteler wrote

On Fri, Oct 10, 2014 at 11:53 AM, RichardCooper &lt;
richtcooper@
&gt; wrote:

Hi,

I'm getting the following error on attempting to import geonames into
GRASS
7.0.0beta3 on Windows7.

I've tried to import via the GUI and command console without success.
However, it does import with GRASS 7svn[57721] on Linux.

Richard

(Fri Oct 10 16:47:43 2014)
v.in.geonames input=C:\Users\rcooper\Desktop\TH.txt output=geonames_th
Converting 171472 place names...
cat: =0: No such file or directory
cat: output=geonames_th: No such file or directory
cat: y=5: No such file or directory
cat: input=C:\Users\rcooper\grassdata7/chula_4326/asiapoptha
i/.tmp/unknown/408.0: No such file or directory
cat: columns=geonameid integer,name varchar(200),asciiname

...

I have tried with current 7.0.svn using
http://download.geonames.org/export/dump/TH.zip

and did not face any problems (on Linux). The Python indentation was
probably not right (fixed in SVN) but I think that this won't matter.

I wonder if the internally used separator "|" may cause the issue?
Perhaps the internal v.in.ascii call should simply be done with the
existing tabs?

A Windows user is needed to explore that...

Markus
_______________________________________________
grass-user mailing list
grass-user@.osgeo
http://lists.osgeo.org/mailman/listinfo/grass-user

tested here with

GRASS Version: 7.1.svn
GRASS SVN Revision: 62255
Erstellungsdatum: 2014-10-15
Build Platform: i686-pc-mingw32
GDAL/OGR: 1.11.0
PROJ.4: 4.8.0
GEOS: 3.4.2
SQLite: 3.7.17
Python: 2.7.4
wxPython: 2.8.12.1
Platform: Windows-7-6.1.7601-SP1 (OSGeo4W)

v.in.geonames --verbose input=C:\tmp\TH\TH.txt output=th
Converting 236734 place names...
Using native format
Scanne die Eingabe zur Ermittelung der Spaltentypen...
Maximale Länge der Inputzeile: 1998
Number of columns: 19
Column: 1 type: integer
Column: 2 type: string length: 114
Column: 3 type: string length: 102
Column: 4 type: string length: 1885
Column: 5 type: double
Column: 6 type: double
Column: 7 type: string length: 1
Column: 8 type: string length: 5
Column: 9 type: string length: 2
Column: 10 type: string length: 2
Column: 11 type: integer
Column: 12 type: integer
Column: 13 type: integer
Column: 14 type: integer
Column: 15 type: integer
Column: 16 type: integer
Column: 17 type: integer
Column: 18 type: string length: 14
Column: 19 type: string length: 10
WARNING: Spalte Nummer 11 <admin1code> ist als string definiert und hat nur
Integer-Werte.
WARNING: Spalte Nummer 12 <admin2code> ist als string definiert und hat nur
Integer-Werte.
WARNING: Spalte Nummer 13 <admin3code> ist als string definiert und hat nur
Integer-Werte.
WARNING: Spalte Nummer 14 <admin4code> ist als string definiert und hat nur
Integer-Werte.
WARNING: Spalte Nummer 16 <elevation> ist als string definiert und hat nur
Integer-Werte.
Importiere Punkte...
Fülle Tabelle...
Erstelle Topologie für die Vektorkarte <th@test>...
Registriere Primitive...
236734 primitives registered
236734 Vertices registriert
Erzeuge Flächen...
0 areas built
0 isles built
Füge Inseln hinzu...
Füge Zentroide hinzu...
Die Topologie wurde erstellt.
Anzahl der Knoten: 0
Anzahl der Primitive: 236734
Anzahl der Punkte: 236734
Anzahl der Linien: 0
Anzahl der Grenzen: 0
Anzahl der Zentroide: 0
Anzahl der Flächen: 0
Anzahl der Inseln: 0

seems to work here.

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/v-in-geonames-not-importing-txt-file-in-GRASS-7-0-0beta3-Windows-tp5166832p5167599.html
Sent from the Grass - Users mailing list archive at Nabble.com.
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

For reference, my system:

(Wed Oct 15 20:24:41 2014) Command finished (1 sec)
System Info
GRASS version: 7.0.0beta3
GRASS SVN Revision: 61541
Build Date: 2014-08-06
Build Platform: i686-pc-mingw32
GDAL/OGR: 1.11.0
PROJ.4: 4.8.0
GEOS: 3.4.2
SQLite: 3.7.17
Python: 2.7.4
wxPython: 2.8.12.1
Platform: Windows-7-6.1.7601-SP1

I also tried with geonames CZ.txt, as follows:
v.in.geonames --overwrite input=C:\Users\rcooper\CZ.txt output=czgeonames
Converting 21931 place names...
cat: =0: No such file or directory
cat: output=czgeonames: No such file or directory
cat: y=5: No such file or directory
cat: input=C:\Users\rcooper\grassdata7/chula_4326/asiapoptha
i/.tmp/unknown/1804.0: No such file or directory
cat: columns=geonameid integer,name varchar(200),asciiname
varchar(200),alternatename varchar(4000),latitude double
precision,longitude double precision,featureclass
varchar(1),featurecode varchar(10),countrycode
varchar(2),cc2 varchar(60),admin1code varchar(20),admin2code
varchar(20),admin3code varchar(20),admin4code
varchar(20),population integer,elevation varchar(5),gtopo30
integer,timezone varchar(50),modification date: File or path
name too long
Description:
Creates a vector map from an ASCII points file or ASCII
vector file.
Keywords:
vector, import, ASCII
Usage:
v.in.ascii [-zentbr] input=name output=name [format=string]
   [separator=character] [skip=value] [columns=string]
[x=value]
   [y=value] [z=value] [cat=value] [--overwrite] [--help]
[--verbose]
   [--quiet]
Flags:
  -z Create 3D vector map
  -e Create a new empty vector map and exit. Nothing is
read from input.
  -n Don't expect a header when reading in standard format
  -t Do not create table in points mode
  -b Do not build topology in points mode
  -r Only import points falling within current region
(points mode)
--o Allow output files to overwrite existing files
--h Print usage summary
--v Verbose module output
--q Quiet module output
Parameters:
      input Name of input file to be imported
               '-' for standard input
     output Name for output vector map
     format Input file format
              options: point,standard
              default: point
               point: simple x,y[,z] list
               standard: GRASS vector ASCII format
  separator Field separator
               Special characters: pipe, comma, space, tab,
newline
              default: pipe
       skip Number of header lines to skip at top of input
file (points mode)
              default: 0
    columns Column definition in SQL style (points mode)
               For example: 'x double precision, y double
precision, cat int, name varchar(10)'
          x Number of column used as x coordinate (points
mode)
               First column is 1
              default: 1
          y Number of column used as y coordinate (points
mode)
               First column is 1
              default: 2
          z Number of column used as z coordinate (points
mode)
               First column is 1. If 0, z coordinate is not
used
              default: 0
        cat Number of column used as category (points
mode)
               First column is 1. If 0, unique category is
assigned to each row and written to new column 'cat'
              default: 0
ERROR: Required parameter <input> not set:
        (Name of input file to be imported)
ERROR: Required parameter <output> not set:
        (Name for output vector map)
ERROR: Vector map <czgeonames> not found
(Wed Oct 15 20:29:34 2014) Command finished (8 sec)

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/v-in-geonames-not-importing-txt-file-in-GRASS-7-0-0beta3-Windows-tp5166832p5167650.html
Sent from the Grass - Users mailing list archive at Nabble.com.

RichardCooper wrote

For reference, my system:

(Wed Oct 15 20:24:41 2014) Command finished (1 sec)
System Info
GRASS version: 7.0.0beta3
GRASS SVN Revision: 61541
Build Date: 2014-08-06
Build Platform: i686-pc-mingw32
GDAL/OGR: 1.11.0
PROJ.4: 4.8.0
GEOS: 3.4.2
SQLite: 3.7.17
Python: 2.7.4
wxPython: 2.8.12.1
Platform: Windows-7-6.1.7601-SP1
(Wed Oct 15 20:29:34 2014) Command finished (8 sec)

any chance to test a newer version? e.g. latest standalone installer

http://wingrass.fsv.cvut.cz/grass70/

or

http://wingrass.fsv.cvut.cz/grass71/

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/v-in-geonames-not-importing-txt-file-in-GRASS-7-0-0beta3-Windows-tp5166832p5167689.html
Sent from the Grass - Users mailing list archive at Nabble.com.

On Wed, Oct 15, 2014 at 3:41 PM, RichardCooper <richtcooper@hotmail.com> wrote:

For reference, my system:

(Wed Oct 15 20:24:41 2014) Command finished (1 sec)
System Info
GRASS version: 7.0.0beta3

I have submitted fixes in r62271. Could you test the 7.1.svn version?

Otherwise you may even substitute the script in your installation with
this new version:
https://svn.osgeo.org/grass/grass/trunk/scripts/v.in.geonames/v.in.geonames.py

Markus

Hi,

I replaced the geonames script in my existing 7.0.0beta3 installation (I'm
using this version on my computer for teaching this week) and it imports
fine. I do notice however that in the Map Display, the Thai characters of
the 'alternatename' field are not displaying correctly in the query results
window (pls see below). However, Thai characters are correctly displayed in
the imported file's attribute table.

Query results of one point in Map Display:

geonames_th@asiapopthai:
  Category: 78127
  Layer: 1
  Key_column: cat
  Database:
C:\Users\rcooper\grassdata7\chula_4326\asiapopthai\sqlite\sqlite.db
  Type: Point
  Driver: sqlite
  Table: geonames_th
  Attributes:
    name: Ban_Dong_Samphan
    countrycode: TH
    geonameid: 7680691
    gtopo30: 198
    featurecode: PPL
    longitude: 102.96903
    cat: 78127
    admin1code: 76
    modification: 2012-01-21
    timezone: Asia/Bangkok
    featureclass: P
    latitude: 17.7022
    asciiname: Ban_Dong_Samphan
* alternatename:
Ban_Dong_Samphan,ban_dng_samphanth,บ้านดงสัมพันธ์*
    population: 0
  Id: 78127

Attribute table: alternatename field: *Ban Dong Samphan,ban dng
samphanth,บ้านดงสัมพันธ์*

Richard
  
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/v-in-geonames-not-importing-txt-file-in-GRASS-7-0-0beta3-Windows-tp5166832p5167923.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Regarding the 7.0.0svn version on Linux(62228), Thai characters display
correctly when a point is queried in the Map Display.

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/v-in-geonames-not-importing-txt-file-in-GRASS-7-0-0beta3-Windows-tp5166832p5167925.html
Sent from the Grass - Users mailing list archive at Nabble.com.

RichardCooper wrote

I do notice however that in the Map Display, the Thai characters of the
'alternatename' field are not displaying correctly in the query results
window (pls see below). However, Thai characters are correctly displayed
in the imported file's attribute table.

Query results of one point in Map Display:

geonames_th@asiapopthai:
  Category: 78127
  Layer: 1
  Key_column: cat
  Database:
C:\Users\rcooper\grassdata7\chula_4326\asiapopthai\sqlite\sqlite.db
  Type: Point
  Driver: sqlite
  Table: geonames_th
  Attributes:
    name: Ban_Dong_Samphan
    countrycode: TH
    geonameid: 7680691
    gtopo30: 198
    featurecode: PPL
    longitude: 102.96903
    cat: 78127
    admin1code: 76
    modification: 2012-01-21
    timezone: Asia/Bangkok
    featureclass: P
    latitude: 17.7022
    asciiname: Ban_Dong_Samphan

*

    alternatename:
Ban_Dong_Samphan,ban_dng_samphanth,บ้านดงสัมพันธ์

*

    population: 0
  Id: 78127

Attribute table: alternatename field:

*

Ban Dong Samphan,ban dng samphanth,บ้านดงสัมพันธ์

*

Richard

please open a ticket for this: http://trac.osgeo.org/grass/

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/v-in-geonames-not-importing-txt-file-in-GRASS-7-0-0beta3-Windows-tp5166832p5167942.html
Sent from the Grass - Users mailing list archive at Nabble.com.

On Fri, Oct 17, 2014 at 5:32 AM, RichardCooper <richtcooper@hotmail.com> wrote:

Hi,

I replaced the geonames script in my existing 7.0.0beta3 installation (I'm
using this version on my computer for teaching this week) and it imports
fine.

Fine, so I have backported it to 7.0.svn.

I do notice however that in the Map Display, the Thai characters of
the 'alternatename' field are not displaying correctly in the query results
window (pls see below). However, Thai characters are correctly displayed in
the imported file's attribute table.

...

Since this is a different issue (display) with which I am less
familiar, please open a ticket as Helmut suggests.

Markus

Ticket opened at http://trac.osgeo.org/grass/ticket/2453

Richard

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/v-in-geonames-not-importing-txt-file-in-GRASS-7-0-0beta3-Windows-tp5166832p5167965.html
Sent from the Grass - Users mailing list archive at Nabble.com.