[GRASS-user] exporting areas to shapefiles without filling holes

Hamish hamish_b at yahoo.com
Fri Apr 10 07:44:00 EDT 2009


Markus wrote:
> So.... please consider following patch:
> 
> 
> svn diff vector/v.out.ogr
> Index: vector/v.out.ogr/main.c
> ===================================================================
> --- vector/v.out.ogr/main.c 
>    (revision 36267)
> +++ vector/v.out.ogr/main.c 
>    (working copy)
> @@ -214,6 +214,9 @@
>      Vect_set_open_level(2);
>      Vect_open_old(&In,
> in_opt->answer, mapset);
> 
> +    if (Vect_get_num_islands(&In) > 0
> && !cat_flag->answer)
> +       G_warning(_("The map
> contains islands. To preserve them in the
> output map, use the -c flag"));
> +
>      /* fetch PROJ info */
>  
>    G_get_default_window(&cellhd);
>      if (cellhd.proj == PROJECTION_XY)
> 
> 
> v.out.ogr italy_country dsn=italy.shp type=area
> WARNING: The map contains islands. To preserve them, use
> the -c flag
> Exporting 26 areas (may take some time)...
>  100%
> 31 features written
> WARNING: 5 features without category were written
> 
> Makes sense?

perhaps use G_message() so that the user can turn if off if
the message is annoying in a loop? the default does the
unexpected, so some form of message is useful there.

and I support to reverse the flag in grass7 (and no message)
iff this doesn't have side effects for other OGR formats that
we haven't considered while only thinking about shapefiles.


Hamish



      



More information about the grass-user mailing list