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

Error: coordinates must contain numbers #90

Open
jamaps opened this issue Feb 24, 2021 · 3 comments
Open

Error: coordinates must contain numbers #90

jamaps opened this issue Feb 24, 2021 · 3 comments

Comments

@jamaps
Copy link

jamaps commented Feb 24, 2021

Hi there!

Apologies if this is not the correct place to post this!

I'm getting an error when trying to match points in sharedstreets that I can't figure out. And any help would be much appreciated :)

This is what I'm running.

npm-do shst match test_points.geojson --out=matched_points.geojson

But I'm getting the following error:

 🌏  Loading geojson data...
       Matching using car routing rules on all streets
  ✨  Matching 3 points...
    Error: coordinates must contain numbers

I thought it was just some weird formatting with my geojson (coordinates as strings), but I've tried a few different point Geojson datasets and they all return the same error. Matching line geometries have worked great, I only get this error with points.

e.g. below is a geojson that I've tested

{"type": "FeatureCollection",
    "features": [
      {
        "type": "Feature",
        "properties": {"bearing":90},

        "geometry": {
          "type": "Point",
          "coordinates": [
            -79.494582662656398, 43.689484593933997
          ]
        }
      },
      {
        "type": "Feature",
        "properties": {"bearing":90},
        "geometry": {
          "type": "Point",
          "coordinates": [
            -79.281026293856101, 43.675363068044803
          ]
        }
      },
      {
        "type": "Feature",
        "properties": {"bearing":90},
        "geometry": {
          "type": "Point",
          "coordinates": [
            -79.4073484623935, 43.666125615195597	
          ]
        }
      }
    ]
  }

Thanks!

@ervinanoh
Copy link

Good Morning did you find a solution to your problem? I faced the same and still looking how to solve it!
Thank you!

@aalexsmithh
Copy link

Hi @jamaps

I don't believe that this is an issue with the data you are using. I checked my own data numerous times to ensure the validity and still was running into these issues.

I suspect that this issue was caused by a change to a turf dependency that no longer handles empty geojson objects. I was able to add a null check in the tile creation process so that the Graph object can be created. Please see #94 for details!

I was able to get this work with my data, but we would need @kpwebb to merge some PRs and republish the package so you don't have to build it yourself.

@vishalmhjn
Copy link

Hey @jamaps, you yourself answered your question. Yes, it didn't work for me either. The hack was to convert the point to linestring with two same points. Then it works :)

"type": "LineString",
                "coordinates": [
                    [
                        -3.72085115335525,
                        40.4195518069243
                    ],
                    [
                        -3.72085115335525,
                        40.4195518069243
                    ]
                ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants