Knowledge Drop

What is the property key with respect to TopoJSON?

  • 5 April 2021
  • 0 replies
  • 211 views

Userlevel 5

Last tested: Jan 21, 2019
 

When using TopoJSON to create a custom map layer or region, you may need to specify a property_key field. Note that the property_key is not required, but if it exists it will look like:

map_layer: my_map_layer {
file: "map.topojson"
property_key: "NAME"
}

Within a TopoJSON file, the corresponding field will look like this:



{"arcs":[[[4710]],[[[4712]]...,"type":"MultiPolygon",

"properties":"AREA":0,"POP2005":0,

"REGION":0,"NAME":"Taiwan","LON":120.946,"LAT":23.754}

...

 

Where "REGION", "NAME", "LON", "LAT" are all available property_key fields. The property_key parameter chooses which key to map to. If not called out, Looker will automatically map to a property key.

Note: The property_key field is CASE SENSITIVE! You could have a custom map layer set up and referenced correctly, but the map may display blank if the property_key is case mismatched.

This example below will not work with the "NAME" key in the TopoJSON example above.

map_layer: my_map_layer {

file: "map.topojson"

property_key: "name"

}

 

This content is subject to limited support.                

 

 


0 replies

Be the first to reply!

Reply