Is there an easier way to export area features completely inside a selection area ?
jeroenDK
Global Mapper UserTrusted User
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
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
-
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 -
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 -
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 -
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
Howdy, Stranger!
Categories
- 12.2K All Categories
- 5.3K Features Discussion
- 312 Downloading Imagery
- 1.2K Elevation Data
- 371 Georeferencing Imagery Discussion
- 580 GM Script Language
- 42 User Scripts
- 111 GPS Features
- 388 Projection Questions
- 788 Raster Data
- 1.3K Vector Data
- 6.4K Support
- 159 Announcement and News
- 881 Bug Report
- 554 SDK
- 1.1K Suggestion Box
- 3.6K Technical Support
- 520 Other Discussion
- 125 GIS Data Sources
- 26 Global Mapper Showcase
- 217 How I use Global Mapper
- 99 Global Mapper Forum Website