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

asked 20 Sep '16, 09:48

TPS's gravatar image

TPS
196121320
accept rate: 0%


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)
permanent link

answered 20 Sep '16, 10:19

Volker%20Barth's gravatar image

Volker Barth
30.8k308456665
accept rate: 32%

edited 20 Sep '16, 10:20

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×21

question asked: 20 Sep '16, 09:48

question was seen: 355 times

last updated: 20 Sep '16, 10:20