Multi-Threading and Cropping

OseiOsei Global Mapper UserPosts: 119Trusted User
edited November 2008 in SDK
I would like to Crop layers in Global Mapper. Since GM does not Crop but supports Exporting a region of the map, I used this approach. The problem is if there is a large DEM (1201 by 1201 points) it takes so much RAM and gets stuck at the beginning of the export. After 40-50 minutes, it starts exporting. Most people wait for not more than 8 minutes and just assume reach for Ctrl+Alt+Delete (yes, I have the patience of 5 people). Very amazing since exporting the whole DEM is a flash, but exporting a small portion takes more time.

So came in approach 2, create a new point layer. And within the Cropping rectangle, take elevation at various points and later generate a grid out of those points. Problem is, operation can take a long time so I decided to put whole Point Elevation sampling and adding to custom point layer operation in a background thread. And for a long time, it ran perfectly until recently I started getting wierd Errors and crashes. Most times, it will crash when I am sampling and trying to add the points to the custom point layer. Error is normally, GM_Error_InvalidLayer. Strange, it adds about 1100 points and then starts this error. (Could those points make a layer invalid?)

I have tried every trick in the book and a few of my own but to no avail. Since the error occurs once in a blue moon (that erratic), I said most likely multi-threading.

So I am thinking does Global Mapper support multi-threading and what must the son of man do to make it work? Would be extremely relieved if you could help me there.

Thanks in advance.

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited November 2008
    First of all, which operation exactly are you trying that is taking 40-50 minutes to start exporting?

    Regarding multi-threading, the SDK is certainly not safe for multiple threads to be in it at once for many operations, so you would need to prevent multiple threads from being in the SDK at once for some operations at least. If you can let me know exactly what you are calling in the different threads I may be able to determine the issue and let you work around it.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
Sign In or Register to comment.