-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add st_distance_ab and st_intersects_ab query templates #1218
Conversation
I made a few changes here-
Example config here "infoj": [
{
"title": "Test",
"inline": true,
"field": "field",
"query": "st_intersects_ab",
"queryparams": {
"qID": true,
"id": true,
"table": true,
"geom": true,
"field_b": "field",
"as": "field",
"table_b": "schema.table",
"geom_b": "geom_4326"
},
"run": true
},
{
"title": "Distance to X",
"inline": true,
"field": "dist",
"query": "st_distance_ab",
"queryparams": {
"qID": true,
"id": true,
"table": true,
"geom": true,
"table_b": "schema.table",
"geom_b": "geom_p_4326"
},
"run": true
},
{
"display": true,
"label": "Location Table",
"type": "dataview",
"target": "location",
"query": "st_distance_ab_multiple",
"queryparams": {
"qID": true,
"id": true,
"table": true,
"geom": true,
"as": "field",
"field_b": "field_name",
"limit": 10,
"table_b": "schema.table",
"geom_b": "geom_p_4326"
},
"table": {
"layout": "fitColumns",
"columns": [
{
"field": "store_name",
"title": "Name"
},
{
"field": "dist",
"title": "Distance"
}
]
}
}
] |
@simon-leech The changes do not work. I highly recommend against using the geom lookup. Not all tables have a geom field. Some layer may use a geoms object. In this case it will be impossible to geom: true, and geom:"whatever" would also be recognised as geom: true. In both cases this will mean crunch for the query. Additionally the cognitive load of the queryParams method is pushed over the limit by adding the geom true flag. Using geom: string does have none of these problems. |
Quality Gate passedIssues Measures |
Good point @dbauszus-glx - I have removed "geom": true and just using "geom": string is all working :) |
Default queries for location field lookup based on the locations geometry.
The entry.nullValue can be used to assign a value if the query does not return a response.
This should make the query_fields plugin redundant.