Page 1 of 1

Batch export to shapefile?

Posted: June 8th, 2015, 12:33 pm
by mwj202
Hi All,

I would like to be able to generate trajectory 'GIS' text files and then export to shapefile without having to do this manually in display > trajectory and then utilities > GIS to shapefile. Is it possible to do this in batch within the GUI?

Thanks for any help!

Matt

Re: Batch export to shapefile?

Posted: June 8th, 2015, 2:12 pm
by glenn.rolph
There is no option to create a shapefile in one step in the GUI. You could create your own tcl script that does this and add it to the GUI or run a batch script like the following to do that same (this batch script creates a CONTROL file, runs the model, creates the postScript file and then creates the shapefile)...

echo 00 00 00 %1 >CONTROL
echo 1 >>CONTROL
echo 40.0 -90.0 10.0 >>CONTROL
echo 48 >>CONTROL
echo 0 >>CONTROL
echo 10000.0 >>CONTROL
echo 1 >>CONTROL
echo ./ >>CONTROL
echo oct1618.BIN >>CONTROL
echo ./ >>CONTROL
echo tdump.%1 >>CONTROL

\hysplit4\exec\hyts_std.exe
\hysplit4\exec\trajplot.exe -itdump.%1 -a5 -oplot%1
\hysplit4\exec\ascii2shp.exe -i trajplot lines <GIS_traj_ps_01.txt
rem \hysplit4\exec\txt2dbf.exe -C7 -C9 -C5 -C9 -d, -d, -d, GIS_traj_ps_01.att trajplot.dbf

Re: Batch export to shapefile?

Posted: June 15th, 2015, 6:04 am
by mwj202
Thanks for your help Glen!!

I just have one question and would appreciate help from anyone who can do so. I am struggling to invoke HYSPLIT in Tclsh85 using the code that Glen provided, pasted below.

Code: Select all

\hysplit4\exec\hyts_std.exe
\hysplit4\exec\trajplot.exe -itdump.%1 -a5 -oplot%1
\hysplit4\exec\ascii2shp.exe -i trajplot lines <GIS_traj_ps_01.txt
rem \hysplit4\exec\txt2dbf.exe -C7 -C9 -C5 -C9 -d, -d, -d, GIS_traj_ps_01.att trajplot.dbf
When running this I get the following error: invalid command name: "hysplit4exechyts_std.exe". I'm pretty sure I need to add a command before (exec or open?) but adding in exec didn't work either (couldn't execute "hysplit4exechyts_std.exe" : no such file or directory). As you can see the backslashes are removed.. not sure if this means anything. I also tried including the full path (C:\hysplit4\exec\hyts_std.exe).

Sorry if there is a really obvious answer but this is the first time I've attempted anything like this :roll:

Best wishes,
Matt

Re: Batch export to shapefile?

Posted: June 15th, 2015, 6:31 am
by glenn.rolph
The back slashes are needed, they are the directory names of where the executable file hyts_std.exe resides.

Re: Batch export to shapefile?

Posted: June 15th, 2015, 8:17 am
by mwj202
Thanks Glenn,

Sorry for the confusion. I included the backslashes in the code but in the error messages that are produced they appear to have been removed. Just wondering - is there a reason that the rem command is included on the 4th line but not on the first 3 lines (pasted again below)?

Code: Select all

\hysplit4\exec\hyts_std.exe
\hysplit4\exec\trajplot.exe -itdump.%1 -a5 -oplot%1
\hysplit4\exec\ascii2shp.exe -i trajplot lines <GIS_traj_ps_01.txt
rem \hysplit4\exec\txt2dbf.exe -C7 -C9 -C5 -C9 -d, -d, -d, GIS_traj_ps_01.att trajplot.dbf
I have also now tried using braces as below:

Code: Select all

exec {C:\hysplit4\exec\hyts_std.exe}
exec {C:\hysplit4\exec\trajplot.exe -itdump.%1 -a5 -oplot%1}
exec {C:\hysplit4\exec\ascii2shp.exe -i trajplot lines <GIS_traj_ps_01.txt}
exec {C:\hysplit4\exec\txt2dbf.exe -C7 -C9 -C5 -C9 -d, -d, -d, GIS_traj_ps_01.att trajplot.dbf}
I get a different error "forrt1: severe (59): list-directed I/O syntax error, unit-5, file Internal-Directed Read" + a table with image, PC, Routine, Line, Source headings - "Unknown" in Routine, Line, Source.

Not sure if this helps but I'm running on Windows.

Best wishes,
Matt