Skip to content
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

[GEOT-6494] MBStyle extension #2743

Merged
merged 11 commits into from
Feb 13, 2020
Prev Previous commit
Next Next commit
Formatting clean up
Signed-off-by: Jody Garnett <jody.garnett@gmail.com>
  • Loading branch information
jodygarnett committed Feb 8, 2020
commit edfa57a6c55bc7f0266e5312c43549cfe47adbb8
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,8 @@ public JSONObject paint() {
/**
* Transforms a given {@link MBLayer} to a GeoTools {@link FeatureTypeStyle}.
*
* @param styleContext The MBStyle to which this layer belongs, used to resolving sprite and glyph names to full urls.
* @param styleContext The MBStyle to which this layer belongs, used to resolving sprite and
* glyph names to full urls.
* @param minScaleDenominator Used to determine zoom level restrictions for generated rules
* @param maxScaleDenominator Used to determine zoom level restrictions for generated rules
* @return A feature type style from the provided layer, or null if the visibility of that layer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,6 @@ public Justification getTextJustify() {
* evaluates to one of "left", "right", or "center".
*
* @see #getTextJustify()
*
* @return Expression of text justification
*/
public Expression textJustify() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,55 +32,58 @@

/**
* MBFilter json wrapper, allowing conversion to a GeoTools Filter.
* <p>
* This wrapper class is used by {@link MBObjectParser} to generate rule filters when transforming
* MBStyle.
* </p>
* <p>
* This wrapper and {@link MBFunction} are a matched set handling dynamic data.
* </p>
*
* <p>This wrapper class is used by {@link MBObjectParser} to generate rule filters when
* transforming MBStyle.
*
* <p>This wrapper and {@link MBFunction} are a matched set handling dynamic data.
*
* <h2>About MapBox Filter</h2>
* <p>
* A filter selects specific features from a layer. A filter is an array of one of the following
*
* <p>A filter selects specific features from a layer. A filter is an array of one of the following
* forms:
* </p>
* <p>
* Existential Filters
* </p>
*
* <p>Existential Filters
*
* <ul>
* <li><code>["has", key]</code> - feature[key] exists</li>
* <li><code>["!has", key]</code> - feature[key] does not exist</li>
* <li><code>["has", key]</code> - feature[key] exists
* <li><code>["!has", key]</code> - feature[key] does not exist
* </ul>
* <p>
* Comparison Filters:
* </p>
*
* <p>Comparison Filters:
*
* <ul>
* <li>["==", key, value] equality: feature[key] = value</li>
* <li>["!=", key, value] inequality: feature[key] ≠ value</li>
* <li>["&gt;", key, value] greater than: feature[key] &gt; value</li>
* <li>["&gt;=", key, value] greater than or equal: feature[key] ≥ value</li>
* <li>["&lt;", key, value] less than: feature[key] &lt; value</li>
* <li>["&lt;=", key, value] less than or equal: feature[key] ≤ value</li>
* <li>["==", key, value] equality: feature[key] = value
* <li>["!=", key, value] inequality: feature[key] ≠ value
* <li>["&gt;", key, value] greater than: feature[key] &gt; value
* <li>["&gt;=", key, value] greater than or equal: feature[key] ≥ value
* <li>["&lt;", key, value] less than: feature[key] &lt; value
* <li>["&lt;=", key, value] less than or equal: feature[key] ≤ value
* </ul>
* <p>
* Set Memmbership Filters:</p>
*
* <p>Set Memmbership Filters:
*
* <ul>
* <li>["in", key, v0, ..., vn] set inclusion: feature[key] ∈ {v0, ..., vn}</li>
* <li>["!in", key, v0, ..., vn] set exclusion: feature[key] ∉ {v0, ..., vn}</li>
* <li>["in", key, v0, ..., vn] set inclusion: feature[key] ∈ {v0, ..., vn}
* <li>["!in", key, v0, ..., vn] set exclusion: feature[key] ∉ {v0, ..., vn}
* </ul>
* <p>
* Combining Filters:</p>
*
* <p>Combining Filters:
*
* <ul>
* <li>["all", f0, ..., fn] logical AND: f0 ∧ ... ∧ fn</li>
* <li>["any", f0, ..., fn] logical OR: f0 ∨ ... ∨ fn</li>
* <li>["none", f0, ..., fn] logical NOR: ¬f0 ∧ ... ∧ ¬fn</li>
* <li>["all", f0, ..., fn] logical AND: f0 ∧ ... ∧ fn
* <li>["any", f0, ..., fn] logical OR: f0 ∨ ... ∨ fn
* <li>["none", f0, ..., fn] logical NOR: ¬f0 ∧ ... ∧ ¬fn
* </ul>
* <p>
* A key must be a string that identifies a feature property, or one of the following special keys:</p>
*
* <p>A key must be a string that identifies a feature property, or one of the following special
* keys:
*
* <ul>
* <li>"$type": the feature type. This key may be used with the "==", "!=", "in", and "!in" operators. Possible values are "Point", "LineString", and "Polygon".</li>
* <li>"$id": the feature identifier. This key may be used with the "==", "!=", "has", "!has", "in", and "!in" operators.</li>
* <li>"$type": the feature type. This key may be used with the "==", "!=", "in", and "!in"
* operators. Possible values are "Point", "LineString", and "Polygon".
* <li>"$id": the feature identifier. This key may be used with the "==", "!=", "has", "!has",
* "in", and "!in" operators.
* </ul>
*
* @see Filter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public MediaMBSource(JSONObject json, MBObjectParser parser) {
* [-80.425, 37.936]
* ]
* </code>
*
* @return Array of [longitude, latitude] pairs for the image corners listed in clockwise order
*/
public List<Point2D.Double> getCoordinates() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ public void testParseIntervalFunctionColour() throws IOException, ParseException
contains(10.0, "#00FF00"),
contains(30.0, "#FF8800"))));
}
/** Verify that an interval function for number can be parsed.
/**
* Verify that an interval function for number can be parsed.
*
* @throws ParseException for malformed json
* @throws IOException problem reading json
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ public void stringIntervalFunctionTest() throws Exception {

/**
* Tests that a MapBox exponential zoom function (outputting a numeric value) correctly
* interpolates values for zoom levels between stops. Tests exponential base == 1 and != 1.
* interpolates values for zoom levels between stops. Tests exponential base == 1 and != 1.
*
* @throws Exception
*/
Expand Down