Advertisement

gdal--vector intersection

阅读量:

前言

最近为同学编写了几个小型程序,并涉及矢量数据的相交运算(Intersection)。由于网上相关信息较为稀缺,在此我借鉴GDAL官网编写了一个较为完整的程序(其中关键的部分在于修改代码中的相交运算函数)。下面会有详细说明


代码

复制代码
    #include "gdal_priv.h"  
    #include "ogrsf_frmts.h" //for ogr 
    
    bool VectorIntersection(const char *pszSrcShp, const char *pszMethodShp, const char *pszDstShp, const char* pszFormat);
    
    int main()
    {
    const char *pszSrcFile = "C:\ Users\ liuwei\ Desktop\ CreateIm\ shpManage\ SrcLayer.shp";//原始文件
    const char *pszMethodFile = "C:\ Users\ liuwei\ Desktop\ CreateIm\ shpManage\ MethodLayer.shp";//用来求交的文件
    const char *pszOutFile =

全部评论 (0)

还没有任何评论哟~