ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Calculate Line Caps

  • Summary
  • Illustration
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Modifies the cap type (ending style) for representation stroke symbols and stores it as a representation override.

Illustration

Calculate Line Caps tool examples
Square or butt caps are applied to dead-end streets, showing options where the cased-line streets connect to a green single-line street.

Usage

  • Representation stroke symbols that are relatively wide and drawn with multiple layers to display a cased road effect are often joined at their endpoints with round line caps to prevent symbol gaps appearing at sharp angles between features. However, a round end cap is generally not a desirable cartographic appearance for a dead-end street (dangling line features that are not connected at their endpoint to another feature.) The line cap style is generally overridden to a butt or square style in these situations. This tool detects dangles and overrides the representation cap type of the stroke symbol.

Syntax

arcpy.cartography.CalculateLineCaps(in_features, {cap_type}, {dangle_option})
ParameterExplanationData Type
in_features

The input feature layer containing line representations.

Layer
cap_type
(Optional)

Specifies how the ends of representation stroke symbols are drawn. The default cap type of representation strokes is round; the symbol is terminated with a semicircle of radius equal to stroke width centered at the line endpoint.

  • BUTT —The stroke symbol ends exactly where the line geometry ends. This is the default.
  • SQUARE —The stroke symbol ends with closed, square caps that extend past the endpoint of the line by half of the symbol width.
String
dangle_option
(Optional)

Specifies how line caps are calculated for adjoining line features that share an endpoint but are drawn with different symbology.

  • CASED_LINE_DANGLE —The cap style is modified for dangling lines (those not connected at their endpoints to another line) and also for the lines where a cased-line symbol is joined at the endpoint of a single-stroke layer line symbol. This is the default.
  • TRUE_DANGLE —The cap style is modified only for endpoints that are not connected to another feature.
String

Derived Output

NameExplanationData Type
out_representations

The updated input line feature layer.

Layer

Code sample

CalculateLineCaps example 1 (Python window)

The following Python window script demonstrates how to use the CalculateLineCaps function in immediate mode.

import arcpy
arcpy.env.workspace = "C:\data"
arcpy.CalculateLineCaps_cartography("roads.lyr", "BUTT", "CASED_LINE_DANGLE")
CalculateLineCaps example 2 (stand-alone script)

This stand-alone script shows an example of using the CalculateLineCaps function.

# Name: CalculateLineCaps_standalone_script.py
# Description: calculates a value for the line cap property of a representation stroke layer
# Author: ESRI
 
# Import system modules
import arcpy
from arcpy import env

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

# Set local variables
in_features = "roads.lyr"
cap_type = "BUTT"
dangle_option = "CASED_LINE_DANGLE"

# Execute Calculate Line Caps
arcpy.CalculateLineCaps_cartography(in_features, cap_type, dangle_option)

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: No
  • Standard: Yes
  • Advanced: Yes

Related topics

  • An overview of the Cartographic Refinement toolset

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal