I created a spacial class OPoint and I created some points
create property Tag.coor EMBEDDED Opoint
update Tag set coor = ST_GeomFromText(WKT)
insert into Tag set name=‘tag01’, coor= {"@class": "OPoint","coordinates" : [1,1]}
insert into Tag set name=‘tag02’, coor= {"@class": "OPoint","coordinates" : [2,2]}
insert into Tag set name=‘tag03’, coor= {"@class": "OPoint","coordinates" : [3,3]}
insert into Tag set name=‘tag04’, coor= {"@class": "OPoint","coordinates" : [4,4]}
I want to make a polygon request which returns all the points in the polygon: something like
SELECT FROM tag WHERE polygon (0 0, 0 2, 2 2, 2 0, 0 0)
expected result:
tag01 (1 1)
tag02 (2 2)
Take a look to spatial functions., especially http://orientdb.com/docs/last/Spatial-Index.html#stwithin
The showed example fit your use case, I guess