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_M

    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
    • Examples

    Definition

    ST_M takes an ST_Point as an input parameter and returns its measure (m) coordinate.

    In SQLite, ST_M can also be used to update a measure value.

    Syntax

    Oracle and PostgreSQL

    sde.st_m (point1 sde.st_point)

    SQLite

    st_m (point1 geometryblob)
    st_m (point1 geometryblob, new_Mvalue double)

    Return type

    Oracle and PostgreSQL

    Number

    SQLite

    Double precision if querying for a measure value; a geometryblob if updating a measure value

    Examples

    Oracle

    The table, m_test, is created and three points inserted to it. All three contain measure values. A SELECT statement is run with the ST_M function to return the measure value for each point.

    CREATE TABLE m_test (
     id integer,
     geometry sde.st_point);
    
    INSERT INTO M_TEST VALUES (
     1,
     sde.st_point (2, 3, 32, 5, 4322)
    );
    
    INSERT INTO M_TEST VALUES (
     2,
     sde.st_point (4, 5, 20, 4, 4326)
    );
    
    INSERT INTO M_TEST VALUES (
     3,
     sde.st_point (3, 8, 23, 7, 4326)
    );
    
    SELECT id, sde.st_m (geometry) M_COORD
     FROM M_TEST; 
    
            ID    M_COORD
    
             1          5
             2          4
             3          7
    

    PostgreSQL

    The table, m_test, is created and three points inserted to it. All three contain measure values. A SELECT statement is run with the ST_M function to return the measure value for each point.

    CREATE TABLE m_test (
     id serial,
     geometry sde.st_point
    );
    
    INSERT INTO m_test (geometry) VALUES (
     sde.st_point (2, 3, 32, 5, 4326)
    );
    
    INSERT INTO m_test (geometry) VALUES (
     sde.st_point (4, 5, 20, 4, 4326)
    );
    
    INSERT INTO m_test (geometry) VALUES (
     sde.st_point (3, 8, 23, 7, 4326)
    );
    
    SELECT id, sde.st_m (geometry) 
     AS M_COORD
     FROM m_test; 
    
            id    m_coord
    
             1          5
             2          4
             3          7
    

    SQLite

    In the first example, the table, m_test, is created and three points inserted to it. All three contain measure values. A SELECT statement is run with the ST_M function to return the measure value for each point.

    CREATE TABLE m_test (
     id integer primary key autoincrement not null
    );
    
    SELECT AddGeometryColumn (
     NULL,
     'm_test',
     'geometry',
     4326,
     'pointzm',
     'xyzm',
     'null'
    );
    
    INSERT INTO m_test (geometry) VALUES (
     st_point (2, 3, 32, 5, 4326)
    );
    
    INSERT INTO m_test (geometry) VALUES (
     st_point (4, 5, 20, 4, 4326)
    );
    
    INSERT INTO m_test (geometry) VALUES (
     st_point (3, 8, 23, 7, 4326)
    );
    
    SELECT id, st_m (geometry) 
     AS M_COORD
     FROM m_test; 
    
    id    m_coord
    
    1     5.0
    2     4.0
    3     7.0
    

    In this second example, the measure value is updated for record 3 in the m_test table.

    SELECT st_m (geometry, 7.5)
     FROM m_test
     WHERE id = 3;
    

    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