dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Get Polygon points

Hybrid View

  1. #1
    Join Date
    Feb 2011
    Posts
    7

    Get Polygon points

    Hi, i have created a table in mysql to store polygon data:

    CREATE TABLE geom (g GEOMETRY);

    And i inserted a polygon into it, using the following syntax:

    INSERT INTO geom (g)
    VALUES(PolygonFromText('POLYGON((
    9.190586853 45.464518970,
    9.190602686 45.463993916,
    9.191572471 45.464001929,
    9.191613325 45.463884676,
    9.192136130 45.463880767,
    9.192111509 45.464095594,
    9.192427961 45.464117804,
    9.192417811 45.464112862,
    9.192509035 45.464225851,
    9.192493139 45.464371079,
    9.192448471 45.464439002,
    9.192387444 45.464477861,
    9.192051402 45.464483037,
    9.192012814 45.464643592,
    9.191640825 45.464647090,
    9.191622331 45.464506215,
    9.190586853 45.464518970))')
    );

    Now how can i get back the vertices (points) of this polygon in mysql? Why i am asking means, later i want to find whether a point is inside a polygon. And to achieve this, i hope i need the polygon vertices.

  2. #2
    Join Date
    Feb 2011
    Posts
    7

    Smile Got it

    Well, i could get a string format of the polygon vertices using:

    SELECT cast(AsText(g) as char) AS points FROM geom

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles