XC (TQL): Difference between revisions

From Tygron Support wiki
Jump to navigation Jump to search
Line 16: Line 16:
[ {
[ {
   "id" : 0,  "name" : "Upper Left",   
   "id" : 0,  "name" : "Upper Left",   
   "polygons" : {    "type" : "MultiPolygon",    "coordinates" : [ [ [ [ 110.0, -110.00000000586321 ], [ 110.0, -100.00000000525047 ], [ 100.0, -100.00000000525047 ], [ 100.0, -110.00000000586321 ], [ 110.0, -110.00000000586321 ] ] ] ]  }
   "polygons" : {    "type" : "MultiPolygon",    "coordinates" : [ [ [ [ 110.0, -110.0 ], [ 110.0, -100.0 ], [ 100.0, -100.0 ], [ 100.0, -110.0 ], [ 110.0, -110.0 ] ] ] ]  }
   }, {
   }, {
   "id" : 1,  "name" : "Upper Right",   
   "id" : 1,  "name" : "Upper Right",   
   "polygons" : {    "type" : "MultiPolygon",    "coordinates" : [ [ [ [ 435.0, -95.00000000482756 ], [ 425.0, -95.00000000482756 ], [ 425.0, -105.00000000583275 ], [ 435.0, -105.00000000583275 ], [ 435.0, -95.00000000482756 ] ] ] ]  }
   "polygons" : {    "type" : "MultiPolygon",    "coordinates" : [ [ [ [ 435.0, -95.0 ], [ 425.0, -95.0 ], [ 425.0, -105.0 ], [ 435.0, -105.0 ], [ 435.0, -95.0 ] ] ] ]  }
   }, {   
   }, {   
   "id" : 2,  "name" : "Lower Left",   
   "id" : 2,  "name" : "Lower Left",   
   "polygons" : {    "type" : "MultiPolygon",    "coordinates" : [ [ [ [ 165.0, -425.0000003154156 ], [ 165.0, -415.00000029384995 ], [ 155.0, -415.00000029384995 ], [ 155.0, -425.0000003154156 ], [ 165.0, -425.0000003154156 ] ] ] ]  }
   "polygons" : {    "type" : "MultiPolygon",    "coordinates" : [ [ [ [ 165.0, -425.0 ], [ 165.0, -415.0 ], [ 155.0, -415.0 ], [ 155.0, -425.0 ], [ 165.0, -425.0 ] ] ] ]  }
   }, {   
   }, {   
   "id" : 3,  "name" : "Lower Right",   
   "id" : 3,  "name" : "Lower Right",   
   "polygons" : {    "type" : "MultiPolygon",    "coordinates" : [ [ [ [ 315.0, -395.0000002524572 ], [ 325.0, -395.0000002524572 ], [ 325.0, -385.0000002340957 ], [ 315.0, -385.0000002340957 ], [ 315.0, -395.0000002524572 ] ] ] ]  }
   "polygons" : {    "type" : "MultiPolygon",    "coordinates" : [ [ [ [ 315.0, -395.0 ], [ 325.0, -395.0 ], [ 325.0, -385.0 ], [ 315.0, -385.0 ], [ 315.0, -395.0 ] ] ] ]  }
} ]
} ]
</pre>
</pre>

Revision as of 09:50, 19 May 2026

Instead of specifying a clause parameter with a particular Item ID, it is possible to use the 'XC' characters for its value. The result of using 'XC' for the clause value, is the automatic creation of multiple TQL statements, one with each Item ID for that Clause Parameter, but only the Items that are covered by the calculated Search Polygon of the TQL statement. The Search Polygon is calculated by overlapping the clause polygon. Per clause type it is indicated if it limits the 'Search Polygon'. Internally, the resulting TQL statements are placed in a single array; Similarly the result will be an array of TQL results.

Example

Consider the following (simplified) Neighborhood data of a project:

[ {
  "id" : 0,  "name" : "East Side",
  "polygons" : { "type" : "MultiPolygon", "coordinates" : [ [ [ [ 250.0, -500.0 ], [ 500.0, -500.0 ], [ 500.0, 0.0 ], [ 250.0, 0.0 ], [ 250.0, -500.0 ] ] ] ]  }
}, {
  "id" : 1,  "name" : "West Side",
  "polygons" : {  "type" : "MultiPolygon", "coordinates" : [ [ [ [ 0.0, -500.0 ], [ 250.0, -500.0 ], [ 250.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, -500.0 ] ] ] ]  }
} ]

and the Area data:

[ {
  "id" : 0,  "name" : "Upper Left",  
  "polygons" : {    "type" : "MultiPolygon",    "coordinates" : [ [ [ [ 110.0, -110.0 ], [ 110.0, -100.0 ], [ 100.0, -100.0 ], [ 100.0, -110.0 ], [ 110.0, -110.0 ] ] ] ]  }
  }, {
  "id" : 1,  "name" : "Upper Right",  
  "polygons" : {    "type" : "MultiPolygon",    "coordinates" : [ [ [ [ 435.0, -95.0 ], [ 425.0, -95.0 ], [ 425.0, -105.0 ], [ 435.0, -105.0 ], [ 435.0, -95.0 ] ] ] ]  }
  }, {  
  "id" : 2,  "name" : "Lower Left",  
  "polygons" : {    "type" : "MultiPolygon",    "coordinates" : [ [ [ [ 165.0, -425.0 ], [ 165.0, -415.0 ], [ 155.0, -415.0 ], [ 155.0, -425.0 ], [ 165.0, -425.0 ] ] ] ]  }
  }, {  
  "id" : 3,  "name" : "Lower Right",  
  "polygons" : {    "type" : "MultiPolygon",    "coordinates" : [ [ [ [ 315.0, -395.0 ], [ 325.0, -395.0 ], [ 325.0, -385.0 ], [ 315.0, -385.0 ], [ 315.0, -395.0 ] ] ] ]  }
} ]

The TQL statement

SELECT_NAME_WHERE_NEIGHBORHOOD_IS_X

is internally replaced with a list of TQL statements, separated by comma's,

SELECT_NAME_WHERE_NEIGHBORHOOD_IS_0, SELECT_NAME_WHERE_NEIGHBORHOOD_IS_1, SELECT_NAME_WHERE_NEIGHBORHOOD_IS_2, SELECT_NAME_WHERE_NEIGHBORHOOD_IS_3, SELECT_NAME_WHERE_NEIGHBORHOOD_IS_4

Its result will be a list of names, separated by comma's, for example:

"De Manege", "De Lancaster", "De Landstreken", "De Kruidentuin",  "Golfresidentie"

Clause Parameters

The X value can be used in the following TQL Clause parameters: