[GRASS-dev] v.out.ogr exports more features than available

Markus Metz markus.metz.giswork at googlemail.com
Wed Dec 14 07:16:55 EST 2011


On Wed, Dec 14, 2011 at 8:16 AM, Maris Nartiss <maris.gis at gmail.com> wrote:
> OK. When creating a new test dataset I understood where's the problem:
> v.clean rmdupl will remove duplicate geometries and will merge
> categories resulting in single geometry, multiple categories
> (acceptable in GRASS)
> v.out.ogr can not export multiple categories to Shapefile as it
> doesn't support such construct. v.out.ogr "fixes" it by duplicating
> geometry and assigning one of categries (+ rest of attributes) to
> cloned geometry thus one geometry = two cats turn to two geometries =
> single cat for each.
> It makes sense from data preservation point, still it might be
> confusing to see that v.out.ogr can export more features than are
> present in vector dataset (needs a warning here!) and it might totally
> ruin cleaned data as I was using GRASS only to remove duplicate
> features from the data set.
>

BTW, the reverse can also be true: a shapefile with, say, 5 polygons
may end up as a GRASS vector with much more than 5 areas, if the 5
polygons are multipolygons.

But back to the original problem: how about a new option to v.category
to reduce the number of categories for a given object and layer to 1?

Markus M

> Sometimes GRASS vector model is too powerful...
>
> Sorry for noise,
> Maris.
>
> 2011/12/14 Maris Nartiss <maris.gis at gmail.com>:
>> Hello,
>> yes, I used QGIS to verify count of exported features in Shapefile and
>> indeed count matched with one reported by v.out.ogr as "written
>> feature count".
>>
>> And now comes the best - g.copy and v.extract both had NO effect on
>> result -> resulting dataset still was exported with ALL points present
>> before v.clean. I run both ways twice to avoid PEBKAC.
>>
>> And now the worst thing - GRASS 6.4.2 is also affected. I'm opening
>> ticket and blocking release till we will figure out what's exactly
>> wrong. If somebody has an idea, I can send dataset off-list for
>> testing.
>>
>>
>> Maris.
>>
>> 2011/12/14 Hamish <hamish_b at yahoo.com>:
>>> Benjamin wrote:
>>>> Sounds like v.out.ogr includes some
>>>> features in
>>>> the output that are marked "dead" but are still in the
>>>> dataset. Could you check two things, please:
>>> ...
>>>> 2) and make a copy of the cleaned vector points map
>>>> using g.copy vect=, and use v.out.ogr to export
>>>> the copy instead of the cleaned original?
>>>
>>> "v.extract cat=1-99999999" might help too.
>>>
>>>
>>>
>>> Hamish
>>> _______________________________________________
>>> grass-dev mailing list
>>> grass-dev at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/grass-dev
> _______________________________________________
> grass-dev mailing list
> grass-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-dev


More information about the grass-dev mailing list