Skip to content

Feature Request: GeoJson LineString Type #2316

@allen-munsch

Description

@allen-munsch
  • What version of Dgraph are you using?

Dgraph version : v1.0.4
Commit SHA-1 : aad5907
Commit timestamp : 2018-03-09 17:37:44 +1100
Branch : HEAD

  • Have you tried reproducing the issue with latest release?

whatever was on master as of a few hours ago

  • What is the hardware spec (RAM, OS)?
system_profiler SPHardwareDataType | grep "  Memory:"

      Memory: 16 GB

sw_vers

    ProductName:        Mac OS X
    ProductVersion: 10.13.3
    BuildVersion:   17D47
  • Steps to reproduce the issue (command/config used to run Dgraph).

Load geojson:

find ../json/*json | xargs -IHMM bash -c 'filename=`basename -- "HMM"`; go run dgraph/cmd/dgraph-converter/main.go --geo ../json/$filename --out ../rdf_gz/"${filename%.*}".rdf.gz'

find ../rdf_gz | xargs -I{} bash -c 'dgraph live -r {}'

Unable to query featues type "LineString" coordinates :

curl -s http://127.0.0.1:8080/query -X POST -d $'q(func: near(loc, [ -93.962679,44.320331], 100) ) {\n    from_name,\n  }' | python -m json.tool
  • Expected behaviour and actual result.

approximate behaviour :

{
    "data": {
        "q": [
            {
                "circuit": "1",
                "from_name": "XXX",
                "loc": {
                    "coordinates": [
                        [
                            -93.962679,
                            44.320331
                        ],
                        [
                            -93.962679,
                            44.320331
                        ]
                    ],
                    "type": "LineString"
                },
                "status": "Closed",
                "to_name": "YYY"
            }
        ]
    },
    "extensions": {
        "server_latency": {
            "encoding_ns": 784000,
            "parsing_ns": 35000,
            "processing_ns": 4496000
        },
        "txn": {
            "lin_read": {
                "ids": {
                    "1": 455
                }
            },
            "start_ts": 464
        }
    }
}

actual result:

{
    "data": {
        "q": []
    },
    "extensions": {
        "server_latency": {
            "encoding_ns": 412000,
            "parsing_ns": 11000,
            "processing_ns": 107000
        },
        "txn": {
            "lin_read": {
                "ids": {
                    "1": 456
                }
            },
            "start_ts": 478
        }
    }
}

Related:

New to go, but wondering what it would take to do a near query on the points of a LineString.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/querylang/geoIssues related to geolocation.kind/featureSomething completely new we should consider.priority/P2Somehow important but would not block a release.status/acceptedWe accept to investigate/work on it.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions