0

我正在尝试使用此数据集来确定地址(传递给 API 调用)属于哪个区域边界。

端点返回每个区或议会的对象数组。多边形位于“the_geom”属性中,具有 2 个属性 - 类型和坐标。我曾尝试使用 $where,但出现错误。

[
{
    "comments": "Inaugurated 2015-06-22",
    "council": "1",
    "councilper": "Scott Griggs",
    "district": "1",
    "objectid": "1",
    "shape_area": "343352603.892",
    "shape_leng": "88541.3042539",
    "the_geom": {
        "type": "MultiPolygon",
        "coordinates": [
            [
                [
                    [
                        -96.80995700065864,
                        32.77138899977414
                    ],
                    [
                        -96.80969800043205,
                        32.77121999997131
                    ],
                    [ ...

我尝试使用下面的查询,但它给了我一个错误:

https://www.dallasopendata.com/resource/h9ws-fqcn.json?$where=within_polygon(the_geom,  'MULTIPOLYGON (((-96.800270, 32.779091)))')

这是页面参考页面 - https://www.dallasopendata.com/Geography-Boundaries/Adopted-Council-Districts/6dcw-hhpj

这是端点- https://www.dallasopendata.com/resource/dgxr-hmze.json

任何帮助将不胜感激。

4

1 回答 1

0

我怀疑你是突然进入我们 IRC 频道的开发人员,但我也会在这里回答!

你离这里很近!您在这里要做的是使用intersects(...)带有 Well Known Text (WKT) 的 SoQL 函数POINT

这是一个适用于您的用例的示例:

https://www.dallasopendata.com/resource/h9ws-fqcn.json?$where=intersects(the_geom,%20%27POINT%20(-96.7994007%2032.775765)%27)
于 2017-10-30T21:36:02.113 回答