From: Geoff M. <ub...@ge...> - 2011-04-26 18:46:32
|
Hi Gijs, Ok, got my shopping done quickly, so could get back to computer games quickly ;=)) Thanks for a prompt response. Have updated the source, and for sure now see you 'protect' against a 'blank' Line Width, and use "10", if no other user input... Also note you now protect against 'spaces' in paths, file names by encasing each/all in double quotes ;=)) this seems good... AND I discovered why no 'ogr_decode' output! I had skipped building ogr_decode due to its dependence on GDAL libraries! But have recently managed to build a massive static libgdal.lib, but still doing some more testing on it before returning to the TG suite, and adding ogr_decode, and one other, poly2ogr... I do not know if ogr_decode is better, worse or the same as shape_decode, but as indicated shape_decode has no dependence on a 3rd party library like GDAL, which indeed, as I have recently discovered, does lots of 'research' based on the file content to establish type, and thus attempts to apply the correct 'dataset', not based solely on file extensions... As Ralf Gerlich 2007 source comments state, it is "loosely based on shape-decode.cxx by Curtis L. Olsen", but on reviewing the code a little more, it, like shape_decode, uses external to it tg::makePolygon(...), and tgChopNormalPolygon(...), etc to generate output, so to that extent would have to be the same... But that means there is no error check proc.start(args,...) after it has run... You could also check for the existence of the EXE... There is no doubt should be some message, somewhere that makes it clear _NOTHING_ was run ;=() And in looking through some Qt posts saw where one person had added the code switch :- #ifdef Q_OS_WIN command += ".exe"; #endif which would make it easy to also check for 'existence', and allow a critical message to be displayed, like - QMessageBox::critical(this, tr("NO EXE FILE"),... There is an alternative start(QString & program, QStringList & arguments, OpenMode mode = ReadWrite); but while it seems both forms have no 'return' - void - you can check on how it ended, like say proc->atEnd(), to also help output a messages about what happened... So messing with these ideas, produced the attached patch, to check if the EXE exists... it works for me ;=)) Will be a few days before I can complete the TGSuite with my new GDAL library... and continue this exploration... HTH, Regards, Geoff. attached: diff-01.txt |