Coyote Graphics Routines For Sale

Date: Sat Nov 23 14:44:07 2013

single page | use frames     summary     class     fields     routine details     file attributes

.\

cgextractshape.pro


Routines

cgExtractShape_Events, event

This program is used to extract a particular polygon or shape out of a shapefile.

result = cgExtractShape_Selection(filename [, GROUP_LEADER=integer] [, SUCCESS=SUCCESS])

The selection widget if either the AttrName or AttrValue parameter is not used in the initial call to the program.

result = cgExtractShape( [shapefile] [, attrname] [, attrvalue] [, GROUP_LEADER=integer] [, TYPE=integer])

A function that allows a single shape or polygon to be extracted from a shapefile.

Routine details

top cgExtractShape_Events

Graphics, Utility

cgExtractShape_Events, event

This program is used to extract a particular polygon or shape out of a shapefile. The polygon is specified by means of its attribute name and its attribute value. This routine can be purchased in the Coyote Store.

Parameters

event in required

The event structure passed to the event handler by the window manager.

Examples

Here is how to use this program:

file = Filepath(SubDir=['examples', 'data'], 'states.shp') states = ObjArr(4) cgDrawShapes, file, /Auto states[0] = cgExtractShape(file, 'STATE_NAME', 'Colorado') cgDraw_ROI, states[0], Color='blue' states[1] = cgExtractShape(file, 'STATE_NAME', 'Pennsylvania') cgDraw_ROI, states[1], Color='red' states[2] = cgExtractShape(file, 'STATE_NAME', 'Alaska') cgDraw_ROI, states[2], Color='blue' states[3] = cgExtractShape(file, 'STATE_NAME', 'Hawaii') cgDraw_ROI, states[3], Color='red' Obj_Destroy, states

Author information

Author:

FANNING SOFTWARE CONSULTING:

David W. Fanning 1645 Sheely Drive Fort Collins, CO 80526 USA Phone: 970-221-0438 E-mail: david@idlcoyote.com Coyote's Guide to IDL Programming: http://www.idlcoyote.com

Copyright:

Copyright (c) 2013, Fanning Software Consulting, Inc. The event handler for the shape or polygon selection widget.

History:

Change History:

Written, 22 November 2013 by David W. Fanning.

top cgExtractShape_Selection

result = cgExtractShape_Selection(filename [, GROUP_LEADER=integer] [, SUCCESS=SUCCESS])

The selection widget if either the AttrName or AttrValue parameter is not used in the initial call to the program. Allows the user to select these two parameters interactively..

Parameters

filename in required type=string

The name of the shapefile to open.

Keywords

GROUP_LEADER in optional type=integer

Set this keyword to the widget identifier of the group leader widget if you are calling this function from a blocking widget program. Otherwise the shapefile browser window will fail to block and wait for user input. Normally, not used.

SUCCESS out optional

Set to 1 if the user successfully selected an attribute name and value. Set to 0 otherwise.

top cgExtractShape

result = cgExtractShape( [shapefile] [, attrname] [, attrvalue] [, GROUP_LEADER=integer] [, TYPE=integer])

A function that allows a single shape or polygon to be extracted from a shapefile.

Return value

The shape (polygon) is returned as an IDLanROI object. Or, if the polygon is composed of several parts, it is returned as an IDLanROIGroup object containing one IDLanROI object for each part of the final polygon shape. The return value can be used as input to cgDraw_ROI if you wish to draw the polygon in an IDL graphics window. The user is responsible for destroying the objects that are returned as the result of the function. (Objects are automatically destroyed when they are no longer needed in IDL 8.)

Parameters

shapefile in optional type=string

The name of the shapefile to open to obtain the polygon shape. If not provided, the user will be asked to select the name of a shapefile. A shapefile is required for successful program execution.

attrname in optional type=string

The name of the attribute or polygon in the file that you wish to draw. If not supplied, the user will be asked to select the parameter from the shapefile interactively.

attrvalue in optional

The value of the attribute identified by AttrName. This variable can be of any time. If not supplied, the user will be asked to select the parameter from the shapefile interactively.

Keywords

GROUP_LEADER in optional type=integer

Set this keyword to the widget identifier of the group leader widget if you are calling this function from a blocking widget program. Otherwise the shapefile browser window will fail to block and wait for user input. Normally, not used.

TYPE in optional type=integer default=2

The type of IDLanROI object or objects to create. A type of 0 will create a points ROI; a type of 1 will create a path ROI; and a type of 2 will create a closed polygon ROI. See the on-line help for IDLanROI for details.

File attributes

Modification date: Sat Nov 23 14:43:17 2013
Lines: 488
Docformat: rst rst