I want to write a module to automatically do a large number of
"import/process/export" tasks , but I cannot figure out how to run
"v.in.ogr" from C program (I do not understand how to process and
export, but maybe I can understand it after getting import).
I've this functionality working on a "Python script", but I hope to
get better performance writing this application in C language (source
is very large).
I've read the documentation and I've inspected the examples
(v.example) without success.
I'm learning to program in C, so it is difficult to me. Please, I need
some guidance or suggestions. Maybe someone can point me to the best
example of that case.
Thank in advance!
José María Michia
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 22/02/13 14:40, Jos← Mar■a Michia Roberts wrote:
I want to write a module to automatically do a large number of "import/process/export" tasks ,
but I cannot figure out how to run "v.in.ogr" from C program (I do not understand how to
process and export, but maybe I can understand it after getting import).
I've this functionality working on a "Python script", but I hope to get better performance
writing this application in C language (source is very large).
I've read the documentation and I've inspected the examples (v.example) without success.
Please check out the thread "Call Grass modules from C++ code"
(http://article.gmane.org/gmane.comp.gis.grass.user/46272)
I assume it is the same for C
Cheers,
Rainer
I'm learning to program in C, so it is difficult to me. Please, I need some guidance or
suggestions. Maybe someone can point me to the best example of that case.
Thank in advance! Jos← Mar■a Michia _______________________________________________ grass-user
mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQEcBAEBAgAGBQJRJ30BAAoJENvXNx4PUvmCwUcH/ifVNS8Tfy9SGZ94gt2s9llg
jllvt4P3Gc+f9CRTq4VImTcKFXGXj9ao4YAJIyVAGeybVMk8byJgPnh6QNAwfGbC
cBk/0Uwof+FOM4P2B4Vp+HAW7Kbbo6PtMIB5J8gbDMp2O3n1Q3ubymOvnJWvf2hV
8L4vKRbSJyL0LVO4W91owAywkt3rpKK02T+rcoD3ZCywa9CFsrcT41lmZOWnhrFp
PZjB0JKlXtoaEplNuHZQVLvxpjp3RaKV3coesKtJ7mKO+WS/LIngZN8KCjjGCo+t
1nKtdCGLfZ4UNY3vi11nINSsSnJdYGiz38MC4ayXM6RwZoQrtDtQQc3/2DnWAr8=
=13vo
-----END PGP SIGNATURE-----
On 22 February 2013 14:40, José María Michia Roberts
<jose.maria.michia@gmail.com> wrote:
I want to write a module to automatically do a large number of
"import/process/export" tasks , but I cannot figure out how to run
"v.in.ogr" from C program (I do not understand how to process and
export, but maybe I can understand it after getting import).
I've this functionality working on a "Python script", but I hope to
get better performance writing this application in C language (source
is very large).
Hi, maybe you already did, but note that you can profile you Python
script to find the time consuming places (before rewriting all in C).
How to use Python profiler for GRASS Python script and visualize the
result is described here:
http://grasswiki.osgeo.org/wiki/Tools_for_Python_programming#cProfile
Feel free to edit or ask if the page is not complete.
Vaclav
2013/2/22 Rainer M Krug <r.m.krug@gmail.com>:
Please check out the thread "Call Grass modules from C++ code"
(http://article.gmane.org/gmane.comp.gis.grass.user/46272)
I assume it is the same for C
Thanks Rainer. My apologies for re-post this question. I worked hard
looking for a solution, to avoid writing to the list, yet I missed
that thread. Your response was very helpful in guiding my quest! I
learned about the functions "system, fork, exec and popen" among other
things.
2013/2/25 Vaclav Petras <wenzeslaus@gmail.com>:
Hi, maybe you already did, [...]
I'm still learning! I have found that a simple call to function
"system()" is enough. But I was curious to learn how to use "fork /
exec", and was a bit difficult for me.
[...] but note that you can profile you Python
script to find the time consuming places (before rewriting all in C).
How to use Python profiler for GRASS Python script and visualize the
result is described here:
http://grasswiki.osgeo.org/wiki/Tools_for_Python_programming#cProfile
Feel free to edit or ask if the page is not complete.
Very interesting, I'll try.
Anyway, I'm very excited to learn C, so I'll probably solve the
problem using both languages.
Thank you all!
Salud!
José María
José María Michia Roberts wrote:
I'm still learning! I have found that a simple call to function
"system()" is enough. But I was curious to learn how to use "fork /
exec", and was a bit difficult for me.
Note that system() is rather error-prone if you need to be able to
pass variable parameters to the command, as you need to quote or
escape characters which are significant to the shell (of which there
are many).
--
Glynn Clements <glynn@gclements.plus.com>