ESRI Shapefile .SHP Import Automation Options

 

Since the Import Options dialog is not displayed when the program is driven from an automation script, an options string can be specified in the script. The string consists of comma-separated parameters, which specify the behavior of the various import options. A typical example would be:

 

 "Defaults=1,AreasToCurves=1"

 

This would first set all import options to their default values, then set the AreasToCurves option value to one, which would specify that any areas imported be converted to closed curves.

 

Option

Action

Default

Defaults=1

Set all options to their default values

No

ForgetOptions=1

Don't remember options for later use

No

AreasToCurves=1

Convert area objects to closed curves

No

PrimaryIDField=n

Specify that field number n of each record in the optional DBF database will be assigned to the primary ID string of each object that is imported from the SHP input file. If the SHP file is not accompanied by a DBF file, this option has no effect.

0

SecondaryIDField=n

Same as above, except applies to the secondary ID.

0

ImportCodePage

The number of the ANSI code page to use when importing Unicode data. Valid code page number in the range 0 through 65535.

 

If a .CPG file exists in the directory with the same name as the .SHP file, the code page stored in the .CPG file will be used.

 

If a .DBF file exists in the directory with the same name as the .SHP file, the .DBF file attribute data must be translated from ANSI text to Unicode representation. If no .CPG file exists, the Language ID value stored in the .DBF file’s header determines the code page used. However, if the Language ID value is zero or invalid, the “Western European (Windows)” code page (1252) will be used.

""

 

 

See Also

ESRI Shapefile File Description

ESRI Shapefile Export Automation Options

ESRI Shapefile Export Options Dialog