IDLffShape::Open

The IDLffShape::Open function method opens a specified Shapefile.

Syntax

Result = Obj->[IDLffShape::]Open( ‘Filename’ [, /DBF_ONLY] [, ENTITY_TYPE=’value’] [, /UPDATE] )

Return Value

Returns 1 if the file can be read successfully. If not able to open the file, it returns 0.

Arguments

Filename

A scalar string containing the full path and filename of a Shapefile (.shp) to open. Note that the .shp, .shx, and .dbx files must exist in the same directory for you to be able to open and access the file unless the UPDATE keyword is set.

Keywords

DBF_ONLY

If this keyword is set to a positive value, only the underlying dBASE table (.dbf) component of the shapefile is opened. All entity related files are left closed. Two values to this keyword are accepted: 1 - Open an existing .dbf file, > 1 - Create a new .dbf file

The UPDATE keyword is required to open the .dbf file for updating.

ENTITY_TYPE

Set this keyword to the entity type of a new Shapefile. Use this keyword only when creating a new Shapefile. For more information on entity types, see Entities.

UPDATE

Set this keyword to have the file opened for writing. The default is read-only.

Examples

In the following example, the file examples/data/states.shp is opened for reading and writing:

status = myShape->Open(FILEPATH('states.shp', $

   SUBDIR=['examples', 'data']), /UPDATE)

Version History

5.4

Introduced