GM_ExportElevationEx - determine elevation pixels in bounds before export
Mike,
In GM_ExportElevationEx - is there any way to determine how many elevation points exist within a certain world bounds prior to export? I ask because you have to specify a pixel width/height for export ahead of the the actual export, but of course if you change the export bounds to be something outside of the entire layer you really have no idea which elevation points may exist in there to actually specify for export. Any thoughts on this? Is there some "auto - based on elevation points that exist" setting and/or a way for me to count the x/y elevation points within a particular world bounds / rectangle prior to export? Thanks.
Brian
In GM_ExportElevationEx - is there any way to determine how many elevation points exist within a certain world bounds prior to export? I ask because you have to specify a pixel width/height for export ahead of the the actual export, but of course if you change the export bounds to be something outside of the entire layer you really have no idea which elevation points may exist in there to actually specify for export. Any thoughts on this? Is there some "auto - based on elevation points that exist" setting and/or a way for me to count the x/y elevation points within a particular world bounds / rectangle prior to export? Thanks.
Brian
Comments
-
Mike,
It looks like LayerInfo GM_AttrValue_t* mMetadataList; // List of metadata attributes and values for the layerHas what I would need. Trying to marshall it into something managed code can see. Can you confirm this is right?
Brian -
Brian,
That list of values wouldn't contain what you are after. I would instead intersect your export bounds with the GM_LayerInfo_t.mGlobalBounds to figure out what overlap there is between an input layer and your total export bounds, then based on the pixel dimensions of that layer (which tells you the total number of samples) you can calculate an actual approximate number in your export bounds based on the percent of the layer in your export bounds. I think what you really might want is a way to determine a sample size to use for computing appropriate pixel height and width through, correct?
You could use the same approach for that, just spin through the GM_LayerInfo_t structures for loading layers and calculate sample spacing in the current projection using the mGlobalBounds and the pixel dimensions, then use the smallest of those from the intersecting layers to compute an output pixel width/height for your export bounds that maintains the full resolution.
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.globalmapper.com -
Mike,
Yes - I just figured all that part out. So - is there a way, given a pre-set world bounds I can draw/select an AOI and then load it as a new layer to get all associated new layer info?
Brian -
Mike,
Or are you saying something like this. If my total world bounds has 117 pixels/samples across (elevation grid), for example, and I want to slice that up into 8 "even" grids", I of course can do this via lat/lon UTM with no issues. But the 117/8 would be 14.625 and obviously we need whole numbers here between grids. Would you suggest to just leave the grid division at 14 OR 15 at that rate? Again, I understand what you are saying in terms of approximation. I'm just curious suggestions, thanks.
Brian -
I guess I'm not sure what you mean by loading the AOI as a new layer? Are you wanting to just load some data that is in that particular AOI or something different?
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.globalmapper.com -
I would round up that way you get slightly higher rather than slightly lower resolution, so you don't lose anything.
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.globalmapper.com -
Mike,
Yea - I noticed that somewhat already. Thanks for the info.
Brian
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