How to load a polygon to layer and display in editor
Hi all,
I am stuck at an issue and have been trying numerous things but, I feel as if I am going down the wrong paths so any assistance would be helpful.
In this part of my script, I am attempting to define a bounds poly (to place in a layer in order to reference for cropping later) but I can't seem to figure out how to load said poly into a layer and display it in editor.
Here is my existing method, any pointers would be super appreciated.
// Global Mapper Script to draw a polygon
// Define coordinates
DEFINE_VAR NAME="ULX" VALUE="679994.500"
DEFINE_VAR NAME="ULY" VALUE="3990005.500"
DEFINE_VAR NAME="LRX" VALUE="700005.500"
DEFINE_VAR NAME="LRY" VALUE="3979994.500"
// Define layer name
DEFINE_VAR NAME="LAYER_NAME" VALUE="CropPoly"
//draw rectangle from coords
DEFINE_TEXT_FILE FILENAME="SceneBoundsPolygon"
CLOSED=YES
%ULX%, %ULY%
%LRX%, %ULY%
%LRX%, %LRY%
%ULX%, %LRY%
%ULX%, %ULY%
END_DEFINE_TEXT_FILE
Comments
-
I am not seeing support for utilization of embedded shape files, so I assume I would have to export it as a text file and then import it back into a layer?
Basically, the script above is just apart of a much larger script that is essentially part of an automated process to build gmw scenes. For this usecase, I am searching the gmw for layers with a *DTM prefix so I can dynamically generate a bounding poly for cropping other features that are being imported that are far too large. I have tried the open .gmw file in a text editor method but, seems like all the embedded data is saves as some encrypted ascii code.
Will post the solution once I figure it out incase it helps someone else out in the future.
Categories
- 13K All Categories
- 5.8K Features Discussion
- 349 Downloading Imagery
- 1.3K Elevation Data
- 385 Georeferencing Imagery Discussion
- 652 GM Script Language
- 56 User Scripts
- 115 GPS Features
- 421 Projection Questions
- 835 Raster Data
- 1.4K Vector Data
- 6.7K Support
- 181 Announcement and News
- 939 Bug Report
- 562 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 579 Other Discussion
- 132 GIS Data Sources
- 27 Global Mapper Showcase
- 244 How I use Global Mapper
- 110 Global Mapper Forum Website
