Hi, I cant seem to figure out how to use the geometric shapes in postgres: my query goes like this: select lat, lon from toperation where point'(lat,lon)' @ polygon'((50, 0),(70,10),(80,50),(50,80),(50,0))' This should fetch all values of lat and lon contained by the polygon, but I dont see how I can fetch the lat and lon values,I just get errors whatever I do. Can anyone help me on this? Thanx, regards Jonas:)) -- Jonas F Henriksen Institute of Marine Research Norway
"Henriksen, Jonas F" <jonas.f.henriksen@imr.no> writes:
> select lat, lon from toperation
> where point'(lat,lon)' @ polygon'((50, 0),(70,10),(80,50),(50,80),(50,0))'
I think you're confusing the syntax for point literal constants with the
constructor function that makes a point value from two float8 values.
You probably want something more like
select lat, lon from toperation
where point(lat,lon) @ polygon '((50, 0),(70,10),(80,50),(50,80),(50,0))'
regards, tom lane
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера