• Postgres geometry type operation error in CrudRepository custom sql que

    From chatzich@gmail.com@21:1/5 to All on Sat Mar 28 02:53:11 2020
    I have two WGS 84 points p1(lonul, latul) the up left point and p2(lonbr, latbr) the bottom right point and I want to see which cylinder is intersecting with the rectangle which is defined by these to so I made the following query to a CrudRepository:


    CREATE TABLE protected_area
    (
    id serial not null primary key,
    constraint_id integer not null,
    radius float not null,
    height float not null,
    coordinates path not null,
    gtype geometrytype not null,
    name varchar(50),
    );


    @Query("SELECT u FROM ProtectedArea u WHERE u.gtype='Cylinder' AND polygon( box(point(:lonul - (180/pi()) * (u.radius/(6378137*cos(pi()*:lonul/180))), :latul - (180/pi()) * (u.radius/6378137)), point(:lonbr + (180/pi()) * (u.radius/(6378137*cos(pi()*:
    lonbr/180))),:latbr + (180/pi()) * (u.radius/6378137)))) @> polygon(coordinates)")

    it seems that the operator @> which indicates if the geometry is contained to another

    but I am taking this error

    Caused by: org.hibernate.QueryException: unexpected char: '@' [SELECT
    u FROM ProtectedArea u WHERE u.gtype='Cylinder' AND polygon(
    box(point(:lonul - (180/pi()) *
    (u.radius/(6378137*cos(pi()*:lonul/180))), :latul - (180/pi()) * (u.radius/6378137)), point(:lonbr + (180/pi()) * (u.radius/(6378137*cos(pi()*:lonbr/180))),:latbr + (180/pi()) * (u.radius/6378137)))) @> polygon(coordinates)]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)