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

No JSON object could be decoded #19

Open
c0neNZ opened this issue Aug 9, 2016 · 3 comments
Open

No JSON object could be decoded #19

c0neNZ opened this issue Aug 9, 2016 · 3 comments

Comments

@c0neNZ
Copy link

c0neNZ commented Aug 9, 2016

Hi,

Im relatively new to this. Created an account just so I could comment here. Have done a couple of different intro type python courses online before but I'm not a coder.

Anywho... Install seemed to work fine, most of the reqs were already installed from using other mapping tools.

After editing the config.json with my details, I tried running the html but couldn't see my work area. Thought I'd run the check.py anyway and this is the error I get:

error

I wasn't sure if I had screwed up the config.json somehow, but I tried copying another user's and also with the default (that comes the download, with just examples in place of real data) and I get the same error.

If anyone can point out where I'm going wrong, would be hugely appreciated.

PS - Really like where you are going with this app!

@moriakaice
Copy link

The default config.json won't work, as it's not correct a correct JSON file.

Just make sure what you have in "work" is an array of arrays of 4 numbers.

Like:

    "work":[
        [51.540341, -0.096817, 51.509689, -0.033302]
    ],

@c0neNZ
Copy link
Author

c0neNZ commented Aug 10, 2016

I did say in my first post "After editing the config.json with my details..."???

Here is my config, just in case I'm still doing something really stupid:

{ "auth_service": "ptc", "users":[ {"username": "xxx1", "password": "pw1"}, {"username": "xxx2", "password": "pw2"} ], "work":[ [-41.280204,174.772504, -41.300125,174.787452], ], "stepsPerPassPerWorker": 50, "scanDelay": 10.5 }

As I said, I have tried with my own config, the default config (with no real data) and even another persons config just in case. All three give me the same error : No JSON object could be decoded.

I assume that means the issue isn't actually with my config.json, but as I stated in my first post, I'm not a developer. I am a very enthusiastic learner though and I'm happy to go read and research if necessary, just need someone to point me in the right direction.

Cheers

@moriakaice
Copy link

Hi there,

Again, it's because the JSON file you have is not valid - one extra comma that killed it.

Compare those two. Yours:

{
  "auth_service": "ptc",
  "users": [
    {
      "username": "xxx1",
      "password": "pw1"
    },
    {
      "username": "xxx2",
      "password": "pw2"
    }
  ],
  "work": [
    [
      -41.280204,
      174.772504,
      -41.300125,
      174.787452
    ],
  ],
  "stepsPerPassPerWorker": 50,
  "scanDelay": 10.5
}

and correct one:

{
  "auth_service": "ptc",
  "users": [
    {
      "username": "xxx1",
      "password": "pw1"
    },
    {
      "username": "xxx2",
      "password": "pw2"
    }
  ],
  "work": [
    [
      -41.280204,
      174.772504,
      -41.300125,
      174.787452
    ]
  ],
  "stepsPerPassPerWorker": 50,
  "scanDelay": 10.5
}

and you'll notice the only difference is the extra comma after the array inside the array of work property (in other words: you have ],], while it should be ]]).

To avoid such problems, in case you're unsure if your JSON file is correct or not, you can use services like http://pro.jsonlint.com/ or http://jsoneditoronline.org/ - paste your JSON file there and verify that the editors are happy with it.

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

2 participants