don't know if can help but v.to.db give you coordinates of starting and ending points of vector lines
to connect them I use v.edit
this is my pythin code
startc=grass.read_command("v.to.db", flags="p", map="myline",
type="line", option="start", units="meters" , quiet=True)
startx=float(startc.split("|")[1])
starty=float(startc.split("|")[2])
startz=float(startc.split("|")[3])
endc=grass.read_command("v.to.db", flags="p", map="myline",
type="line", option="end", units="meters")
endx=float(endc.split("|")[1])
endy=float(endc.split("|")[2])
endz=float(endc.split("|")[3])
tmpfile = grass.tempfile()
pfile = open(tmpfile, 'w')
print>> pfile, "L", "2", "1"
print>> pfile, startx, starty, startz
print>> pfile, endx, endy, endz
print>> pfile, "1", i
pfile.close()
grass.run_command("v.edit", input=tmpfile, flags="n", tool="add",
map="mynewline", snap="node", thresh="1")
hope this help
Ivan
Il giorno sab, 03/03/2012 alle 11.24 +0530, SWAPAN GHOSH ha scritto:
> Hello,
>
> Any one can solve me the problem like-" How one can find the starting
> and end point of a line in a vector file or how one can connect two
> line end to end using C code". If there is any change needed in code
> like C or Python Script please suggest me. How I can do it.
>
> Regards,
>
> Swapan
> _______________________________________________
> grass-user mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/grass-user
--
Ti prego di cercare di non inviarmi files .dwg, .doc, .xls, .ppt.
Preferisco formati liberi.
Please try to avoid to send me .dwg, .doc, .xls, .ppt files.
I prefer free formats.
http://it.wikipedia.org/wiki/Formato_aperto
http://en.wikipedia.org/wiki/Open_format
Ivan Marchesini
Perugia (Italy)
Socio fondatore GFOSS "Geospatial Free and Open Source Software"
http://www.gfoss.it
e-mail: [email protected]
[email protected]
fax (mailfax): +39 1782092534
jabber: [email protected]
skype: geoivan73
signature.asc
Description: This is a digitally signed message part
_______________________________________________ grass-user mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-user
