ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • ArcGIS Pro
  • ArcMap
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS for 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

  • ArcGIS Pro
  • ArcMap
Esri
English
  • English
  • Deutsch
  • Español
  • Français
  • 日本語
  • Русский
  • 简体中文
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...
  • Manage Data
  • Administering geodatabases
  • Using SQL with geodatabases
  • SQL spatial and raster types
  • Use ST_Geometry with SQL
  • ST_Geometry function reference
  • Back to Top
  • What is the ST_Geometry storage type?
  • SQL and Esri ST_Geometry
  • Load the SQLite ST_Geometry library
  • Spatial indexes

    • Spatial indexes and ST_Geometry
    • When are spatial indexes used?
    • The R-tree index
    • The spatial grid index
    • Guidelines for choosing a spatial index grid size
    • Tips on using a spatial grid index

    Examples using SQL with existing geodatabase feature classes

    • Enhance ArcGIS functionality using ST_Geometry
    • Spatial SQL queries on tables with an ST_Geometry column
    • Using spatial views on tables with an ST_Geometry column
    • Using SQL with existing feature classes

    Examples using SQL to create spatial tables

    • Create tables with an ST_Geometry column
    • Register an ST_Geometry column
    • Unregister an ST_Geometry column
    • Create spatial references using SQL
    • Insert features to a table with an ST_Geometry column
    • Create spatial indexes on tables with an ST_Geometry column using SQL
    • Update values in an ST_Geometry spatial column
    • Delete values from an ST_Geometry spatial column
    • Registering a table with the geodatabase
    • Workflow: Creating tables with SQL and registering them with the geodatabase

    Reference

    • How is ST_Geometry implemented?
    • SQL implementation differences for the ST_Geometry type
    • ST_Geometry function calls
    • Rules for creating spatial tables to be used with ArcGIS
    • Geometry validation
    • Parametric circles, ellipses, and wedges
    • Constructor functions for ST_Geometry
    • Geometry properties
    • Spatial accessor functions
    • Spatial relationships
    • Spatial relationship functions
    • Spatial operations
    • Spatial operation functions

    ST_Geometry function reference

    • SQL functions used with ST_Geometry
    • ST_Aggr_ConvexHull
    • ST_Aggr_Intersection
    • ST_Aggr_Union
    • ST_Area
    • ST_AsBinary
    • ST_AsText
    • ST_Boundary
    • ST_Buffer
    • ST_Centroid
    • ST_Contains
    • ST_ConvexHull
    • ST_CoordDim
    • ST_Crosses
    • ST_Curve
    • ST_Difference
    • ST_Dimension
    • ST_Disjoint
    • ST_Distance
    • ST_EndPoint
    • ST_Entity
    • ST_Envelope
    • ST_EnvIntersects
    • ST_Equals
    • ST_Equalsrs
    • ST_ExteriorRing
    • ST_GeomCollection
    • ST_GeomCollFromWKB
    • ST_Geometry
    • ST_GeometryN
    • ST_GeometryType
    • ST_GeomFromText
    • ST_GeomFromWKB
    • ST_GeoSize
    • ST_InteriorRingN
    • ST_Intersection
    • ST_Intersects
    • ST_Is3d
    • ST_IsClosed
    • ST_IsEmpty
    • ST_IsMeasured
    • ST_IsRing
    • ST_IsSimple
    • ST_Length
    • ST_LineFromText
    • ST_LineFromWKB
    • ST_LineString
    • ST_M
    • ST_MaxM
    • ST_MaxX
    • ST_MaxY
    • ST_MaxZ
    • ST_MinM
    • ST_MinX
    • ST_MinY
    • ST_MinZ
    • ST_MLineFromText
    • ST_MLineFromWKB
    • ST_MPointFromText
    • ST_MPointFromWKB
    • ST_MPolyFromText
    • ST_MPolyFromWKB
    • ST_MultiCurve
    • ST_MultiLineString
    • ST_MultiPoint
    • ST_MultiPolygon
    • ST_MultiSurface
    • ST_NumGeometries
    • ST_NumInteriorRing
    • ST_NumPoints
    • ST_OrderingEquals
    • ST_Overlaps
    • ST_Point
    • ST_PointFromText
    • ST_PointFromWKB
    • ST_PointN
    • ST_PointOnSurface
    • ST_PolyFromText
    • ST_PolyFromWKB
    • ST_Polygon
    • ST_Relate
    • ST_SRID
    • ST_StartPoint
    • ST_Surface
    • ST_SymmetricDiff
    • ST_Touches
    • ST_Transform
    • ST_Union
    • ST_Within
    • ST_X
    • ST_Y
    • ST_Z

    ST_Z

    This ArcGIS 10.3 documentation has been archived and is no longer updated. Content and links may be outdated. See the latest documentation.
    • Definition
    • Syntax
    • Return type
    • Example

    Definition

    ST_Z takes an ST_Point as an input parameter and returns its z- (elevation) coordinate. In SQLite, ST_Z can also update the z-coordinate of an ST_Point.

    Syntax

    Oracle and PostgreSQL

    sde.st_z (geometry1 sde.st_point)

    SQLite

    st_z (geometry  geometryblob)
    st_z (input_shape geometryblob, new_Zvalue double)

    Return type

    Oracle

    Number

    PostgreSQL

    Integer

    SQLite

    Double precision is returned when ST_Z is used to return the z-coordinate of a point. A geometryblob is returned when ST_Z is used to update the z-coordinate of a point.

    Example

    The z_test table is created with two columns: the id column, which uniquely identifies the row, and the geometry point column. The INSERT statement inserts a row into the z_test table.

    The SELECT statement lists the id column and the double-precision z-coordinate of the point inserted with the previous statement.

    Oracle

    CREATE TABLE z_test (
     id integer unique,
     geometry sde.st_point
    );
    
    INSERT INTO z_test (id, geometry) VALUES (
     1,
     sde.st_point (2, 3, 32, 5, 4326)
    );
    
    SELECT id, sde.st_z (geometry) Z_COORD
     FROM Z_TEST; 
    
            ID      Z_COORD
    
             1        32
    

    PostgreSQL

    CREATE TABLE z_test (
     id integer unique,
     geometry sde.st_point
    );
    
    INSERT INTO z_test (id, geometry) VALUES (
     1,
     sde.st_point (2, 3, 32, 5, 4326)
    );
    
    SELECT id, sde.st_z (geometry) 
     AS Z_COORD
     FROM z_test; 
    
            id      z_coord
    
             1        32
    

    SQLite

    CREATE TABLE z_test (id integer);
    
    SELECT AddGeometryColumn(
     NULL,
     'z_test',
     'pt1',
     4326,
     'pointzm',
     'xyzm',
     'null'
    );
    
    INSERT INTO z_test (id, pt1) VALUES (
     1,
     st_point (2, 3, 32, 5, 4326)
    );
    
    SELECT id, st_z (pt1) 
     AS "The z coordinate"
     FROM z_test; 
    
    id      The z coordinate
    
    1        32.0
    

    The ST_Z function can also be used to update the coordinate value of an existing point. In this example, ST_Z is used to update the z-coordinate value of the first point in z_test.

    UPDATE z_test
     SET pt1=st_z(
      (SELECT pt1 FROM z_test where id=1), 32.04)
     WHERE id=1;
    

    Related topics

    • Load the SQLite ST_Geometry library

    ArcGIS Desktop

    • Home
    • ArcGIS Pro
    • ArcMap
    • Documentation
    • Support

    ArcGIS

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

    About Esri

    • About Us
    • Careers
    • Insiders Blog
    • User Conference
    • Developer Summit
    Esri
    © Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal