Global Mapper SDK 19 中文开发文档(三)

6.2 详情和声明形式

GM_3DCloseViewWindow

关闭3D视图窗口(如果他处于打开状态)。

GM_Error_t32 __stdcall GM_3DCloseViewWindow
(
    void
);

GM_3DGetCameraPosition

获取当前3D视图中相机的位置。

您可以使用GM_3DPositionCamera函数设置相机的位置。

GM_DLL_EXPORTED GM_Error_t32 __stdcall GM_3DGetCameraPosition
(
    double* aX,         // OUT: X coordinate for camera in current view projection
    double* aY,              // OUT: Y coordinate for camera in current view projection
    float*  aElev,          // OUT: Elevation in meters for camera
    double* aHeading,          // OUT: Heading in degrees from North (0)
    double* aPitch,          // OUT: Pitch in degrees (+ is up, - is down)
    double* aBank                  // OUT: not currently used
);

 GM_3DIsWindowOpen

确定3D视图窗口是否处于打开状态。

BOOL __stdcall GM_3DIsWindowOpen
(
    void
);

GM_3DPositionCamera

设置当前3D视图中相机的位置。

您可以使用GM_3DGetCameraPosition函数获取相机的位置。

GM_DLL_EXPORTED GM_Error_t32 __stdcall GM_3DPositionCamera
(
    double    aX,         // IN: X coordinate for camera in current view projection
    double    aY,         // IN: Y coordinate for camera in current view projection
    float    aElev,        // IN: Elevation in meters for camera
    double    aHeading,    // IN: Heading in degrees from North (0)
    double    aPitch,        // IN: Pitch in degrees (+ is up, - is down)
    double    aBank        // IN: not currently used
);

GM_3DSaveViewToFile

将当前的3D视图保存为图像文件(BMP、JPG或PNG)。如果您将像素宽度或高度参数设置为0,将使用当前3D视图的尺寸。

GM_DLL_EXPORTED GM_Error_t32 __stdcall GM_3DSaveViewToFile
(
    const char* aFilename,  // IN: filename to save to
    GM_RasterExportFormat_t32 aFormat,    // IN: format to use (only BMP, JPG, and PNG supported)
    sint32 aPixWidth,  // IN: pixel width to save (use 0 for current view size)
    sint32 aPixHeight  // IN: pixel height to save (use 0 for current view size)
);

GM_3DSetChangeViewCallback

设置3D视图中按下按钮(包括平移或缩放按钮)时的回调函数,通常会导致在3D窗口中显示一组新的数据。如果您希望使主视图与3D视图保持同步(如Global Mapper应用程序中),请提供此回调函数。如果不提供回调函数,则默认行为是仅更新3D视图中显示的数据,而与其他视图无关。

void __stdcall GM_3DSetChangeViewCallback
(
    GM_3DChangeViewCallbackFunc aCallbackFunc,
    void* aUserData
);

GM_3DSetView

设置当前打开的3D视图窗口中显示的内容。如果需要,将打开3D视图窗口。

GM_Error_t32 __stdcall GM_3DSetView
(
    GM_LayerHandle_t32* aLayerList,     // IN: List of layers to drape on top of terrain or NULL for all
    uint32 aLayerCount,    // IN: Number of layers in list (0 for all)
    GM_DrawFlags_t32 aDrawFlags,     // IN: Flags controlling how the draw is performed
    const GM_Rectangle_t* aWorldBounds,   // IN: World bounds to convert from or NULL for last drawn
    const GM_PixelRect_t* aPixelRect,     // IN: Pixel bounds to convert from or NULL for last drawn 
    uint32 aReserved       // IN: Reserved (set to 0)
);

GM_AddAreaToVectorLayer

将一个区域要素添加到已加载的矢量图层或使用GM_CreateCustomVectorLayer函数创建的自定义矢量图层中。

GM_DLL_EXPORTED GM_Error_t32 GM_AddAreaToVectorLayer
(
    GM_LayerHandle_t32      aLayer,             // IN: Layer to add area to
    const GM_AreaFeature_t* aArea,              // IN: Area feature to add
    GM_AddFeatureFlags_t8   aFlags              // IN: Flags controlling the add
);

GM_AddCustomAreaClass

添加一个新的自定义区域分类。如果此函数成功,新的要素分类代码将在aFeatureCode值中返回。然后,可以将此代码用作区域要素的要素分类。

GM_Error_t32 __stdcall GM_AddCustomAreaClass
(
    const char*             aName,              // IN: Custom type name
    const GM_AreaStyle_t*   aStyle,             // IN: Default draw style for features of this type
    AreaFeatureClass_t16*   aFeatureCode        // OUT: Classification code for new type
);

GM_AddCustomBrushStyle

在绘制区域要素时添加自定义的刷子样式。返回的刷子样式值可以作为GM_AreaStyle_t定义的一部分,用于指定根据提供的图像文件填充区域的图案。如果使用提供的aStyleName已存在自定义刷子样式,则aStyleVal将设置为该样式的枚举值,并返回GM_Error_BrushAlreadyCreated。

GM_DLL_EXPORTED GM_Error_t32 __stdcall GM_AddCustomBrushStyle
(
    const char*             aImageFilename,     // IN: Full path to image filename to use for custom fill pattern
    const char*             aStyleName,         // IN: Text name to use when referring to the fill style
    GM_BrushStyle_t16*      aStyleVal           // OUT: Value of created custom fill style
);

GM_AddCustomDatum

根据提供的GM_DatumInfo_t结构,添加一个新的自定义基准。新基准的基准代码将返回到aDatumCode中。如果已经存在具有相同名称的自定义基准,那么该基准的参数将被更新。

GM_DLL_EXPORTED GM_Error_t32 __stdcall GM_AddCustomDatum
(
    const GM_DatumInfo_t*   aDatumInfo,     // IN: Information about datum transformation to add
    DATUM*                  aDatumCode      // OUT: Datum code assigned to new custom datum
)

示例1:添加自定义的Bursa-Wolfe基准(与Lisboa 1937基准相同)

// Setup the custom datum information
GM_DatumInfo_t theDatumInfo;
::memset( &theDatumInfo, 0, sizeof theDatumInfo );
theDatumInfo.mMethod = GM_Datum_BursaWolfe;
theDatumInfo.mDatumName = "DLx"; 
theDatumInfo.mEllipsoidName = "International 1909 (Hayford/Intl 1924)"; // Name of ellipsoid this datum is based on
theDatumInfo.mDeltaX = -288.88;      
theDatumInfo.mDeltaY = -91.74;       
theDatumInfo.mDeltaZ = 126.24;       
theDatumInfo.mScale = -4.598E-6;     
theDatumInfo.mRotX = -1.6910;       // X rotation in arc seconds      
theDatumInfo.mRotY = 0.41;          // Y rotation in arc seconds
theDatumInfo.mRotZ = -0.211;        // Z rotation in arc seconds

// Add the datum
DATUM theDatumCode = GM_DATUM_UNKNOWN;
GM_Error_t32 theRetCode = GM_AddCustomDatum( &theDatumInfo, &theDatumCode );

GM_AddCustomEllipsoid

根据提供的参数,添加一个新的自定义椭球体。如果成功,您可以在以后调用GM_AddCustomDatum时使用提供的椭球体名称来创建一个新的自定义基准面。

GM_DLL_EXPORTED GM_Error_t32 __stdcall GM_AddCustomEllipsoid
(
    const char*             aEllipsoidName, // IN: Name of ellipsoid
    double                  aSemiMajor,     // IN: Semi-major axis in meters
    double                  aSemiMinor      // IN: Semi-minor axis in meters
)

GM_AddCustomLineClass

添加一个新的自定义线分类。如果此函数成功,新的要素分类代码将返回到aFeatureCode值中。然后可以将此代码用作线要素的要素分类。

GM_Error_t32 __stdcall GM_AddCustomLineClass
(
    const char*             aName,              // IN: Custom type name
    const GM_LineStyle_t*   aStyle,             // IN: Default draw style for features of this type
    LineFeatureClass_t16*   aFeatureCode        // OUT: Classification code for new type
);

GM_AddCustomPointClass 

添加一个新的自定义点分类。如果此函数成功,新的要素分类代码将返回到aFeatureCode值中。然后可以将此代码用作点要素的要素分类。

GM_Error_t32 __stdcall GM_AddCustomPointClass
(
    const char*             aName,              // IN: Custom type name
    const GM_PointStyle_t*  aStyle,             // IN: Default draw style for features of this type
    PointFeatureClass_t16*  aFeatureCode        // OUT: Classification code for new type
);

GM_AddCustomShader

添加一个新的自定义着色器,可以用于高程图层的显示。添加着色器后,您可以使用GM_SetVerticalDisplayOptions函数将其设置为渲染高程图层的活动着色器,或使用GM_SetElevationOverrides函数将其设置为用于渲染特定图层的着色器。

如果已经存在具有指定名称的自定义着色器,那么该着色器将被更新。否则,将创建一个具有指定名称的新自定义着色器。

如果您想创建一个着色地形图层坡度而不是高程值的自定义着色器,请在GM_CustomShader_t结构中提供GM_CustomShader_ShadeSlopes标志。

GM_DLL_EXPORTED GM_Error_t32 __stdcall GM_AddCustomShader
(
    const GM_CustomShader_t*    aShader,    // in: shader to add
    uint32                      aReserved   // reserved, must be 0
);

GM_AddCustomSymbol

添加一个新的自定义符号,可以在绘制点要素时使用(参见GM_SetPointFeatureDrawStyle函数)。

GM_Error_t32 GM_AddCustomSymbol
(
    const char* aSymbolFilename,                // Full path to symbol file (BMP or ICO)
    const char* aSymbolName                     // Text name to use when referring to the symbol
);

GM_AddLidarQueryToQuery

Adds one Lidar query to another.

Caution:This will close any active iterator on the query, resetting the position of the GM_GetNextLidarQueryPoints call.  

GM_DLL_EXPORTED GM_Error_t32 __stdcall GM_AddLidarQueryToQuery
(
    GM_LidarQueryHandle_t   aAddToLidarQuery,   // IN: Lidar query to update
    GM_LidarQueryHandle_t   aAddFromLidarQuery, // IN: Lidar query to add points from
    void*                   aReserved           // IN: Reserved for future use, must be NULL
)

GM_AddLineToVectorLayer

将线要素添加到已加载的矢量图层或使用GM_CreateCustomVectorLayer函数创建的自定义矢量图层中。

GM_DLL_EXPORTED GM_Error_t32 GM_AddLineToVectorLayer
(
    GM_LayerHandle_t32      aLayer,             // IN: Layer to add line to
    const GM_LineFeature_t* aLine,              // IN: Line feature to add
    GM_AddFeatureFlags_t8   aFlags              // IN: Flags controlling the add
);

GM_AddPointToVectorLayer

将点要素添加到已加载的矢量图层或使用GM_CreateCustomVectorLayer函数创建的自定义矢量图层中。

GM_DLL_EXPORTED GM_Error_t32 GM_AddPointToVectorLayer
(
    GM_LayerHandle_t32            aLayer,         // IN: Layer to add point to
    const GM_PointFeature_t*    aPoint,         // IN: Point feature to add
    GM_AddFeatureFlags_t8       aFlags          // IN: Flags controlling the add
);

GM_AddRemovePointToLidarQuery 

Adds or removes a Lidar point feature at the given index from the layer. 

Caution:Note this will close any active iterator on the query, resetting the position of the GM_GetNextLidarQueryPoints call. You can add/remove points from an existing Lidar query created with either the GM_CreateEmptyLidarQuery or GM_CreateLidarQuery functions.  
 

GM_DLL_EXPORTED GM_Error_t32 __stdcall GM_AddRemovePointToLidarQuery
(
    GM_LidarQueryHandle_t   aLidarQuery,        // IN: Lidar query to update
    GM_LayerHandle_t32      aLayer,             // IN: Layer point to add/remove
    uint64                  aPointIndex,        // IN: Index of Lidar point feature to update
    boolean                 aAddPoint           // IN: Add or remove point?
)

GM_AreProjectionsEquivalent

确定两个投影是否表示相同的坐标系统。这个函数足够智能,可以将特定的UTM区域投影视为具有正确参数的基本横轴墨卡托投影的等效投影。

GM_DLL_EXPORTED GM_Error_t32 __stdcall GM_AreProjectionsEquivalent
(
    const GM_Projection_t*  aProj1,     // IN: First projection to check
    const GM_Projection_t*  aProj2,     // IN: Second projection to check
    boolean*                aEquivalent // OUT: Are they the same?
)

GM_CalcAreaElevStats

计算在提供的边界多边形内以提供的间距加载的高程数据的高程统计信息。

GM_DLL_EXPORTED GM_Error_t32 __stdcall GM_CalcAreaElevStats
(
    GM_LayerHandle_t32*         aLayerList,     // IN: List of layers to use or NULL for all
    uint32                      aLayerCount,    // IN: Number of layers in list (0 for all)
    GM_AreaElevStats_t*         aElevStats,     // OUT: Calculated area statistics
    const GM_Point_t*           aAreaPoints,    // IN: List of points in area in global coordinate system
    uint32                      aNumPoints,     // IN: Number of points in aAreaPoints
    double                      aXSpacing,      // IN: Sample spacing in the x direction in global units (use 0.0 to get a good default)
    double                      aYSpacing,      // IN: Sample spacing in the y direction in global units (use 0.0 to get a good default)
    void*                       aReserved       // IN: Reserved for future use, must be NULL
);

GM_CalcBearing

计算两点之间的方位角,以弧度表示。
这些点可以以经纬度值或当前投影中的坐标指定。得到的方位角是地理方位角,其中0表示北,PI / 2表示东,PI表示南,3 * PI / 2表示西。

GM_Error_t32 GM_CalcBearing
(
    double  aFromX,     // IN: start X/longitude coordinate
    double  aFromY,     // IN: start Y/latitude coordinate
    double  aToX,       // IN: stop X/longitude coordinate
    double  aToY,       // IN: stop Y/latitude coordinate
    boolean aLatLon,    // IN: TRUE - coordinates are lat/lon, FALSE - coordinates are in the current projection?
    double* aBearing    // OUT: bearing in radians between the points
);

GM_CalcDistance

计算两点之间的大圆距离(以米为单位)。这些点可以以经纬度值或当前投影中的坐标指定。

GM_Error_t32 GM_CalcDistance
(
    double  aFromX,     // IN: start X/longitude coordinate
    double  aFromY,     // IN: start Y/latitude coordinate
    double  aToX,       // IN: stop X/longitude coordinate
    double  aToY,       // IN: stop Y/latitude coordinate
    boolean aLatLon,    // IN: TRUE - coordinates are lat/lon, FALSE - coordaintes are in the current projection?
    double* aDist       // OUT: distance in meters between the points
);

GM_CalcEnclosedArea

计算一系列点所围成的面积。

aPtList中的坐标是使用aProj定义的投影。如果aProj为NULL,则假设使用由GM_GetProjection返回的当前全局投影。

GM_Error_t32 __stdcall GM_CalcEnclosedArea
(
    const GM_Point_t*       aPtList,    // IN: list of points defining area
    uint32                  aNumPoints, // IN: number of points in list
    const GM_Projection_t*  aProj,      // IN: projection of points in list (use NULL for current projection returned by GM_GetProjection)
    double*                 aArea       // OUT: enclosed area in square meters
);

GM_CalcProjectedLocation

计算从起点沿给定方位投影的新点的位置。输入和输出点可以指定为纬度/经度值或当前投影中的值。

GM_DLL_EXPORTED GM_Error_t32 __stdcall GM_CalcProjectedLocation
(
    double  aFromX,     // IN: start X/longitude coordinate
    double  aFromY,     // IN: start Y/latitude coordinate
    double  aBearing,   // IN: bearing in degrees to project along (0 is north, 90 is east, 180 is south, 270 is west)
    double  aDist,      // IN: distance to project along bearing in meters
    double* aToX,       // OUT: stop X/longitude coordinate
    double* aToY,       // OUT: stop Y/latitude coordinate
    boolean aLatLon     // IN: TRUE - coordinates are lat/lon, FALSE - coordinates are in the current projection
);

GM_CalcScaleRectangle

在给定设备上按给定比例尺大小,计算绘制所需的以全局坐标表示的矩形。

GM_Error_t32 GM_CalcScaleRectangle
(
    const GM_Point_t*       aCenterPoint,   // IN: Center point in global coordinates
    double                  aScale,         // IN: Scale to calculate at (i.e. for 1:24K, pass 24000.0)
    HDC                     aDC,            // IN: Device context that will be drawn to
    sint32                  aPixWidth,      // IN: pixel width
    sint32                  aPixHeight,     // IN: pixel height
    GM_Rectangle_t*         aScaleRect      // OUT: rectangle at given scale
);

GM_CalcViewShed

对加载的高程数据执行视域分析,并根据结果创建一个新的视域图层。在完成后,必须使用GM_CloseLayer关闭aViewShedLayer返回的图层句柄。

GM_Error_t32 GM_CalcViewShed
(
    GM_LayerHandle_t32          aLayer,         // IN: Layer to get elevations from or NULL for topmost layer at each point
    const GM_ViewShedParams_t*  aViewShedParms, // IN: Parameters for creating view shed
    GM_LayerHandle_t32*         aViewShedLayer  // OUT: Created view shed layer
);

GM_CalcVolumeAlongLine

计算沿给定线段的开挖和填充体积,相对于每个顶点的开挖高度。在每个线段的起点和终点高度之间使用插值来确定点之间的高度。

GM_Error_t32 GM_CalcVolumeAlongLine
(
    GM_LayerHandle_t32              aLayer,         // IN: Layer to get elevations from or NULL for topmost layer at each point
    const GM_LineVolumeParams_t*    aVolumeParms,   // IN: Parameters for line volume calculation
    double*                         aCutVolume,     // OUT: Cut volume in cubic meters
    double*                         aFillVolume     // OUT: Fill volume in cubic meters
);

GM_CalcVolumeOfArea

计算给定区域的开挖和填充体积,相对于开挖高度。

GM_Error_t32 GM_CalcVolumeOfArea
(
    GM_LayerHandle_t32              aLayer,         // IN: Layer to get elevations from or NULL for topmost layer at each point
    const GM_AreaVolumeParams_t*    aVolumeParms,   // IN: Parameters for area volume calculation
    double*                         aCutVolume,     // OUT: Cut volume in cubic meters
    double*                         aFillVolume     // OUT: Fill volume in cubic meters
);

GM_CalcWorldRectSize

计算当前投影中矩形的宽度和高度。可以指定矩形,也可以使用最后绘制的矩形。

GM_Error_t32 GM_CalcWorldRectSize
(
    const GM_Rectangle_t*   aWorldBounds,   // IN: World bounds to calc size of or NULL for last drawn
    double*                 aWidthMeters,   // OUT: Width of rectangle in meters
    double*                 aHeightMeters   // OUT: Height of rectangle in meters
);

GM_CloseLayer

GM_CloseLayer函数用于关闭先前打开的图层。

GM_Error_t32 GM_CloseLayer
( 
    GM_LayerHandle_t32  aLayer
);

GM_ClosePackage

关闭先前使用GM_LoadPackage函数打开的包。

GM_Error_t32 GM_ClosePackage
( 
    GM_PackageHandle_t32    aPackage
);

GM_CombineAreas

将给定的区域列表合并为一个或多个新的区域要素,并将新的区域添加到给定的图层中。任何接触或重叠的区域都应该被合并。

GM_Error_t32 __stdcall GM_CombineAreas
(
    const GM_AreaFeature_t**    aAreaList,      // IN: List of areas to combine
    uint32                      aNumAreas,      // IN: Number of areas in aAreaList
    const GM_Projection_t*      aAreaProj,      // IN: Projection system the area coordinates are in (use NULL for current projection)
    GM_LayerHandle_t32          aNewAreaLayer   // IN: Layer to add new combined areas to
)

以下是一个示例,展示了如何将图层中的所有区域合并到一个新图层中:

// Build the list of areas to combine
GM_AreaFeature_t** theAreaList = new GM_AreaFeature_t*[ theLayerInfo->mNumAreas ];
uint32 i;
for ( i = 0; i < theLayerInfo->mNumAreas; i++ )
{
    // Get the area feature
    theAreaList[i] = GM_GetAreaFeature( aLayerHandle, i );
}

// Create a new layer and combine the areas into it
GM_LayerHandle_t32 theNewAreaLayer = GM_CreateCustomVectorLayer( "CombinedAreas", &theLayerInfo->mNativeProj );
theErr = GM_CombineAreas( (const GM_AreaFeature_t**)theAreaList, theLayerInfo->mNumAreas, &theLayerInfo->mNativeProj, theNewAreaLayer );

// Free the area features that we combined
for ( i = 0; i < theLayerInfo->mNumAreas; i++ )
{
    GM_FreeAreaFeature( theAreaList[i] );
}

// Free the area list
delete[] theAreaList;
theAreaList = NULL;

GM_CombineTerrainLayers

使用一些操作(例如加法、减法等),将两个加载的地形图层进行合并,并从合并结果创建一个新的地形图层。当您处理完毕后,必须使用GM_CloseLayer关闭返回的新图层。

GM_DLL_EXPORTED GM_Error_t32 __stdcall GM_CombineTerrainLayers
(
    const GM_GridCombineSetup_t*    aSetup,         // IN: Setup for operation
    GM_LayerHandle_t32*             aCombinedLayer, // OUT: Layer handle for newly created combined layer
    void*                           aReserved       // IN: Reserved for future use, must be NULL
)

GM_ConvertCoordGroundToPixel

GM_ConvertCoordGroundToPixel函数用于在当前投影和像素空间之间进行坐标转换。转换空间可以是上一个绘制的坐标空间,或者调用者可以提供要使用的坐标空间。

GM_Error_t32 GM_ConvertCoordGroundToPixel
( 
    double                  aGroundX,       // IN: X Coord in current projection
    double                  aGroundY,       // IN: Y Coord in current projection
    sint32*                 aPixelX,        // OUT: X Coord in pixel space
    sint32*                 aPixelY,        // OUT: Y Coord in pixel space
    const GM_Rectangle_t*   aWorldBounds,   // IN: World bounds to convert from or NULL for last drawn
    const GM_PixelRect_t*   aPixelRect      // IN: Pixel bounds to convert from or NULL for last drawn 
);

GM_ConvertCoordGroundToPixelWithOrientation

将一个坐标从当前投影转换为像素坐标。转换空间可以是最后绘制的坐标空间,或者调用者可以提供要使用的坐标空间。您还需要提供一个角度来执行转换。

注意:只有在需要以与通过GM_SetOrientation全局设置的方向不同的方向进行坐标转换时,才需要调用此函数。

GM_Error_t32 __stdcall GM_ConvertCoordGroundToPixelWithOrientation
( 
    double                  aGroundX,       // IN: X Coord in current projection
    double                  aGroundY,       // IN: Y Coord in current projection
    sint32*                 aPixelX,        // OUT: X Coord in pixel space
    sint32*                 aPixelY,        // OUT: Y Coord in pixel space
    const GM_Rectangle_t*   aWorldBounds,   // IN: World bounds to convert from or NULL for last drawn
    const GM_PixelRect_t*   aPixelRect,     // IN: Pixel bounds to convert from or NULL for last drawn 
    double                  aOrientation    // IN Orientation of coordinate space to use (0 is north up, 90 is east up, 180 is south up, 270 is west up)
)

GM_ConvertCoordLayerGroundToPixel

将一个坐标在当前投影和图层像素空间之间进行转换。输入图层必须是栅格或网格高程图层(即,像素坐标有意义的图层)。

GM_Error_t32 __stdcall GM_ConvertCoordLayerGroundToPixel
( 
    GM_LayerHandle_t32      aLayer,         // IN: raster layer to do conversion in
    double                  aGroundX,       // IN: X Coord in current projection
    double                  aGroundY,       // IN: Y Coord in current projection
    double*                 aPixelX,        // OUT: X Coord in layer pixel space
    double*                 aPixelY         // OUT: Y Coord in layer pixel space
)

GM_ConvertCoordLayerPixelToGround

在图层像素空间和当前投影之间转换坐标。输入图层必须是栅格或网格高程图层(即,像素坐标有意义的图层)。

GM_Error_t32 __stdcall GM_ConvertCoordLayerPixelToGround
( 
    GM_LayerHandle_t32      aLayer,         // IN: raster layer to do conversion in
    double                  aPixelX,        // IN: X Coord in layer pixel space
    double                  aPixelY,        // IN: Y Coord in layer pixel space
    double*                 aGroundX,       // OUT: X Coord in current projection
    double*                 aGroundY        // OUT: Y Coord in current projection
)

GM_ConvertCoordPixelToGround

GM_ConvertCoordPixelToGround函数将坐标从像素空间转换到当前投影空间。转换空间可以是最近绘制的坐标空间,或者调用者可以提供要工作的坐标空间。

GM_Error_t32 GM_ConvertCoordPixelToGround
( 
    sint32                  aPixelX,        // IN: X Coord in pixel space
    sint32                  aPixelY,        // IN: Y Coord in pixel space
    double*                 aGroundX,       // OUT: X Coord in current projection
    double*                 aGroundY,       // OUT: Y Coord in current projection
    const GM_Rectangle_t*   aWorldBounds,   // IN: World bounds to convert from or NULL for last drawn
    const GM_PixelRect_t*   aPixelRect      // IN: Pixel bounds to convert from or NULL for last drawn 
);

GM_ConvertCoordPixelToGroundWithOrientation

将坐标在像素空间和当前投影空间之间进行转换。转换空间可以是最近绘制的坐标空间,也可以由调用者提供要使用的坐标空间。还需要提供一个方向(旋转角度)来进行转换。

注意:只有在希望以与GM_SetOrientation全局设置不同的方向进行坐标转换时,才需要调用此函数。

GM_Error_t32 __stdcall GM_ConvertCoordPixelToGroundWithOrientation
( 
    sint32                  aPixelX,        // IN: X Coord in pixel space
    sint32                  aPixelY,        // IN: Y Coord in pixel space
    double*                 aGroundX,       // OUT: X Coord in current projection
    double*                 aGroundY,       // OUT: Y Coord in current projection
    const GM_Rectangle_t*   aWorldBounds,   // IN: World bounds to convert from or NULL for last drawn
    const GM_PixelRect_t*   aPixelRect,     // IN: Pixel bounds to convert from or NULL for last drawn 
    double                  aOrientation    // IN Orientation of coordinate space to use (0 is north up, 90 is east up, 180 is south up, 270 is west up)
)

GM_CreateBufferArea

创建一个围绕指定要素的区域缓冲区。参数指定了要创建缓冲区的现有要素(可以是点、线或区域要素),以及要使用的缓冲距离。如果要在区域边界内创建缓冲区,请使用负缓冲距离。

新创建的缓冲区域将被添加到图层<aBufferLayer>中。如果要将它们添加到新的图层,请使用GM_CreateCustomVectorLayer。新的缓冲区域将被添加到<aBufferLayer>的区域列表的末尾,因此您可以在调用之前和之后使用GM_LayerInfo_t结构中的mNumAreas值来确定添加了多少个缓冲区域以及使用了哪些索引。

GM_Error_t32 __stdcall GM_CreateBufferArea
(
    GM_LayerHandle_t32      aFeatureLayer,      // IN: Layer the feature is in
    GM_FeatureClassType_t8  aFeatureClassType,  // IN: Type of feature class (area, point, line)
    uint32                  aFeatureIndex,      // IN: Index of feature in layer
    double                  aBufferDistance,    // IN: Distance in meters of buffer to create (use negative values to create a buffer inside an area feature)
    GM_LayerHandle_t32      aBufferLayer        // IN: Layer to add new buffer area(s) to
);

GM_CreateCustomElevGridLayer (不推荐) 

创建一个新的自定义图层,表示内存中的高程栅格。返回新创建的图层的句柄。当使用完毕后,必须调用GM_CloseLayer函数关闭返回的句柄。如果出现问题,则返回NULL作为图层句柄。

返回的图层句柄可以像其他图层句柄一样使用。这意味着您可以使用该数据进行生成等高线和计算视域等操作。

此函数已过时。应改用GM_CreateCustomElevGridLayerEx函数。

GM_LayerHandle_t32 GM_CreateCustomElevGridLayer
(
    const char*             aDescription,       // IN: Description to use for layer (can be NULL to use default)
    const GM_Projection_t*  aProj,              // IN: Native projection of new layer
    const GM_Point_t*       aTopLeft,           // IN: Ground coordinates of top left sample
    double                  aXSampleSize,       // IN: Size of each grid cell in the x direction
    double                  aYSampleSize,       // IN: Size of each grid cell in the y direction
    sint32                  aNumSamplesX,       // IN: Number of samples in the x direction
    sint32                  aNumSamplesY,       // IN: Number of samples in the y direction
    const void*             aElevGrid,          // IN: Grid of elevation values in row-major order
    GM_GridLayout_t8        aGridLayout,        // IN: Layout of elevation grid
    float                   aNoDataValue        // IN: Value of samples for which the value isn't known (i.e. -9999.9)
);

GM_CreateCustomElevGridLayerEx

创建一个新的自定义图层,代表内存中的高程栅格。返回新创建图层的句柄。当使用完毕后,必须调用GM_CloseLayer函数关闭返回的句柄。如果出现问题,则返回图层句柄的NULL值。

返回的图层句柄可以像其他任何图层句柄一样使用。这意味着您可以使用该数据生成等高线和计算视域等操作。

GM_DLL_EXPORTED GM_LayerHandle_t32 __stdcall GM_CreateCustomElevGridLayerEx
(
    const char*             aDescription,       // IN: Description to use for layer (can be NULL to use default)
    const GM_Projection_t*  aProj,              // IN: Native projection of new layer
    const GM_GridLayout_t*  aGridLayout,        // IN: Grid layer layout and type
    const void*             aElevGrid,          // IN: Grid of elevation values in row-major order
    void*                   aReserved           // IN: Reserved for future use (must be NULL)
)

GM_CreateCustomRasterLayer

创建一个新的自定义图层,代表内存中的栅格数据。返回新创建图层的句柄。当使用完毕后,必须调用GM_CloseLayer函数关闭返回的句柄。如果出现问题,则返回图层句柄的NULL值。

返回的图层句柄可以像其他任何图层句柄一样使用。

GM_LayerHandle_t32 __stdcall GM_CreateCustomRasterLayer
(
    const char*                 aDescription,       // IN: Description to use for layer (can be NULL to use default)
    const GM_Projection_t*      aProj,              // IN: Native projection of new layer
    const GM_RasterLayout_t*    aRasterLayout,      // IN: Raster layer layout
    const void*                 aDataBuf            // IN: Grid of raster data values in row-major order
)

例子:创建一个24位RGB正方形栅格图层
 

// Setup raster layout
const sint32 thePixWidth = 128;
const sint32 thePixHeight = 128;
GM_RasterLayout_t theLayout;
memset( &theLayout, 0, sizeof theLayout );
theLayout.mFlags = GM_RasterLayout_CopyData; // copy data buffer so we can free ours
theLayout.mTopLeft.mX = -90.0;   // place it in the US somewhere
theLayout.mTopLeft.mY = 35.0;
theLayout.mXPixelSize = 1.0 / 3600.0;   // one arc second in size
theLayout.mYPixelSize = 1.0 / 3600.0;   // one arc second in size
theLayout.mPixelWidth = thePixWidth;
theLayout.mPixelHeight = thePixHeight;
theLayout.mNumBands = 3;
theLayout.mBitsPerBand = 8;

// Setup projection as lat/lon
GM_Projection_t theGeoProj;
memset( &theGeoProj, 0, sizeof theGeoProj );
theGeoProj.mProjSys = GM_PRJ_GEO;
theGeoProj.mDatum = GM_DATUM_WGS_84;
theGeoProj.mUnit = GM_PRJ_UNIT_ARC_DEGREES;

// Allocate color buffer
uint8* theColorBuf = (uint8*)malloc( ( theLayout.mPixelWidth * theLayout.mPixelHeight * theLayout.mNumBands * theLayout.mBitsPerBand + 7 ) / 8 );
if ( NULL == theColorBuf )
{
    // Out of memory
    return;
}

// Fill in the color buffer. We'll just generate some basic colors
uint8* theCurColorPos = theColorBuf;
for ( sint32 i = 0; i < theLayout.mPixelHeight; i++ )
{
    for ( sint32 j = 0; j < theLayout.mPixelWidth; j++ )
    {
        *theCurColorPos++ = i % 256; // set red
        *theCurColorPos++ = ( i + j ) % 256; // set green
        *theCurColorPos++ = j % 256; // set blue
    }
}

// Create custom raster layer
GM_LayerHandle_t32 theRasterLayer = GM_CreateCustomRasterLayer
    (
    "My Custom Raster Layer", &theGeoProj, &theLayout, theColorBuf
    );

// Free the color buffer
free( theColorBuf );

GM_CreateCustomVectorLayer

创建一个用于添加矢量要素的新自定义图层。返回新创建图层的句柄。在使用完毕后,必须调用GM_CloseLayer关闭返回的句柄。如果出现问题,图层句柄将返回NULL。创建图层后,使用GM_AddAreaToVectorLayer、GM_AddLineToVectorLayer和GM_AddPointToVectorLayer函数向图层添加要素。

GM_DLL_EXPORTED GM_LayerHandle_t32 GM_CreateCustomVectorLayer
(
    const char*             aDescription,       // IN: Description to use for layer (can be NULL to use default)
    const GM_Projection_t*  aProj               // IN: Native projection of new layer
);

GM_CreateEmptyLidarQuery

创建一个空的Lidar查询结果,您可以将单个Lidar点添加到其中,也可以添加整个查询,然后对其执行操作,如遍历点、修改点等。您可以使用GM_AddRemovePointToLidarQuery或GM_AddLidarQueryToQuery来添加/删除查询中的点。在完成查询后,必须调用GM_FreeLidarQuery来释放查询使用的内存。

GM_DLL_EXPORTED GM_Error_t32 __stdcall GM_CreateEmptyLidarQuery
(
    GM_LidarQueryHandle_t*          aLidarQuery // OUT: Created Lidar query to be used in future calls
)

GM_CreateLidarQuery 

Creates a Lidar query result that you can then perform operations on, like iterating through the points, modifying the points, etc. You must call GM_FreeLidarQuery to free the memory used by the query once done with it. 

GM_DLL_EXPORTED GM_Error_t32 __stdcall GM_CreateLidarQuery
(
    GM_LayerHandle_t32*             aLayerList,         // IN: List of layers to search or NULL for all vector layers
    uint32                          aLayerCount,        // IN: Number of layers in list (0 for all)
    const GM_Rectangle_t*           aWorldBounds,       // IN: World bounds for search space or NULL for all points in Lidar layers
    const GM_LidarQueryFilter_t*    aFilter,            // IN: Optional filter to apply to query (NULL if no extra filter)
    GM_LidarQueryHandle_t*          aLidarQuery,        // OUT: Created Lidar query to be used in future calls
    uint64*                         aQueryPoints        // OUT: Number of points matching query
)

GM_CreateS63UserPermitFile 

Creates a S-63 user permit file for use by clients to request encrypted S-63 chart files from data providers for loading with Global Mapper or your Global Mapper SDK-based application. 

GM_DLL_EXPORTED GM_Error_t32 __stdcall GM_CreateS63UserPermitFile
(
    const char* aFilename   // IN: Name of user permit file to create
);

GM_CreateVectorLayerFromFindResults

从查询调用返回的矢量要素列表中创建一个新的自定义图层。返回新创建的图层的句柄。在使用完毕后,必须调用GM_CloseLayer函数关闭返回的句柄。如果发生问题,图层句柄将返回NULL。

GM_DLL_EXPORTED GM_LayerHandle_t32 __stdcall GM_CreateVectorLayerFromFindResults
(
    const char*                     aDescription,   // IN: Description to use for layer (can be NULL to use default)
    const GM_Projection_t*          aProj,          // IN: Native projection of new layer
    const GM_FoundFeatureResults_t* aResultList     // OUT: Results of find operation (use GM_FreeFeatureResultList to free when done)
)

GM_CropLayerCollar (不推荐) 

GM_CropLayerCollar函数允许用户启用和禁用对先前加载的USGS DRG和DOQQ四方图中图廓的自动裁剪。

此函数已被弃用。您应该使用GM_GetRasterDisplayOptions和GM_SetRasterDisplayOptions函数,因为它们提供了图廓裁剪选项以及其他几个显示选项。

  • 24
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
Global Mapper是一款强大的地理信息系统(GIS)软件,它能够处理和分析各种地理数据。该软件提供了许多功能,包括数据导入和导出、地图绘制、空间分析、地形建模、路径规划等。 首先,Global Mapper可以导入几乎所有常见的地理数据格式,如ESRI Shapefile、KML、GeoTIFF、CAD等。用户可以轻松将这些数据导入到软件中进行处理和分析。 其次,Global Mapper拥有丰富而直观的地图绘制工具。用户可以使用不同的符号和标签来绘制点、线、面等地理要素,并可以根据需要调整其样式和属性。此外,软件还支持创建高质量的2D和3D地图,使用户可以更清晰地展示地理数据。 另外,Global Mapper还具有强大的空间分析功能。用户可以使用各种工具和算法来进行空间查询、图形叠加、坡度分析、视域分析等操作,以便更好地理解和利用地理空间数据。 此外,软件还支持地形建模,可以通过插值算法生成DEM(数字高程模型)和DSM(数字地表模型),并进行地形分析。 最后,Global Mapper还提供了路径规划功能,可以帮助用户找到最佳路径,比如飞行路径规划、车辆导航等。 总之,Global Mapper是一款功能强大且易于使用的GIS软件,它为用户提供了丰富的地理数据处理和分析工具,能够满足各种地理信息应用的需求。无论是专业GIS人员、地理研究者还是普通用户,都可以借助Global Mapper轻松处理和分析地理数据,并生成高质量的地图和分析结果。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

八两

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值