Closed dbauszus-glx closed 2 months ago
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.
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code
@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.
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.