Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter returns empty result (possible issue with SRID) #15

Open
andilabs opened this issue Jun 25, 2020 · 1 comment
Open

filter returns empty result (possible issue with SRID) #15

andilabs opened this issue Jun 25, 2020 · 1 comment

Comments

@andilabs
Copy link

andilabs commented Jun 25, 2020

image

the postgraphile query:

query findNearby($point: GeoJSON) {
      allApiDjtinderusers (
        filter: {
          lastLocation: { equals: $point }
        }) {
        nodes {
          id
          lastLocation {
        		geojson
        		srid
        		y
        		x
      		}
        }
      }
    }

the variable:

{
  "point": {
    "type":"Point",
    "coordinates":[20.9800552409116,52.2724808126503],
    "crs": {"type": "name", "properties": {"name": "EPSG:4326"}}

  }
}

the result:

{
  "data": {
    "allApiDjtinderusers": {
      "nodes": []
    }
  }
}

There exist record with given 20.9800552409116,52.2724808126503 coordinates, so I would expect getting it in result of equals query.

Additional info for reference:

the postgres table:

postgres=# \d api_djtinderuser+
                                         Table "public.api_djtinderuser"
      Column       |          Type          | Collation | Nullable |                   Default
-------------------+------------------------+-----------+----------+----------------------------------------------
 id                | integer                |           | not null | nextval('api_djtinderuser_id_seq'::regclass)
 last_location     | geometry(Point,4326)   |           |          |

Indexes:
    "api_djtinderuser_pkey" PRIMARY KEY, btree (id)
    "api_djtinderuser_last_location_id" gist (last_location)

PG version:

postgres=# SELECT version();
                                                             version
----------------------------------------------------------------------------------------------------------------------------------
 PostgreSQL 11.2 (Debian 11.2-1.pgdg90+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit
(1 row)

POSTGIS version:

postgres=# \dx
                                     List of installed extensions
  Name   | Version |   Schema   |                             Description
---------+---------+------------+---------------------------------------------------------------------
 plpgsql | 1.0     | pg_catalog | PL/pgSQL procedural language
 postgis | 2.5.2   | public     | PostGIS geometry, geography, and raster spatial types and functions
(2 rows)

graphile

inside the graphql container I installed following npm packages:

RUN npm install -g postgraphile
RUN npm install -g @graphile/postgis
RUN npm install -g postgraphile-plugin-connection-filter
RUN npm install -g postgraphile-plugin-connection-filter-postgis
@gqians
Copy link

gqians commented Sep 15, 2020

2020-09-15 11-34-41 的屏幕截图
I first created a point, and then used equals query, got the correct result @andilabs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants