Skip To Content

Align Marker To Stroke Or Fill

Summary

Aligns the marker symbol layers of a point feature class to the nearest stroke or fill symbol layers in a line or polygon feature class within a specified search distance.

Illustration

Illustration of aligning markers to stroke
Align markers to stroke with different options.

Usage

  • Symbols are aligned by storing an angle in the attribute connected to the angle property of the marker symbol layer. This must be connected to a single field with no expression applied.

  • The search distance is the measurement from the graphical edge of the point symbol to the graphical edge of the nearest line or polygon symbol. Point symbols beyond the search distance will not be rotated. A search distance of zero aligns only marker layers that are coincident to a line or polygon symbol.

  • Rotating markers may introduce graphic conflicts. The Detect Graphic Conflict tool can be used to identify these areas.

  • Processing large datasets may exceed memory limitations. In this case, consider processing input data by partition by identifying a relevant polygon feature class in the Cartographic Partitions environment setting. Portions of the data, defined by partition boundaries, will be processed sequentially. The result will be seamless and consistent at partition edges.

Syntax

AlignMarkerToStrokeOrFill_cartography (in_point_features, in_line_or_polygon_features, search_distance, {marker_orientation})
ParameterExplanationData Type
in_point_features

The input point feature layer containing point symbols to be aligned to nearby lines or polygons. Symbols are aligned by storing an angle in the attribute connected to the angle property of the marker symbol layer. This must be connected to a single field with no expression applied.

Layer
in_line_or_polygon_features

The input line or polygon feature layer that the input point symbols will be aligned to.

Layer
search_distance

The search distance from graphical marker edge to graphical stroke or fill edge. A distance greater than or equal to zero must be specified.

Linear Unit
marker_orientation
(Optional)

Specifies how to orient the marker symbol layer relative to the stroke or fill symbol layer's edge.

  • PERPENDICULARAligns marker symbol layers perpendicularly to the stroke or fill edge. This is the default.
  • PARALLELAligns marker symbol layers parallel to the stroke or fill edge.
String

Code sample

AlignMarkerToStrokeOrFill example (Python window)

This stand-alone script shows an example of using the AlignMarkerToStrokeOrFill tool.

import arcpy
arcpy.env.workspace = "C:/data"
arcpy.env.referenceScale = "50000"
arcpy.AlignMarkerToStrokeOrFill_cartography("buildings.lyr", "roads.lyr", "2 Points", "PERPENDICULAR")
AlignMarkerToStrokeOrFill example (stand-alone script)

This stand-alone script shows an example of using the AlignMarkerToStrokeOrFill tool.

# Name: AlignMarkerToStrokeOrFill_standalone_script.py
# Description: Aligns the marker symbol layers of a point feature class to the nearest stroke or fill symbol layers in a line or polygon feature class within a specified search distance
# Author: ESRI
 
# Import system modules
import arcpy
from arcpy import env

# Set environment settings
env.workspace = "C:/data"
env.referenceScale = "50000"

# Set local variables
in_point_features = "buildings_points.lyrx"
in_line_or_polygon_features = "roads.lyrx"
search_distance = "2 Points"
marker_orientation = "PERPENDICULAR"

# Execute Align Marker To Stroke Or Fill
arcpy.AlignMarkerToStrokeOrFill_cartography(in_point_features, in_line_or_polygon_features, search_distance, marker_orientation)

Licensing information

  • ArcGIS Desktop Basic: No
  • ArcGIS Desktop Standard: No
  • ArcGIS Desktop Advanced: Yes

Related topics