[GRASS-dev] v.external, ogr direct access, topology and pseudo-topology.... a bit confused

Markus Metz markus.metz.giswork at googlemail.com
Mon Apr 19 13:15:01 EDT 2010


G. Allegri wrote:

>
>
> Markus Metz:
> >
> > v.select requires a spatial index which in turn requires (at least some
> basic information stored in) topology. Doing the same >operation without a
> spatial index would be much slower. BTW, v.select should be faster in GRASS
> 7 than in GRASS 6.x, >particularly for larger vectors, because the spatial
> index is handled differently in GRASS 7. The same applies for v.what (simple
> >vector querying).
>
> ok, this is how grass works, but spatial index isn't strictly associated to
> topology. Many other gis systems use indexes but don't require topology
> info.


GRASS works like this for historical reasons, in GRASS 6.x the spatial index
is always built on the fly from topology, and because the spatial index also
holds features only available with topology (nodes, areas and isles of
native GRASS vectors). Technically it's possible to change that in GRASS 7
and build a spatial index but no topology.

>
>
> >For direct OGR access however, topology is always built anew on the fly,
> whenever that OGR vector is accessed which can take >some time for larger
> vectors.
>
> you mean pseudo-topology. I'm sorry, but I need to be clear, otherwise I
> make some confusion :)


Right, I meant pseudo-topology.

>
>
> [...] I just expect a user to be able to import a polygonal layer, without
> worrying about topology correctness (clean/build operations), and do spatial
> operations on it.


Spatial operations without a preceding topology build are currently not
possible in GRASS. It would be quite a lot of work to change that if
possible at all. Note that topology must not necessarily be correct, but for
most operations in GRASS it must exist. I don't see such a huge drawback in
building topology for OGR vectors, but then admittedly I usually import and
clean them before I work with them.


>
> > These operations should be quite fast for native vectors with topology.
>
> With "rapidly" I meant: load data, do-the-op, save the results. I'm sure
> that the native grass data structures can deal more efficiently then SF
> structures.... but often a user prefer to wait a minute more for the
> operation to end, then working a minute to have to manage the data cleaness
> (more often it takes much more then a minute, and it doesn't worth it!)


Cleaning is optional although highly recommended ;-) Contrary to some other
topological vector formats, GRASS vectors must not be 100% clean and correct
and most modules can tolerate somewhat corrupted topology. IOW, you could
e.g. clip an OGR vector (linked in with v.external or direct OGR access) and
directly export the result without cleaning, sometimes it might work,
sometimes not.

OGR support in GRASS 7 is work in progress, I'm sure it will improve in the
near future.

Markus M

>
>
>
>
> >
> >>
> >> 2010/4/19 Markus Metz>
> >>>
> >>> G. Allegri wrote:
> >>>>
> >>>> I open a new post on the argument because it's something more general
> >>>> that me and my collegues need to unsertstand.
> >>>> I've tried to make the point with the various vector structures and
> >>>> modes in grass7 and I admit to be a bit confused.
> >>>>
> >>>>  - v.external is meant to read ogr data sources without the
> >>>> topoloigcal overhead.
> >>>
> >>>
> >>> By default, pseudo-topology and a spatial index is built for both
> v.external and direct OGR access.
> >>>
> >>>> Questions:
> >>>>    - what is meant by pseduo-topology?
> >>>
> >>> Reduced topology: each boundary is attached to one area only, i.e.
> smoothing, simplification, removing small areas etc. will not work properly
> for adjacent areas or areas within areas.
> >>>
> >>>>
> >>>>    - does the 'b' option is referred to pseudo-topology creation? If
> >>>> I set it, I cannot see the map and the "zoom to selected map" gives me
> >>>> an empty error box...
> >>>
> >>> ... because the extends of a vector map are stored in topology, also in
> pseudo-topology. If topology and thus the extends are not available, "zoom
> to selected map" won't work. And yes, the 'b' option refers to
> pseudo-topology.
> >>>
> >>>>
> >>>>  - direct read/write access creates the same topo structure as native
> >>>> access, but it builds it each time I open the data source. Am I wrong?
> >>>> Is it too simplicistic my understanding?
> >>>
> >>> No, it also builds pseudo-topology, not native full topology, this is
> only available for native GRASS vectors. Full, correct topology can only be
> built after all polygons are cleaned as done by v.in.ogr.
> >>>>
> >>>> My first concern is about the use of simple features in the grass
> >>>> environment, and tha ability to write SF algorithms
> >>>
> >>> Can you give examples for such SF algorithms/operators? It's not clear
> to me what you have in mind.
> >>>
> >>>>
> >>>> that don't require
> >>>> topology to be built. This is a requirement in daily work, mostly when
> >>>> we deal with unclean polygonal data but the topology is not required
> >>>> (ie simple feature operators, etc.).
> >>>
> >>> GRASS is rather strict about polygonal data. Working with unclean
> polygonal data will produce unclean results which is not desired IMHO.
> >>>
> >>> It seems to me that you are missing some functionality in GRASS, so it
> would be great if you could give some examples about what is missing.
> >>>
> >>> Markus M
> >>
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-dev/attachments/20100419/bb15c31a/attachment.html


More information about the grass-dev mailing list