[GRASS-dev] Vectlib: delete broken vectors upon creation failure?

Markus Neteler neteler at itc.it
Mon Jul 3 02:46:22 EDT 2006


Hi,

Huidae had added the nice feature in v.in.dxf (now functional, I guess)
that a broken vector map is immediately removed when import wasn't
successful and is not left behind.

This is an issue which affects various modules. I think we should
add this somehow to the vector library since broken vector maps
aren't really useful. The tmp file approach of raster maps is
more failsafe here. Since tmp doesn't exist for vector maps,
any ideas how to implement that?
At least v.in.ascii needs it, maybe also v.in.ogr.

Markus


On Mon, Jul 03, 2006 at 02:35:32AM +0200, grass at intevation.de wrote:
> Index: main.c
> ===================================================================
> RCS file: /grassrepository/grass6/vector/v.in.dxf/main.c,v
> retrieving revision 1.35
> retrieving revision 1.36
> diff -u -d -r1.35 -r1.36
> --- main.c	12 Jun 2006 05:42:40 -0000	1.35
> +++ main.c	3 Jul 2006 00:35:30 -0000	1.36
> @@ -179,6 +179,8 @@
>  	    }
>  	}
>  	else {
> +	    G_warning(_
> +		      ("Failed to import DXF file! The created vector file will be deleted."));
>  	    fprintf(stderr, "REMOVE [%s]\n", output);
>  	    Vect_delete(output);
>  	}




More information about the grass-dev mailing list