Re: postgresql 13.1: precision of spatial operations

Поиск
Список
Период
Сортировка
От Вадим Самохин
Тема Re: postgresql 13.1: precision of spatial operations
Дата
Msg-id CAGVmuwoN3eH=+6Put7gjsLp=Jn9ofpJmz_63SzS+n+ZLJFTLuw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: postgresql 13.1: precision of spatial operations  (Brad White <b55white@gmail.com>)
Список pgsql-general
ср, 30 нояб. 2022 г., 20:51 Brad White <b55white@gmail.com>:
On 11/30/2022 9:48 AM, Вадим Самохин wrote:

> Thank you so much Ivan, it worked!
Can you give any more detail on which approach you took, for the sake of
future followers?

Sure, I multiplied all points' coordinates by a factor of 10^6.

Here are the steps to demonstrate that the solution Ivan gave worked:

1. create table zones (
    zone_id int,
    zone_polygon polygon,
    description text
);
create index zones__zone_polygon on zones using gist(zone_polygon poly_ops);

2. insert into zones (zone_polygon) values ('(37622012.9,55751936.7),(37621534.4,55753661.6),(37617206.4,55755950.9),(37622012.9,55751936.7)');

3. select count(1) from zones where zone_polygon @> '(37617635,55755814)'::polygon;
 count
-------
     0
(1 row)

В списке pgsql-general по дате отправления:

Предыдущее
От: Amitabh Kant
Дата:
Сообщение: Re: Finding free time period on non-continous tstzrange field values
Следующее
От: Ray O'Donnell
Дата:
Сообщение: Re: posgres question / answer