SMMCMASTER

McMaster arc smoothing


EnvironmentsPYTHON :: EASI :: MODELER
Quick linksDescription :: Parameters :: Parameter descriptions :: Return Value :: Details :: Example :: Related

Back to top

Description


SMMCMASTER performs vector smoothing using the McMaster algorithm. It selects first five vertices and calculates their average to find the new, "smoothed" vertex. SMMCMASTER may also be used with vectors containing less than five vertices.
Back to top

Parameters


smmcmaster(fili, filo, dbvs, tolvalue, slideavg, dbsn, dbsd)

Name Type Caption Length Value range
FILI* str Input file name 1 -    
FILO str Output file name 0 -    
DBVS* List[int] Input vector segment 1 - 1  
TOLVALUE List[float] Tolerance value 0 - 1 Default: 0.5
SLIDEAVG str Use sliding average 0 - 5 TRUE | FALSE
Default: FALSE
DBSN str Output segment name 0 - 8 Default: Vectors
DBSD str Output segment description 0 - 64  

* Required parameter
Back to top

Parameter descriptions

FILI

Specifies the name of the PCIDSK image file containing the input arc layer to be smoothed.

FILO

Specifies the name of the PCIDSK image file to receive the smoothed output vector layer.

If FILO is not specified, FILI is used for the smoothed vector. If FILO is specified but does not exist, a new file is created.

DBVS

Specifies the vector segment containing the input arc layer to be smoothed.

TOLVALUE

Specifies the tolerance value. This value must be greater than zero and smaller than one. The larger the tolerance value, the more pronounced the smoothing effect.

SLIDEAVG

Specifies whether sliding average is to be used. Sliding average brings the smoothed vertex closer to the original line. The slide averaging has less affect the closer the tolerance value is to zero. The default value is FALSE (unchecked).

DBSN

Specifies a name (up to 8 characters) for the new vector segment.

DBSD

Describes (in up to 64 characters) the contents or origins of the new vector data.

Back to top

Return Value

Returns: 

Type:  PCI_INT

Returns the smoothed vector segment in FILO.

Back to top

Details

SMMCMASTER performs vector smoothing using the McMaster algorithm. It selects first five vertices and calculates their average to find the new, "smoothed" vertex. SMMCMASTER may also be used with vectors containing less than five vertices.

This algorithm works well for stepped linework vectors produced by raster-to-vector conversion routines, or those produced through digitizing.

SMMCMASTER does not alter the start and end vertices of a vector.

Back to top

Example

Apply McMaster vector smoothing to layer 25 from "irvine.pix" with a TOLVALUE of 0.5 and no sliding average option. The smoothed vector will be stored in a new file named "oirvine.pix".

from pci.smmcmaster import *

fili      =  "irvine.pix"
filo      =  "oirvine.pix"
dbvs      =  [25]
tolvalue  = []              # defaults to 0.5
slideavg  = ""              # defaults to FALSE
dbsn      = ""              # Defaults to Vectors
dbsd      = ""              # will be taken from DBVS

smmcmaster( fili, filo, dbvs, tolvalue, slideavg, dbsn, dbsd )

© PCI Geomatics Enterprises, Inc.®, 2024. All rights reserved.