Global Mapper Pro Coming Soon

Using GM SDK for server side reprojection in web app

soulsolutionssoulsolutions Global Mapper UserPosts: 5
edited October 2009 in SDK
Just wanted to run this idea past you guys before I commit too much time in case it isn't possible / issues.

I have a ASP.NET (c#) handler that is caching WMS requests and serving tiles for a Silverlight Map control (same format as Bing/Google/Yahoo maps). It requests a larger 1024x1024px image and cuts it up also.

We have hit the common issue of none of the WMS servers supporting EPSG:900913 rather they all do EPSG:4326. We're looking at how to reproject the images before we cut up the tiles.

I'm using the C# wrappers for GM.

1) Looking through the documentation it looks like we can only load a layer from disk, ie parameter is filename? No way to supply bytes[]?

2) Can we set the projection / datum / bounds information after we load the image? Or do we need to save this with the image, eg GeoTiff?

3) Hopefully the easy part, We can reproject by using the "GM_SetProjection" method?

4) Happy with the "GM_DrawLayer", I can then do what I want with the Image.

5) Deployment, I see I need to distribute a bunch of dll from both the SDK and Microsoft, guessing I need Full Trust which is fine.

Any answers / tip etc much apprehicated, happy to share code/solution back.
John.

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited October 2009
    John,

    First of all, I would look at the C headers for the SDK, primarily GlobalMapperInterface.h and the SDK function reference, as the sample C# application with some wrappers if far from complete, it just has some sample function declarations to show how to call the SDK from C#. There are many functions without a C# wrapper in the sample.

    You can load directly from an in-memory byte buffer by using the GM_CreateCustomRasterLayer function. You specify the native projection and coordinates for the layer when you create it.

    You can use GM_SetProjection to set the view/export projection, thus allowing easy reprojection. Then when you export to a new file using something like GM_ExportRaster the export will use that set projection and reproject any loaded data to that projection.

    For distribution see the 'what_to_distribute.txt' file in the 'doc' folder of the SDK. There are quite a few DLLs and several Microsoft system libraries to deploy.

    Let me know if I can be of further assistance.

    Thanks,

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