ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Hilfe
  • Sign Out
ArcGIS Desktop

ArcGIS Online

Die Mapping-Plattform für Ihre Organisation

ArcGIS Desktop

Ein vollständiges professionelles GIS

ArcGIS Enterprise

GIS in Ihrem Unternehmen

ArcGIS Developers

Werkzeuge zum Erstellen standortbezogener Apps

ArcGIS Solutions

Kostenlose Karten- und App-Vorlagen für Ihre Branche

ArcGIS Marketplace

Rufen Sie Apps und Daten für Ihre Organisation ab.

  • Dokumentation
  • Support
Esri
  • Anmelden
user
  • Eigenes Profil
  • Abmelden

ArcMap

  • Startseite
  • Erste Schritte
  • Karte
  • Analysieren
  • Verwalten von Daten
  • Werkzeuge
  • Erweiterungen

Calculate Coordinates

  • Zusammenfassung
  • Verwendung
  • Syntax
  • Codebeispiel
  • Umgebungen
  • Lizenzinformationen

Zusammenfassung

Calculates the geometric position coordinates for points, lines, and polygons.

Verwendung

  • Existing values in the specified coordinates field are overwritten every time the tool is run.

  • GFID cannot be used as input field.

  • The length of the text field you choose must coincide with the number of characters in the coordinate string. If it does not, the specified text field is not populated with the coordinate values.

  • The Coordinate Scale parameter (coord_scale for Python) is not applicable for the DMS21, MGRS, USNG, or UTM formats. This is due to the specification for these types of coordinates.

  • If the Round Coordinates check box is checked (coord_rounding parameter set to ROUND), additional rounding will be applied to the coordinate value before it populates the specified field.

  • If rounding occurs on UTM-based coordinates, it is done to the nearest whole number.

Syntax

arcpy.defense.CalculateCoordinates(in_features, field, coord_format, {coord_rounding}, {coord_scale}, {coord_accuracy})
ParameterErklärungDatentyp
in_features

The feature layer for which you want to calculate coordinate values.

Feature Layer
field

The field in the input_features that is going to be updated with the coordinate values. This must be a string field. The GFID field is excluded for this tool.

Field
coord_format

The format of the calculated coordinate values.

  • DD_LAT —The coordinates are calculated in the decimal degrees format for latitude. This is the default. For this format, the text field must be at least 3 characters long, plus the value specified in the coord_scale parameter.
  • DD_LONG —The coordinates are calculated in the decimal degrees format for longitude. For this format, the text field must be at least 3 characters long, plus the value specified in the coord_scale parameter.
  • DMS_LAT —The coordinates are calculated in the degrees, minutes, and seconds format for latitude. For this format, the text field must be at least 12 characters long, plus the value specified in the coord_scale parameter.
  • DMS_LONG —The coordinates are calculated in the degrees, minutes, and seconds format for longitude. For this format, the text field must be at least 13 characters long, plus the value specified in the coord_scale parameter.
  • DMS21 —The coordinates are calculated based on the degrees, minutes, and seconds format, resulting in a 21-character concatenated string representing both latitude and longitude, for example, 34° 02' 29.325'' N 117° 10' 17.125'' W = 340229325N1171017125W. For this format, the text field must be at least 21 characters long.
  • MGRS —The coordinates are calculated in the Military Grid Reference System (MGRS) format. For this format, the text field must be at least 15 characters long.
  • USNG —The coordinates are calculated in the U.S. National Grid format. For this format, the text field must be at least 18 characters long.
  • UTM —The coordinates are calculated in the Universal Transverse Mercator format. For this format, the text field must be at least 13 characters long.
String
coord_rounding
(optional)

Indicates whether the coordinate value is rounded or truncated based on the value specified in the coord_scale parameter.

  • ROUND —The coordinate value is rounded up or down based on the value specified in the coord_scale parameter.
  • TRUNCATE —The coordinate value is shortened based on the value specified in the coord_scale parameter. This is the default.
Boolean
coord_scale
(optional)

The number of digits allowed after the decimal point. The default value is 3. Used in conjunction with the coord_rounding parameter, it determines the length of the coordinate value.

Long
coord_accuracy
(optional)

Determines the precision of the UTM coordinate.

  • FULL_VALUE —Populates the field using all 13 digits from the UTM coordinate value
  • TEN_DIGIT —Populates the field using 10-meter precision
  • EIGHT_DIGIT —Populates the field using 100-meter precision
  • SIX_DIGIT —Populates the field using 1,000-meter precision
  • FOUR_DIGIT — Populates the field using 10,000-meter precision
Hinweis:

This parameter is only available if you choose UTM in the Coordinate Format (coord_format for Python) parameter.

String

Codebeispiel

CalculateCoordinates example (stand-alone script)

In this example, the coordinates are calculated and rounded in the DMS21 format for the AerofacP feature layer and stored in the Coordinate field.

# Name: CalculateCoordinates.py
# Description: Calculates coordinate values for the AerofacP layer 
# Requirements: ArcGIS Defense Mapping solution

# Import arcpy module
import arcpy

# Check out a DefenseMapping extension license
arcpy.CheckOutExtension("defense")

# Local variables
inField = "Coordinate"
inFeatures = r"C:/Data/defense.gdb/VMap2TLM/AerofacP"
coordFormat = "DMS21"
coordRounding = "true"
# coord_scale and coord_accuracy are ignored when coordFormat = "DMS21"
coordScale = "#"
coordAccuracy = "#"

# Execute Calculate Coordinates function
arcpy.CalculateCoordinates_defense(inFeatures, inField, coordFormat, coordRounding, coordScale, coordAccuracy)

# Check in the Defense Mapping extension
arcpy.CheckInExtension("defense")

Umgebungen

  • Aktueller Workspace

Lizenzinformationen

  • Basic: Nein
  • Standard: Erfordert Defense Mapping
  • Advanced: Erfordert Defense Mapping

Verwandte Themen

  • An overview of the Features toolset

ArcGIS Desktop

  • Startseite
  • Dokumentation
  • Support

ArcGIS

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

Über Esri

  • Über uns
  • Karriere
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Wir sind an Ihrer Meinung interessiert.
Copyright © 2021 Esri. | Datenschutz | Rechtliches