-1

I am trying to load .ndjson files from Google Cloud to Processing 3.4 so that I can select one of the file from the cloud and use it.

This is the code I tried:

import cbl.quickdraw.*;
JSONObject json;
QuickDraw qd;
void setup() {
  json = loadJSONObject("https://console.cloud.google.com/storage/browser/quickdraw_dataset/full/simplified/"); 
  qd = new QuickDraw(this, json.getString("brain"));
}

void draw() {
  qd.create(width/2, height/2, width/2, height/2);
}

and got an error as json object text must begin with {.

Kevin Workman
  • 41,537
  • 9
  • 68
  • 107
Ganesh Bhat
  • 246
  • 4
  • 19
  • 1
    Kevin is right. Additionally I recommend downloading the files to your computer first as they're quite large in filesize and (re)loading them each time you run the sketch will be slow – George Profenza Jan 23 '19 at 21:02

1 Answers1

1

The URL you're using is a full website, not a JSON file.

Visit https://console.cloud.google.com/storage/browser/quickdraw_dataset/full/simplified/ in your web browser to see what I mean. The page lists many JSON files. You need to choose one.

You need to find a URL that points to a specific JSON file. For example, the first JSON file on that page is at URL https://storage.cloud.google.com/quickdraw_dataset/full/simplified/The%20Eiffel%20Tower.ndjson

Kevin Workman
  • 41,537
  • 9
  • 68
  • 107