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

Huidae Cho grass4u at gmail.com
Mon Jul 3 06:27:00 EDT 2006


Is there any way to know from the library if a map has not been completely
imported?  IMHO, incomplete import is different from corrupted files (well
sometimes it could mean broken vectors), so only modules importing files can
determine to remove incomplete vectors.

Huidae Cho


On Mon, Jul 03, 2006 at 08:46:22AM +0200, Markus Neteler wrote:
> 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);
> >  	}
> 
> _______________________________________________
> grass-dev mailing list
> grass-dev at grass.itc.it
> http://grass.itc.it/mailman/listinfo/grass-dev




More information about the grass-dev mailing list