Top 5 Recent Articles
ARTICLES CATEGORIES
- Algorithms (22)
- All (399)
- Biography (1)
- Blog (44)
- Business Requirements (1)
- Commentary (1)
- Conversion (2)
- Customers (2)
- Data Models (1)
- Education (2)
- GeoRaptor (13)
- GPS (1)
- Image Processing (2)
- Import Export (8)
- Licensing (2)
- LiDAR (1)
- Linear Referencing (4)
- Manifold GIS (3)
- Mapping (1)
- MySQL Spatial (7)
- Networking and Routing (including Optimization) (5)
- Open Source (18)
- Oracle Spatial and Locator (194)
- Partitioning (1)
- PostGIS (36)
- Projections (1)
- Published Articles (1)
- qGIS (1)
- Recommendations (1)
- Services (1)
- Software Change Log (1)
- Source Code (37)
- Space Curves (9)
- Spatial Database Functions (109)
- Spatial DB comparison (1)
- Spatial XML Processing (11)
- SQL Server Spatial (92)
- Standards (3)
- Stored Procedure (17)
- Tessellation or Gridding (10)
- Tools (2)
- Topological Relationships (1)
- Training (2)
- Triangulation (2)
ST_Translate (ie move)
ST_Translate is a member function of T_GEOMETRY which translates the underlying geometry to a new location.
Function Specification.
Member Function ST_Translate (p_tx in number, p_ty in number, p_tz in number default null ) Return &&INSTALL_SCHEMA..T_GEOMETRY deterministic
Description.
The ST_Translate Member Function translates the underlying geometry to a new location by applying the translation values (deltas) to its ordinates.
The function MOVES the geometry to a new location.
Parameters.
p_tx (number) - Translation factor for X ordinates. p_ty (number) - Translation factor for Y ordinates. p_tz (number) - Translation factor for Z ordinates (if null, the Z ordinate is not changed).
Result.
The function translates the supplied geometry using supplied ordinate values (deltas).
Notes.
The function is a wrapper over mdsys.SDO_UTIL.AffineTransforms.
The corresponding function in SQL Server Spatial is STMove and in MySQL Spatial, ST_Move.
Example.
With testGeom as ( select T_GEOMETRY(mdsys.sdo_geometry(2002,NULL,NULL,SDO_ELEM_INFO_ARRAY(1,2,1),SDO_ORDINATE_ARRAY(2,2,2,4,8,4,12,4,12,10,8,10,5,14)),0.005,2,1) as tgeom from dual Union All select T_GEOMETRY(mdsys.sdo_geometry(3002,NULL,NULL,SDO_ELEM_INFO_ARRAY(1,2,1),SDO_ORDINATE_ARRAY(2,2,1, 2,4,2, 8,4,3, 12,4,4, 12,10,5, 8,10,6, 5,14,7)),0.005,2,1) as tgeom from dual ) select a.tgeom.ST_CoordDimension() as coordDimension, 'ST_Translate(p_tx,p_ty,p_tz)' as TranslateTest, a.tgeom.ST_Translate(p_tx=>10.0,p_ty=>10.0,p_tz=>case when a.tgeom.ST_CoordDimension()=2 then null else 5.0 end).geom as geom from testGeom a; COORDDIMENSION TRANSLATETEST GEOM -------------- ---------------------------- -------------------------------------------------------------------------------------------------------------------------------------- 2 ST_Translate(p_tx,p_ty,p_tz) SDO_GEOMETRY(2002,NULL,NULL,SDO_ELEM_INFO_ARRAY(1,2,1),SDO_ORDINATE_ARRAY(12,12,12,14,18,14,22,14,22,20,18,20,15,24)) 3 ST_Translate(p_tx,p_ty,p_tz) SDO_GEOMETRY(3002,NULL,NULL,SDO_ELEM_INFO_ARRAY(1,2,1),SDO_ORDINATE_ARRAY(12,12,6,12,14,7,18,14,8,22,14,9,22,20,10,18,20,11,15,24,12))
Documentation
- MySQL Spatial General Functions
- Oracle LRS Objects
- Oracle Spatial Exporter (Java + pl/SQL)
- Oracle Spatial Object Functions
- Oracle Spatial Object Functions (Multi Page)
- PostGIS pl/pgSQL Functions
- SC4O Oracle Java Topology Suite (Java + pl/SQL)
- SQL Server Spatial General TSQL Functions
- SQL Server Spatial LRS TSQL Functions