Custom Grid creation/export
Hi once again, Mike
I want now to create a grid of custome (Int16) values. I use the following functions (incomplete code):
I use Dutch projection system (in meters) and I want a 10mx10m cells. The total grid will be 1kmx1km so 100x100 samples.
My imput data is a sample 1,2,3,4, ... The problem is that when I export to XYZ. The result looks like this:
Every grid cell represent a classification, so it cannot be rounded or modified. Does it has to do with the extent of the export? How can I have more control over my data?
Thanks in advanced
Oscar
I want now to create a grid of custome (Int16) values. I use the following functions (incomplete code):
GM_Point_t aPoint = new GM_Point_t(); aPoint.mX = 84005; aPoint.mY = 447995; gridHandler = GlobalMapperDLL.GM_CreateCustomElevGridLayer("sampleGrid", ref aProj, ref aPoint, 10, 10, 100, 100, ptr, GlobalMapperDLL.GM_GridLayout_t8.GM_GridLayout_SInt16, 0); GlobalMapperDLLWrapper.GM_Rectangle_t CurrentViewRect = new GlobalMapperDLLWrapper.GM_Rectangle_t(); CurrentViewRect.mMaxX = 85000; CurrentViewRect.mMinX = 84000; CurrentViewRect.mMaxY = 448000; CurrentViewRect.mMinY = 447000; LastGMError = GlobalMapperDLL.GM_ExportElevation(outputPath + "sampleGrid.xyz", GlobalMapperDLL.GM_ElevationExportFormat_t32.GM_Export_XYZ_ASCII_Grid, gridHandler, ref CurrentViewRect, (int)100, (int)100, 0, GlobalMapperDLL.GM_ElevUnits_t8.GM_ElevUnit_Meters);
I use Dutch projection system (in meters) and I want a 10mx10m cells. The total grid will be 1kmx1km so 100x100 samples.
My imput data is a sample 1,2,3,4, ... The problem is that when I export to XYZ. The result looks like this:
84000.000,447989.899,1.000 84000.000,447979.798,1.520 84000.000,447969.697,2.530 84000.000,447959.596,3.540 84000.000,447949.495,4.551 84000.000,447939.394,5.561 84000.000,447929.293,6.571 84000.000,447919.192,7.581 84000.000,447909.091,8.591 84000.000,447898.990,9.601 ...[second grid line] 84010.101,448000.000,1.000 84010.101,447989.899,1.260 84010.101,447979.798,2.030 84010.101,447969.697,3.040 84010.101,447959.596,4.051 84010.101,447949.495,5.061 84010.101,447939.394,6.071 84010.101,447929.293,7.081 84010.101,447919.192,8.091 84010.101,447909.091,9.101 84010.101,447898.990,10.111
Every grid cell represent a classification, so it cannot be rounded or modified. Does it has to do with the extent of the export? How can I have more control over my data?
Thanks in advanced
Oscar
Comments
-
Oscar,
I think the problem is that your "elevation" data is being inteporlated when an export sample location is not at a grid cell center. Interpolation is enabled by default for elevation layers, but you can disable it by calling the GM_SetRasterDisplayOptions function for a layer and turning off the mInterpolatePixels member of the GM_RasterDisplayOptions_t structure. I would suggest calling GM_GetRasterDisplayOptions for the layer first to initialize the structure, then turn off interpolation and call GM_SetRasterDisplayOptions.
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com
Categories
- 12.7K All Categories
- 5.6K Features Discussion
- 342 Downloading Imagery
- 1.3K Elevation Data
- 380 Georeferencing Imagery Discussion
- 628 GM Script Language
- 53 User Scripts
- 113 GPS Features
- 414 Projection Questions
- 819 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 177 Announcement and News
- 908 Bug Report
- 558 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 562 Other Discussion
- 129 GIS Data Sources
- 27 Global Mapper Showcase
- 233 How I use Global Mapper
- 107 Global Mapper Forum Website