shortbread-docs icon indicating copy to clipboard operation
shortbread-docs copied to clipboard

Clarify details in boundary layer

Open joto opened this issue 1 year ago • 4 comments

There are several issues with the documentation of the boundaries layer:

  1. admin_level property is defined as numeric. I believe this should be clarified as unsigned integer (see also #31)
  2. The feature table allows only admin_level 2 or 4. But in the description of the disputed property it says "unset or between 2 and 4". Is it on purpose that level 3 is allowed here? That unset is allowed here?
  3. The definition for the "disputed" property is hard to parse and with several ands and ors without braces, it is ambigous.
  4. We should probably explain more clearly that processing for the boundaries layer has to look at both the tags of the ways and the relations and how they interact, especially for the disputed case.

joto avatar Mar 14 '24 08:03 joto

I'm not sure it's possible to control the precise output type on all generation systems and someone may not have a choice between int, uint, and sint. If it comes to it I can just produce non-compliant tiles as any use-case won't depend on what the message type is.

Aside: The most efficient way to represent integers that could be negative is probably to pick the type based on the individual value, using uint for positive and sint for negative.

pnorman avatar Mar 15 '24 02:03 pnorman

I think there are two separate issues with the numbers:

  1. What is the "natural data type" for this property, ie. the narrowest "usual" datatype that can store all values of this property. In this case this is "unsigned integer", but the definition is somewhat fuzzy, we could also say "a 4 bit unsigned integer is enough for this". But this is what we have to decide first.
  2. The next question is what detailed encoding to use specifically for vector tiles. This is informed by (1) and also the tools that exist etc.

joto avatar Mar 15 '24 10:03 joto

I think for 1 this is really a case of we should be defining the allowable values. So admin_level is an integer between 2 and 8, layer is an integer between -5 and 5, etc.

pnorman avatar Mar 18 '24 00:03 pnorman

planetilers' impl of this currently does ignore any admin_level not in [ 2, 4 ].

For the disputed case, I am therefore ignoring admin_level not in [ 2, 4 ] or unset, as we would not output this.

For the bracketing, I am implementing this like

Boundary line is either

Unsure if this is correct

CommanderStorm avatar Mar 23 '25 12:03 CommanderStorm