MySQL 5.1 リファレンスマニュアル :: 16 Spatial Extensions :: 16.4 Creating a Spatially Enabled MySQL Database :: 16.4.5 Fetching Spatial Data
« 16.4.4 Populating Spatial Columns

16.5 Analyzing Spatial Information »
Section Navigation      [Toggle]
  • 16.4 Creating a Spatially Enabled MySQL Database
  • 16.4.1 MySQL Spatial Data Types
  • 16.4.2 Creating Spatial Values
  • 16.4.3 Creating Spatial Columns
  • 16.4.4 Populating Spatial Columns
  • 16.4.5 Fetching Spatial Data

16.4.5. Fetching Spatial Data

Geometry values stored in a table can be fetched in internal format. You can also convert them into WKT or WKB format.

  • Fetching spatial data in internal format:

    Fetching geometry values using internal format can be useful in table-to-table transfers:

    CREATE TABLE geom2 (g GEOMETRY) SELECT g FROM geom;
    
  • Fetching spatial data in WKT format:

    The AsText() function converts a geometry from internal format into a WKT string.

    SELECT AsText(g) FROM geom;
    
  • Fetching spatial data in WKB format:

    The AsBinary() function converts a geometry from internal format into a BLOB containing the WKB value.

    SELECT AsBinary(g) FROM geom;
    
Copyright © 1997, 2010, Oracle and/or its affiliates. All rights reserved. Legal Notices
Top / Previous / Next / Up / Table of Contents
© 2010, Oracle Corporation and/or its affiliates