Getting Vector Features in Layer Coordinates

dcoggindcoggin Global Mapper UserPosts: 259Trusted User
edited March 2010 in SDK
Mike,

I don't believe there's a way to get vector features in layer coordinates is there (e.g. GM_GetLineFeature) ? If possible, this would be helpful since often, I want to process a vector feature (say split it) where I don't need the coordinates in the global system. My problem stems from working in geographic coordinates at times when I'm viewing data sets that cover a large area (e.g. Gulf of Mexico), but editing smaller data sets that are maintained in a projected coordinate system (overland area). I would like to avoid the inaccuracy of converting the projected features to and from a geographic system just to split them or otherwise edit them.

Thanks,
David

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited March 2010
    David,

    Currently to get the point list in the native projection of the layer you could call GM_SetProjection prior to calling GM_GetLineFeature to set the projection to the native projection of the layer, then restore it when you are done.

    If this is too slow or inconvenient, I could add a GM_GetLineFeatureEx that takes some flags, including whether to get the coordinates in the native projection or the current set projection.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • dcoggindcoggin Global Mapper User Posts: 259Trusted User
    edited March 2010
    Calling GM_SetProjection is not inconvenient. I'm not sure how much overhead is involved in the call. I suppose if I change to layer projection, edit the feature, and change back to the original global projection that could work. I suppose no numbers in any of the layers really change with the SetProjection call, but I'm not sure if there are any other ill effects from calling it repeatedly.

    I want to be able to edit and join many vector features (triangulation parts) automatically. Every time an actual projection conversion is done to another projection and back, of course the numbers change a little. If I then want to rejoin parts later, I have to do some sort of clean operation where I restore nearby vertices to common coordinates. Calling SetProjection before and after the operation should prevent this, so I'll give that a try.

    Thanks,

    David
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited March 2010
    David,

    Reprojection is done on-the-fly, so there should not be any ill effects from calling GM_SetProjection, but if your data covers a large area the call may be slow. Let me know if it's too slow and I'll add the extended functions.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • dcoggindcoggin Global Mapper User Posts: 259Trusted User
    edited March 2010
    Thanks, Mike. My data does usually cover a very large area. I have recoded my split feature to use SetProjection before and after editing. I'll give it a try with a large data set and let you know if it's too slow.

    David
  • dcoggindcoggin Global Mapper User Posts: 259Trusted User
    edited March 2010
    Mike,

    Calling SetProjection before getting vector features to reset the global projection is affecting most of my vector edit functions. I have adjusted my code, but it is affecting the speed with large data sets. If you have an opportunity sometime, it would surely be nice to get the Ex function (or whatever method) to be able to get vector features in layer coordinates.

    As always, thanks for the great support.

    David
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited March 2010
    David,

    I have completed adding the new GM_Get*FeatureEx functions to the SDK. There is a new SDK build at http://www.globalmapper.com/GlobalMapperSDK_v134_beta.zip for you to try.

    Let me know if I can be of further assistance.

    Thanks,

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