TransWikia.com

Accessing x and y coordinates of a POLYGON in MySQL

Geographic Information Systems Asked by StillaBeginner on March 31, 2021

In my database. I have a spatial column called coordinates which is of datatype POLYGON. so for example. The lunch room has coordinates POLYGON(0 2, 1 2, 3 2, 5 2, 0 2). That’s just a hypothetical example.

How do I access the individual x and y coordinates for each polygon in the database?

One Answer

This should do it:

select 
t.coordinates.STAsText() 
from your_tablename as t

Answered by DPSSpatial_BoycottingGISSE on March 31, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP