[GRASS-dev] [GRASS GIS] #829: v.in.ogr: when pointing to a folder import of vectors can produce wrong results

#829: v.in.ogr: when pointing to a folder import of vectors can produce wrong
results
----------------------+-----------------------------------------------------
Reporter: lutra | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: major | Milestone: 6.4.0
Component: Vector | Version: 6.4.0 RCs
Keywords: v.in.ogr | Platform: All
      Cpu: x86-32 |
----------------------+-----------------------------------------------------
I was giving a try to v.in.ogr pointing to a folder containing a few
shapfiles and the results didn't convinced me. So I made a simple test.

*) Created two simple shapefiles each containing one polygon, each polygon
partially overlapping the one in the other shape
*) Placed the shapes in one folder and run "v.in.ogr -o
dsn=/home/gio/test_shapes output=test_import"

The expected result was to obtain two layers each with one feature, as in
the original shapes.

Instead I get 3 layers:

*) One with one feature, representing the overlap area
*) Two representing the original polygons except for the fact they are
made of two features: the "extra" feature is the overlap area

Seems wrong to me, considering that if the poligons in the sample shapes
do not overlap, then the results are the expected ones.

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

#829: v.in.ogr: when pointing to a folder import of vectors can produce wrong
results
----------------------+-----------------------------------------------------
  Reporter: lutra | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: major | Milestone: 6.4.0
Component: Vector | Version: 6.4.0 RCs
Resolution: invalid | Keywords: v.in.ogr
  Platform: All | Cpu: x86-32
----------------------+-----------------------------------------------------
Changes (by mmetz):

  * status: new => closed
  * resolution: => invalid

Comment:

The overlap area becomes a separate area because a topological vector
format like in grass does not allow overlapping areas. You can try to
preserve the original areas with

{{{
v.in.ogr -c
}}}

(don't apply topological cleaning to areas), but may need to manually
place centroids of overlapping areas in a non-overlapping part of the
area; this is supported in grass and will give you a vector without
errors. Shapefiles are not topological, i.e. there is no connection
whatsoever between two polygons, be they separate, adjacent or
overlapping. Some other (proprietary) GIS applications with native
topological vectors don't even allow partially overlapping areas like
grass does.

In short, the results you got are the expected ones and the ticket is
invalid, but I hope I could clarify nevertheless why grass behaves the way
it does. Some more info is in the vector intro part of the manual.

Markus M

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

#829: v.in.ogr: when pointing to a folder import of vectors can produce wrong
results
----------------------+-----------------------------------------------------
  Reporter: lutra | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: major | Milestone: 6.4.0
Component: Vector | Version: 6.4.0 RCs
Resolution: invalid | Keywords: v.in.ogr
  Platform: All | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by pcav):

I think most users would expect a different behaviour from this command,
importing all the shp in a folder as different GRASS vectors. It would be
good to make this unexpected behaviour clear from the description of the
command (also in the QGIS plugin)

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

#829: v.in.ogr: when pointing to a folder import of vectors can produce wrong
results
----------------------+-----------------------------------------------------
  Reporter: lutra | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: major | Milestone: 6.4.0
Component: Vector | Version: 6.4.0 RCs
Resolution: invalid | Keywords: v.in.ogr
  Platform: All | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by mmetz):

Replying to [comment:2 pcav]:
> I think most users would expect a different behaviour from this command,
importing all the shp in a folder as different GRASS vectors. It would be
good to make this unexpected behaviour clear from the description of the
command (also in the QGIS plugin)

Right, the manual was not clear, I updated the description in grass64,
develbranch and trunk (r39972, r39973, r39974 respectively).

Importing all shapefiles in a folder as different grass vectors can be
done in the wxGUI with

File -> Import vector map -> Multiple vector data import using OGR

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

#829: v.in.ogr: when pointing to a folder import of vectors can produce wrong
results
----------------------+-----------------------------------------------------
  Reporter: lutra | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: major | Milestone: 6.4.0
Component: Vector | Version: 6.4.0 RCs
Resolution: invalid | Keywords: v.in.ogr
  Platform: All | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by lutra):

> Importing all shapefiles in a folder as different grass vectors can be
done in the wxGUI with
>
> File -> Import vector map -> Multiple vector data import using OGR

is this made trough a python script?

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

#829: v.in.ogr: when pointing to a folder import of vectors can produce wrong
results
----------------------+-----------------------------------------------------
  Reporter: lutra | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: major | Milestone: 6.4.0
Component: Vector | Version: 6.4.0 RCs
Resolution: invalid | Keywords: v.in.ogr
  Platform: All | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by mmetz):

Replying to [comment:4 lutra]:
>
> > Importing all shapefiles in a folder as different grass vectors can be
done in the wxGUI with
> >
> > File -> Import vector map -> Multiple vector data import using OGR
>
>
> is this made trough a python script?

It's written in python, but not as a single script, it is embedded into
the wxGUI and only available when using the wxGUI.

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

#829: v.in.ogr: when pointing to a folder import of vectors can produce wrong
results
----------------------+-----------------------------------------------------
  Reporter: lutra | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: major | Milestone: 6.4.0
Component: Vector | Version: 6.4.0 RCs
Resolution: invalid | Keywords: v.in.ogr
  Platform: All | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by lutra):

> It's written in python, but not as a single script, it is embedded into
the wxGUI and only available when using the wxGUI.

too bad, I was thinking to use it to create a script for the qgis GRASS
plugin

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