cancel
Showing results for 
Search instead for 
Did you mean: 

Entering simple Spatial data

Former Member
1,905

Latest version of SQL Anywhere

I need to enter some simple polygon data into the database where I can run queries to see if a point is inside or outside of the polygon. I can see in the examples doing a select for this but the data is contained in the select statement itself. So how do you get into the database a series of points that define the polygon? I will have between 3 and 10 points. For example.

(0 0, 100 0, 200 100, 300 500 , 400 500, 0 0)

Thanks TPS

Accepted Solutions (0)

Answers (1)

Answers (1)

VolkerBarth
Contributor

Cf. that help topic:

How to create geometries

E.g. you could use one of the ST_Polygon constructors, such as:

insert MyTable (MyGeometryColumn)
select new ST_Polygon('Polygon ((0 0, 100 0, 200 100, 300 500 , 400 500, 0 0))', MySRID)