build_transform_and_save_weights
Build spatial weights from a point shapefile using queen, rook, distance band, or KNN methods, optionally apply a transformation, and save the weights to GAL or GWT format.
Instructions
Pipeline: Read shapefile, build spatial weights, optionally transform, and save to file.
Parameters:
data_path: Path to point shapefile or GeoPackage
method: 'queen', 'rook', 'distance_band', 'knn'
id_field: Optional field name for IDs
threshold: Distance threshold (required if method='distance_band')
k: Number of neighbors (required if method='knn')
binary: True for binary weights, False for inverse distance (DistanceBand only)
transform_type: 'r', 'v', 'b', 'o', or 'd' (optional)
output_path: File path to save weights
format: 'gal' or 'gwt'
overwrite: Allow overwriting if file exists
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data_path | Yes | ||
| method | No | queen | |
| id_field | No | ||
| threshold | No | ||
| k | No | ||
| binary | No | ||
| transform_type | No | ||
| output_path | No | weights.gal | |
| format | No | gal | |
| overwrite | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||