[GRASS-dev] [GRASS GIS] #222: v.in gns broken in grass 7.0 trunk

#222: v.in gns broken in grass 7.0 trunk
----------------------+-----------------------------------------------------
Reporter: gisix | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: major | Milestone: 6.3.1
Component: Vector | Version: svn-trunk
Keywords: v.in.gns | Platform: Linux
      Cpu: x86-32 |
----------------------+-----------------------------------------------------
v.in.gns aborts when applied to a country file:

GRASS 7.0.svn (wgs84_4326):~/gns > v.in.gns --overwrite file=ce.txt
vect=sri
Converted 36554 place names.
WARNUNG: Vector map <sri> already exists and will be overwritten
Scanning input for column types...
Current row:
'RC;UFI;UNI;LAT;LONG;DMS_LAT;DMS_LONG;MGRS;JOG;FC;DSG;PC;CC1;ADM1;ADM2;POP;ELEV;CC2;NT;LC;SHORT_FORM;GENERIC;SORT_NAME;FULL_NAME;FULL_NAME_ND;MODIFY_DATE'
FEHLER: Unparsable latitude value in column <3>: LAT
FEHLER: Unable to open vector map <sri@gns> on topology level 2

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/222&gt;
GRASS GIS <http://grass.osgeo.org>

#222: v.in gns broken in grass 7.0 trunk
---------------------+------------------------------------------------------
  Reporter: gisix | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.3.1
Component: Vector | Version: svn-trunk
Resolution: | Keywords: v.in.gns
  Platform: Linux | Cpu: x86-32
---------------------+------------------------------------------------------
Old description:

v.in.gns aborts when applied to a country file:

GRASS 7.0.svn (wgs84_4326):~/gns > v.in.gns --overwrite file=ce.txt
vect=sri
Converted 36554 place names.
WARNUNG: Vector map <sri> already exists and will be overwritten
Scanning input for column types...
Current row:
'RC;UFI;UNI;LAT;LONG;DMS_LAT;DMS_LONG;MGRS;JOG;FC;DSG;PC;CC1;ADM1;ADM2;POP;ELEV;CC2;NT;LC;SHORT_FORM;GENERIC;SORT_NAME;FULL_NAME;FULL_NAME_ND;MODIFY_DATE'
FEHLER: Unparsable latitude value in column <3>: LAT
FEHLER: Unable to open vector map <sri@gns> on topology level 2

New description:

v.in.gns aborts when applied to a country file:

{{{
GRASS 7.0.svn (wgs84_4326):~/gns > v.in.gns --overwrite file=ce.txt
vect=sri
Converted 36554 place names.
WARNUNG: Vector map <sri> already exists and will be overwritten
Scanning input for column types...
Current row:
'RC;UFI;UNI;LAT;LONG;DMS_LAT;DMS_LONG;MGRS;JOG;FC;DSG;PC;CC1;ADM1;ADM2;POP;ELEV;CC2;NT;LC;SHORT_FORM;GENERIC;SORT_NAME;FULL_NAME;FULL_NAME_ND;MODIFY_DATE'
FEHLER: Unparsable latitude value in column <3>: LAT
FEHLER: Unable to open vector map <sri@gns> on topology level 2
}}}

Comment (by neteler):

Please post the URL to ce.txt.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/222#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#222: v.in gns broken in grass 7.0 trunk
---------------------+------------------------------------------------------
  Reporter: gisix | Owner: gisix
      Type: defect | Status: assigned
  Priority: major | Milestone: 6.3.1
Component: Vector | Version: svn-trunk
Resolution: | Keywords: v.in.gns
  Platform: Linux | Cpu: x86-32
---------------------+------------------------------------------------------
Changes (by neteler):

* cc: grass-dev@lists.osgeo.org (added)

Comment:

please keep grass-dev in the loop.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/222#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#222: v.in gns broken in grass 7.0 trunk
---------------------+------------------------------------------------------
  Reporter: gisix | Owner: gisix
      Type: defect | Status: assigned
  Priority: major | Milestone: 6.3.1
Component: Vector | Version: svn-trunk
Resolution: | Keywords: v.in.gns
  Platform: Linux | Cpu: x86-32
---------------------+------------------------------------------------------
Comment (by gisix):

Replying to [comment:3 neteler]:
> please keep grass-dev in the loop.

right.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/222#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#222: v.in gns broken in grass 7.0 trunk
---------------------+------------------------------------------------------
  Reporter: gisix | Owner: gisix
      Type: defect | Status: assigned
  Priority: major | Milestone: 6.3.1
Component: Vector | Version: svn-trunk
Resolution: | Keywords: v.in.gns
  Platform: Linux | Cpu: x86-32
---------------------+------------------------------------------------------
Comment (by neteler):

Apparently they changed the GNS format :frowning:
Attached a hacked patch.

Note that geonames.org most likely provides better data (AFAIK they
include GNS).

Markus

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/222#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#222: v.in gns broken in grass 7.0 trunk
---------------------+------------------------------------------------------
  Reporter: gisix | Owner: gisix
      Type: defect | Status: assigned
  Priority: major | Milestone: 6.3.1
Component: Vector | Version: svn-trunk
Resolution: | Keywords: v.in.gns
  Platform: Linux | Cpu: x86-32
---------------------+------------------------------------------------------
Comment (by gisix):

Replying to [comment:1 neteler]:
> Please post the URL to ce.txt.

The patch fixes the problems with the sri lanka file (ce.txt)
yet fails for thailand: http://earth-info.nga.mil/gns/html/cntyfile/th.zip

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/222#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

#222: v.in gns broken in grass 7.0 trunk
---------------------+------------------------------------------------------
  Reporter: gisix | Owner: gisix
      Type: defect | Status: assigned
  Priority: major | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Resolution: | Keywords: v.in.gns
  Platform: Linux | Cpu: x86-32
---------------------+------------------------------------------------------
Changes (by neteler):

  * milestone: 6.3.1 => 7.0.0

Old description:

v.in.gns aborts when applied to a country file:

{{{
GRASS 7.0.svn (wgs84_4326):~/gns > v.in.gns --overwrite file=ce.txt
vect=sri
Converted 36554 place names.
WARNUNG: Vector map <sri> already exists and will be overwritten
Scanning input for column types...
Current row:
'RC;UFI;UNI;LAT;LONG;DMS_LAT;DMS_LONG;MGRS;JOG;FC;DSG;PC;CC1;ADM1;ADM2;POP;ELEV;CC2;NT;LC;SHORT_FORM;GENERIC;SORT_NAME;FULL_NAME;FULL_NAME_ND;MODIFY_DATE'
FEHLER: Unparsable latitude value in column <3>: LAT
FEHLER: Unable to open vector map <sri@gns> on topology level 2
}}}

New description:

v.in.gns aborts when applied to a country file:

{{{
GRASS 7.0.svn (wgs84_4326):~/gns > v.in.gns --overwrite file=ce.txt
vect=sri
Converted 36554 place names.
WARNUNG: Vector map <sri> already exists and will be overwritten
Scanning input for column types...
Current row:
'RC;UFI;UNI;LAT;LONG;DMS_LAT;DMS_LONG;MGRS;JOG;FC;DSG;PC;CC1;ADM1;ADM2;POP;ELEV;CC2;NT;LC;SHORT_FORM;GENERIC;SORT_NAME;FULL_NAME;FULL_NAME_ND;MODIFY_DATE'
FEHLER: Unparsable latitude value in column <3>: LAT
FEHLER: Unable to open vector map <sri@gns> on topology level 2
}}}

Comment:

(milestone tag fixed)

I am not sure how to address this problem if the GNS format is a moving
target...

Markus

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/222#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>

GRASS GIS wrote:

#222: v.in gns broken in grass 7.0 trunk
---------------------+------------------------------------------------------
  Reporter: gisix | Owner: gisix
      Type: defect | Status: assigned
  Priority: major | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Resolution: | Keywords: v.in.gns
  Platform: Linux | Cpu: x86-32
---------------------+------------------------------------------------------
Changes (by neteler):

  * milestone: 6.3.1 => 7.0.0

Old description:

> v.in.gns aborts when applied to a country file:
>

> {{{
> GRASS 7.0.svn (wgs84_4326):~/gns > v.in.gns --overwrite file=ce.txt
> vect=sri
> Converted 36554 place names.
> WARNUNG: Vector map <sri> already exists and will be overwritten
> Scanning input for column types...
> Current row:
> 'RC;UFI;UNI;LAT;LONG;DMS_LAT;DMS_LONG;MGRS;JOG;FC;DSG;PC;CC1;ADM1;ADM2;POP;ELEV;CC2;NT;LC;SHORT_FORM;GENERIC;SORT_NAME;FULL_NAME;FULL_NAME_ND;MODIFY_DATE'
> FEHLER: Unparsable latitude value in column <3>: LAT
> FEHLER: Unable to open vector map <sri@gns> on topology level 2
> }}}

New description:

v.in.gns aborts when applied to a country file:

{{{
GRASS 7.0.svn (wgs84_4326):~/gns > v.in.gns --overwrite file=ce.txt
vect=sri
Converted 36554 place names.
WARNUNG: Vector map <sri> already exists and will be overwritten
Scanning input for column types...
Current row:
'RC;UFI;UNI;LAT;LONG;DMS_LAT;DMS_LONG;MGRS;JOG;FC;DSG;PC;CC1;ADM1;ADM2;POP;ELEV;CC2;NT;LC;SHORT_FORM;GENERIC;SORT_NAME;FULL_NAME;FULL_NAME_ND;MODIFY_DATE'
FEHLER: Unparsable latitude value in column <3>: LAT
FEHLER: Unable to open vector map <sri@gns> on topology level 2
}}}

Comment:

(milestone tag fixed)

I am not sure how to address this problem if the GNS format is a moving
target...

Is this the shell version or the Python version?

AFAICT, the Python version will never copy the first row to the
temporary file passed to v.in.ascii, regardless of its contents. Also,
the temporary file should always match the original hard-coded schema,
regardless of the schema used by the input data.

[The reason for this is that the test file which I used for testing
didn't match the original hard-coded schema.]

In retrospect, it would probably be better to import the data verbatim
(i.e. with the schema from the first row of the file), and simply
adjust v.in.ascii's x= and y= parameters to match the file.

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

#222: v.in gns broken in grass 7.0 trunk
----------------------+-----------------------------------------------------
Reporter: gisix | Owner: gisix
     Type: defect | Status: assigned
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Keywords: v.in.gns | Platform: Linux
      Cpu: x86-32 |
----------------------+-----------------------------------------------------
Changes (by mlennert):

  * priority: major => normal

Comment:

No one has touched this report for 5 years and the code has not changed
significantly.

I just tried with 8 different gns country files and only 2 worked.

As this is only a convenience script around v.in.ascii, I propose to
deprecate this module and take it out of trunk and/or move it to addons.

In any case, while waiting for opinions, I'm downgrading this to normal.

Moritz

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/222#comment:8&gt;
GRASS GIS <http://grass.osgeo.org>

#222: v.in gns broken in grass 7.0 trunk
----------------------+-----------------------------------------------------
Reporter: gisix | Owner: gisix
     Type: defect | Status: assigned
Priority: blocker | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Keywords: v.in.gns | Platform: Linux
      Cpu: x86-32 |
----------------------+-----------------------------------------------------
Changes (by neteler):

  * priority: normal => blocker

Comment:

I agree that v.in.gns should be moved to Addons (superseded by
v.in.geonames).

See
http://grasswiki.osgeo.org/wiki/GRASS_7_ideas_collection#Dead_code_cleanup

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/222#comment:9&gt;
GRASS GIS <http://grass.osgeo.org>

#222: v.in gns broken in grass 7.0 trunk
----------------------+-----------------------------------------------------
  Reporter: gisix | Owner: gisix
      Type: defect | Status: closed
  Priority: blocker | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Resolution: fixed | Keywords: v.in.gns
  Platform: Linux | Cpu: x86-32
----------------------+-----------------------------------------------------
Changes (by lucadelu):

  * status: assigned => closed
  * resolution: => fixed

Comment:

Replying to [comment:9 neteler]:
> I agree that v.in.gns should be moved to Addons (superseded by
v.in.geonames).
>
> See
http://grasswiki.osgeo.org/wiki/GRASS_7_ideas_collection#Dead_code_cleanup

I fixed it with the last version of GNS in r62900, I'm able to load all
the txt files inside the th.zip.

I also moves the script to addons r62902 (it is possible to install it
using g.extension).

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/222#comment:10&gt;
GRASS GIS <http://grass.osgeo.org>

#222: v.in gns broken in grass 7.0 trunk
----------------------+-----------------------------------------------------
  Reporter: gisix | Owner: gisix
      Type: defect | Status: closed
  Priority: blocker | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Resolution: fixed | Keywords: v.in.gns
  Platform: Linux | Cpu: x86-32
----------------------+-----------------------------------------------------

Comment(by neteler):

Replying to [comment:10 lucadelu]:
> I also moves the script to addons r62902 (it is possible to install it
using g.extension).

Since it is a functional addon now, removed from relbranch70 in r63648.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/222#comment:11&gt;
GRASS GIS <http://grass.osgeo.org>