[译]Mapinfo选项卡到ESRI Shapefile转换器
By robot-v1.0
本文链接 https://www.kyfws.com/applications/mapinfo-tab-to-esri-shapefile-converter-zh/
版权声明 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
- 2 分钟阅读 - 728 个词 阅读量 0[译]Mapinfo选项卡到ESRI Shapefile转换器
原文地址:https://www.codeproject.com/Articles/14494/Mapinfo-Tab-to-ESRI-Shapefile-Converter
原文作者:sun_xf
译文由本站 robot-v1.0 翻译
前言
A batch converting tool that can convert GIS data from “mapinfo tab” to “ESRI shapefile”.
批处理转换工具,可以将GIS数据从" mapinfo选项卡"转换为" ESRI shapefile".
介绍(Introduction)
ESRI shapefile转换器的Mapinfo选项卡可以将MapInfo矢量表转换为ESRI形状格式.它被实现为一个命令行界面(Mapinfo tab to ESRI shapefile converter can convert MapInfo vector tables to the ESRI shape format. It is implemented as a command line interface to)可执行文件(IMUT.exe).(.)
使用代码(Using the Code)
这是一个代码示例,仅适用于Universal Translator Imut文件.(This is a code sample, and will only work with Universal Translator Imut files.)
char szExeFile[1024];
sprintf(szExeFile, "\"%s\\imut.exe\" CFGenerate "
"MAPINFO SHAPE \"%s/\" hggtemp1.dat LOG_STANDARDOUT YES",
(LPCTSTR)m_strImut,(LPCTSTR)strFilePath);
STARTUPINFO si;
GetStartupInfo( &si );
PROCESS_INFORMATION pi;
si.dwFlags = STARTF_FORCEONFEEDBACK;
si.wShowWindow = SW_HIDE;
if(CreateProcess(NULL,
szExeFile,
NULL,
NULL,
FALSE,
CREATE_DEFAULT_ERROR_MODE,
NULL,
(LPCTSTR)m_strImut,
&si,
&pi))
{
CloseHandle(pi.hThread);
WaitForSingleObject(pi.hProcess, INFINITE);
//GetExitCodeProcess(pi.hProcess, &dwExitCode);
CloseHandle(pi.hProcess);
FILE *fp;
sprintf(szExeFile, "%s\\hggtemp2.dat",(LPCTSTR)m_strImut);
if((fp = fopen(szExeFile, "wt")) != NULL)
{
fprintf( fp, "MACRO _EXTENSION TAB\n");
fprintf( fp, "MACRO SourceDataset %s\n", (LPCTSTR)strFilePath);
fprintf( fp, "MACRO DestDataset %s\n", strDstPath);
fprintf( fp, "INCLUDE hggtemp1.dat\n");
fclose(fp);
sprintf(szExeFile, "\"%s\\imut.exe\" hggtemp2.dat", (LPCTSTR)m_strImut);
if(CreateProcess(NULL,
szExeFile,
NULL,
NULL,
FALSE,
CREATE_DEFAULT_ERROR_MODE,
NULL,
(LPCTSTR)m_strImut,
&si,
&pi))
{
CloseHandle(pi.hThread);
WaitForSingleObject(pi.hProcess, INFINITE);
//GetExitCodeProcess(pi.hProcess, &dwExitCode);
CloseHandle(pi.hProcess);
}
}
}
兴趣点(Points of Interest)
该工具可以将许多选项卡文件(位于其他目录中)转换为shapefile格式.手动操作是一件累人的事.可能会导致错误.(The tool can convert a lot of tab files (located in a different directory) to shapefile format. Manual operation is a tiring, trouble thing; it may cause an error.)
历史(History)
- 18(18)日(th)2006年6月:首次发布.(June, 2006: First release.)
- 2(2)nd(nd)2010年12月:更新了源代码.(December, 2010: Updated source code.)
许可
本文以及所有相关的源代码和文件均已获得The Code Project Open License (CPOL)的许可。
C++ VC6 WinXP Windows Win2K MFC Dev 新闻 翻译