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

ConvertArealUnits

Available with Production Mapping license.

  • Summary
  • Discussion
  • Syntax
  • Code sample

Summary

Converts native data units to area units such as square meters.

Discussion

This function is useful for converting the native data units to units that are easier to measure. For example, if the data is in decimal degrees, it is easier to identify a minimum distance value in square kilometers.

Syntax

ConvertArealUnits (area_
value, layer)
ParameterExplanationData Type
area_ value

The number of units and the unit of measure to be used, for example, 1000 square meters.

String
layer

The layer whose units will be converted.

Layer

Code sample

ConvertArealUnits example

This script converts the Facilities layer to square meters.

import arcpy
import arcpyproduction
from arcpyproduction import generalization

# set environment
arcpy.env.workspace="c:/Data/LocalGovernment.gdb"

# Check out Production Mapping license
arcpy.CheckOutExtension("Foundation")

# Define variables
inFeatures="ReferenceData/FacilitySite"
inFeatLayer="Facilities"

# create a feature layer
arcpy.MakeFeatureLayer_management(inFeatures,inFeatLayer)

# Execute ConverArealUnits
value=generalization.ConvertArealUnits("100 SquareMeters", inFeatLayer)

# describe inFeatLayer to determine its spatial reference units
desc=arcpy.Describe(inFeatLayer)
sr=desc.spatialReference
if sr.linearUnitName != '':
    unit=sr.linearUnitName
    print "Converted Square meters to {0} {1}".format(value,unit)
else:
    print "Converted Square meters to {0}".format(value)

Related topics

  • Introduction to arcpyproduction.generalization
  • ConvertLinearUnits

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