MySQL Forums
Forum List  »  GIS

Multi-dimensional data in SPACIAL types
Posted by: John Nahlen
Date: May 08, 2012 11:24PM

Hi guys,

I am wanting to create a schema that stores a chessboard. Seeing how a chessboard is somewhat like a grid or table (a two-dimensional object), I thought that we could use each point on the grid to store the piece value, and then index the values at each specific point in the 8x8 grid.

Basically the X-axis would represent ranks 1-8 in chess and the Y-axis would represent files A-H in chess.

This is not a valid query, but I thought maybe something like this might be what I wanted:

# board[0][0] would represent A8, board[7][7] would represent H1, etc
# there would be 13 possible values: K Q R B N P k q r b n p -
SELECT * FROM mytable WHERE board[0][0] = 'r';

So I was wondering if anyone had any ideas they could share. From what I can see, the GEOMETRY type might be my best bet, but I spent a bit of time on Google and found no examples of its use.

Thanks,

- John

Options: ReplyQuote


Subject
Views
Written By
Posted
Multi-dimensional data in SPACIAL types
4265
May 08, 2012 11:24PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.