MySQL Forums
Forum List  »  GIS

The Polygong must contain the internal ring?
Posted by: lee light
Date: January 16, 2007 04:16AM

I can run the following code to create a polygon with one internal ring.
CREATE TABLE geom (g GEOMETRY);

SET @g = 'POLYGON((0 0,10 0,10 10,0 10,0 0),(5 5,7 5,7 7,5 7, 5 5))';

INSERT INTO geom VALUES (GeomFromText(@g));

But, if I want to create only one polygon without any internal ring, it failed:
SET @g = 'POLYGON(0 0,10 0,10 10,0 10,0 0)';
INSERT INTO geom VALUES (GeomFromText(@g));

I met such error:
MySQL said:

#1416 - Cannot get geometry object from data you send to the GEOMETRY field

How could I create a polygon without internal ring? I dont use linestring because the polygon will be filled with color later.
Thank you for your replay!

Options: ReplyQuote


Subject
Views
Written By
Posted
The Polygong must contain the internal ring?
4140
January 16, 2007 04:16AM


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.