📄 readme.txt
字号:
USAGE:
<input_workspace> <projection> {data_type} {wildcard} {type} {overwrite_projection}
PURPOSE:
BatchDefineProjection.py is a python script used to define a
projection to a set of input feature classes in a workspace.
The <input_workspace> can be a folder containing shapefiles or rasters, or a geodatabase
containing feature classes or rasters. The geodatabase can be a personal or a enterprise database.
The <projection> can be set using a template dataset containing the projection to use
or a projection file (.prj). If the path contains spaces it must be quoted.
The {data_type} can be used to either define a projection to a list of feature classes or rasters.
Valid data types are:
* FEATURES - This is the default. Only get a list of feature classes in <input_workspace>.
* RASTERS - Gets a list of rasters in the <input_workspace>.
The {wildcard} can be used to filter the list of feature classes or rasters.
Combination of * and characters that will help limit the results.
The asterisk (*) is the same as saying ALL. If no wildcard is specified then all
feature classes or rasters, in the workspace, will be returned.
The {type} can be used to select feature classes or rasters of a specific type.
Valid FeatureTypes and RasterTypes for this method are:
* POINT - Only point feature classes will be returned.
* LABEL - Only label feature classes will be returned.
* NODE - Only node feature classes will be returned.
* LINE - Only line feature classes will be returned.
* ARC - Only arc feature classes will be returned.
* ROUTE - Only route feature classes will be returned.
* POLYGON - Only polygon feature classes will be returned.
* REGION - Only region feature classes will be returned.
** ALL - All feature classes will be returned. This is the default.
RASTER TYPES:
* ADRG, BIL, BIP, BSQ, BMP, CADRG, CIB, ERS,
GIF, GIS, GRID, STACK, IMG, JPEG, LAN, SID,
TIFF, RAW, PNG, NITF, ALL
The {overwrite_projection} can be used to overwrite the projection of any feature class or raster
that already has a projection defined. The default is set to do not overwrite.
Valid options are:
* NO - Do not overwrite the projection definition. This is the default.
* YES - Overwrite the projection definition if already defined.
HOW TO RUN THIS SCRIPT:
The recommended way to execute this script is run it at the Command (dos) Prompt.
Open the Command Prompt and type the path to the script and specify the parameters.
The example below will define a projection to all the shapefiles in C:\workspace with the same
projection as that of C:\workspace\template.shp.
E.g. C:\scripts\BatchDefineProjection.py C:\workspace C:\workspace\template.shp
In this example a projection will be defined to all rasters in C:\workspace:
E.g. C:\scripts\BatchDefineProjection.py C:\workspace C:\workspace\raster1 RASTERS
MORE EXAMPLES:
C:\scripts\BatchDefineProjection.py C:\workspace C:\workspace\template.shp FEATURES lu* POLYGON YES
C:\scripts\BatchDefineProjection.py C:\workspace\MyGDB.mdb C:\workspace\Temp.mdb FEATURES * LINE YES
ADDITIONAL NOTES:
If one of the arguments contains spaces, ensure to enclosed that arugment in double quotation marks.
E.g C:\scripts\BatchDefineProjection.py C:\workspace "C:\ArcGIS\Coordinate Systems\Geographic\WGS 84.prj"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -