GM_CalcEnclosedArea
hany m. magdy
Global Mapper User
This function is always return 0.
LastGMError = GlobalMapperDLL.GM_CalcEnclosedArea(point, Int32.Parse(point.Length.ToString()), new GM_Projection_t(), out Area);
point is list of points of type GM_Point_t,
Area is double
LastGMError = GlobalMapperDLL.GM_CalcEnclosedArea(point, Int32.Parse(point.Length.ToString()), new GM_Projection_t(), out Area);
point is list of points of type GM_Point_t,
Area is double
Comments
-
I see a couple of potential problems. First of all the second parameter should just be an integer of the number of points in your 'point' list. It looks like you are doing some kind of strange string conversion rather than just passing in the number.
Second, the 3rd parameter should define the projection that the points you are providing are in. You are just providing a new uninitialized GM_Projection_t structure. You need to either pass NULL if your points are in the currently defined projection, or you need to define the projection that the points are in via a GM_Projection_t structure and pass that in.
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com -
Hi Mike
first the code you don't understand Int32.Parse(point.Length.ToString()) is return the length of the point,
Second when i pass null in third parameter it get a build error.
i use VS2008 C#
Thanks -
I can see how the length works, although it seems like just a call to point.Length would work without converting to a string and then back to an integer.
What does your GM_CalcEnclosedArea declaration look like? If you define the 3rd parameter as an IntPtr then you can pass NULL. Otherwise you will need to setup the GM_Projection_t structure to define the projection of your coordinates.What are the projection of the points you are passing in by the way?
Thanks,
Mike
Global Mapper Support
support@globalmapper.com -
Mike
Thanks it's work good
Hany
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