# Class DxfEntityProcessor

Processes various DXF entities and dispatches them to the appropriate mapper class for conversion to GeoJSON features.

#####
Index

### Constructors

constructor

### Methods

convertToSpatialReference
getContext
process
processAll
projectMany

##
Constructors

### constructor

- new DxfEntityProcessor(sourceSR, targetSR, contextOverrides?): DxfEntityProcessor

- Initializes a new instance of the DxfEntityProcessor.

  #### Parameters

  - sourceSR: SpatialReference

    The source spatial reference of the DXF data.

  - targetSR: SpatialReference

    The target spatial reference for the output layers.

  - contextOverrides: Partial<IDxfJsonComponentContext> = {}

    Optional partial context to override default values.

  #### Returns DxfEntityProcessor

##
Methods

### convertToSpatialReference

- convertToSpatialReference(x, y): Promise<[number, number]>

- Converts a single coordinate pair from the source spatial reference to the target spatial reference.

  #### Parameters

  - x: number

    The x-coordinate to convert.

  - y: number

    The y-coordinate to convert.

  #### Returns Promise<[number, number]>

  A promise that resolves with the converted [x, y] coordinates.

### getContext

- getContext(): IDxfJsonComponentContext

- Returns the fully constructed DXF conversion context.

  #### Returns IDxfJsonComponentContext

  The shared DXF conversion context.

### process

- process(entity): Promise<void>

- Processes a single DXF entity or an array of entities. It filters out "BLOCK" and "ENDBLK" types and dispatches the rest to the appropriate handler.

  #### Parameters

  - entity: IEntity | IEntity[]

    The entity or array of entities to process.

  #### Returns Promise<void>

### processAll

- processAll(): Promise<(GraphicsLayer | FeatureLayer | GeoJSONLayer)[]>

- Processes all entities from the DXF data in batches to keep the UI responsive.

  #### Returns Promise<(GraphicsLayer | FeatureLayer | GeoJSONLayer)[]>

  A promise that resolves with an array of the generated layers.

### projectMany

- projectMany(points): Promise<[number, number][]>

- Project an array of points into the target spatial reference.

  #### Parameters

  - points: Point[]

    Array of points to project.

  #### Returns Promise<[number, number][]>

  Array of converted coordinate pairs.