Global Mapper Pro

Is there an easier way to export area features completely inside a selection area ?

jeroenDK
jeroenDK Global Mapper UserTrusted User
edited September 2014 in GM Script Language
I'm exporting area features using a POLYGON_CROP_FILE, which will result in areas overlapping the crop polygon to be cropped.
My elevation data is cropped by the same crop polygon.

My problem arises when calculating elevation data for the croped areas, since some vertices will lie exactly on the crop polygon, and apparently the elevation data isn't valid there, resulting in -999999 as elevation.

I would like to only export areas completely inside the crop polygon instead, and came up with the following:

IMPORT FILENAME="BUILDINGS.shp" \
TYPE="SHAPEFILE" \
ELEV_UNITS="METERS" LABEL_FIELD_FORCE_OVERWRITE="NO"


EDIT_VECTOR FILENAME="BUILDINGS.shp" SHAPE_TYPE="AREAS" ATTR_VAL="INSIDE=FALSE"


IMPORT FILENAME="selection.shp" \
TYPE="SHAPEFILE" \
ELEV_UNITS="METERS" LABEL_FIELD_FORCE_OVERWRITE="NO"


EDIT_VECTOR FILENAME="selection.shp" SHAPE_TYPE="AREAS" ATTR_VAL="INSIDE=TRUE"


COPY_ATTRS LAYER1_FILENAME="selection.shp"\
LAYER2_FILENAME="BUILDINGS.shp" \
FROM_TYPE="AREAS" TO_TYPE="AREAS" ATTR_TO_COPY="INSIDE" \
AREA_COVERAGE="COMPLETE"


EDIT_VECTOR FILENAME="BUILDINGS.shp" SHAPE_TYPE="AREAS" \
COMPARE_STR="INSIDE=FALSE" DELETE_FEATURES="TRUE"

(I've modified the filenames for better readability)

This is pretty cumbersome, so does anyone know of a better way to do this ?
Is there an option in EXPORT_VECTOR I've missed ?

Regards
Jeroen

Comments

  • global_mapper
    global_mapper Administrator
    edited June 2014
    Jeroen,

    If the elevation values are the only issue you might check the option about 2/3rds of the way down the Advanced Options list on the General tab of the Configuration dialog labeled 'Export: Keep Pixel if Any Part is Inside Crop Area'. That option should make the elevation values valid if any part of the elevation grid cell is in the crop area and not just the center, which I think will solve that issue.

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
  • jeroenDK
    jeroenDK Global Mapper User Trusted User
    edited June 2014
    Hi Mike.

    Thanks :) , that fixed the problem with the invalid height values.

    I would still like to know is there is an easier way to only export areas that are completely inside my selection shape thou.
    When I'm exporting building shapes, I'd prefer to only export complete buildings.

    Regards
    Jeroen
  • global_mapper
    global_mapper Administrator
    edited June 2014
    Jeroen,

    There is not currently a simple flag to specify to discard any area features that are clipped at all by the crop boundary, but your script method should work nicely. I would suggest perhaps making it more general by using DEFINE_VAR to set up some variables and maybe prompt for things like the layer to work on. Then you can make the script a workspace (.gmw) and just load it when you want to run the export process with the special cropping option.

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
  • Abbyabi098
    Abbyabi098 Global Mapper User
    edited September 2014
    Not the ideal solution, but if you put the selected objects into a layer (either move them or duplicate them to a new layer temporarily), turn off the rest of the layers and export.

    web designing company in dubai
Sign In or Register to comment.