Welcome to our new forum platform. We realize there is still some work to do and we appreciate your patience. Please let us know if you have any ideas or suggestions: email@example.com
VPF - Script Convert DNCs to Shapefiles
I am looking to get some help on how to batch / script convert any edition of DNC data to Shapefiles.
What I would like to do is open the DNC folder (at c:\Data\DNCs\DNCxx\), and recurse through all of the subfolders (the approach, coastal, general, and harbour folders), open the LHT associated with each, the export those as shaperfiles to the following location (c:\Data\SHPs\DNCxx\) and then the appropriate subfolder name from which the data came from.
In the end I would like to have a mirror of the DNC folder structure with Shapefiles.
Also, when doing this manually, I split the shapefiles by type and would like to continue doing that. For each vector type, I would like to use the prefixes: A, L & P for areas, lines and points.
This is not functional yet... but this is what I have so far:
DIR_LOOP_START DIRECTORY="C:\DATA\DNCs\DNC17" FILENAME_MASKS="LHT" RECURSE_DIR=YES
IMPORT FILENAME="%FNAME_W_DIR%" TYPE="VPF"
EXPORT_VECTOR FILENAME="%FNAME_W_DIR%\A" TYPE=SHAPEFILE SHAPE_TYPE=AREAS SPLIT_BY_LAYER
EXPORT_VECTOR FILENAME="%FNAME_W_DIR%\L" TYPE=SHAPEFILE SHAPE_TYPE=LINES SPLIT_BY_LAYER
EXPORT_VECTOR FILENAME="%FNAME_W_DIR%\P" TYPE=SHAPEFILE SHAPE_TYPE=POINTS SPLIT_BY_LAYER
I am using GM v13.1.
Thanks for any help.