-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use TileCoordinates instead of LngLats for
within
calculation (#9428)
* Using TileCoordinates instead of LngLat for within calculation * Update tests * Adapt test data * Add render tests
- Loading branch information
Showing
15 changed files
with
1,583 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
test/integration/expression-tests/within/line-within-polygons/test.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
{ | ||
"expression": ["within", { | ||
"type": "MultiPolygon", | ||
"coordinates": [[[[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]], | ||
[[[0, 0], [-3, 0], [-3, -3], [0, -3], [0, 0]]]] | ||
}], | ||
"inputs": [[{ | ||
"zoom": 3, | ||
"canonicalID": { | ||
"z": 3, | ||
"x": 3, | ||
"y": 3 | ||
} | ||
}, { | ||
"geometry": { | ||
"type": "LineString", | ||
"coordinates": [[3, 3], [4, 1]] | ||
} | ||
}], [{ | ||
"zoom": 3, | ||
"canonicalID": { | ||
"z": 3, | ||
"x": 3, | ||
"y": 3 | ||
} | ||
}, { | ||
"geometry": { | ||
"type": "LineString", | ||
"coordinates": [[3, 3], [-2, -2]] | ||
} | ||
}], [{ | ||
"zoom": 3, | ||
"canonicalID": { | ||
"z": 3, | ||
"x": 3, | ||
"y": 3 | ||
} | ||
}, { | ||
"geometry": { | ||
"type": "LineString", | ||
"coordinates": [[0, 0], [2, 2]] | ||
} | ||
}], [{ | ||
"zoom": 3, | ||
"canonicalID": { | ||
"z": 3, | ||
"x": 3, | ||
"y": 3 | ||
} | ||
}, { | ||
"geometry": { | ||
"type": "LineString", | ||
"coordinates": [[1, 3], [-2, -2]] | ||
} | ||
}], [{ | ||
"zoom": 3, | ||
"canonicalID": { | ||
"z": 3, | ||
"x": 3, | ||
"y": 3 | ||
} | ||
}, { | ||
"geometry": { | ||
"type": "LineString", | ||
"coordinates": [[-1, -1], [-2, -2]] | ||
} | ||
}]], | ||
"expected": { | ||
"compiled": { | ||
"type": "boolean", | ||
"isFeatureConstant": false, | ||
"isZoomConstant": true, | ||
"result": "success" | ||
}, | ||
"outputs": [true, false, false, false, true], | ||
"serialized": ["within", { | ||
"coordinates": [[[[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]], [[[0, 0], [-3, 0], [-3, -3], [0, -3], [0, 0]]]], | ||
"type": "MultiPolygon" | ||
}] | ||
} | ||
} |
Oops, something went wrong.