Author Topic: InventoryGenerator errors with bounding box for location  (Read 13562 times)

sklepac

  • Newbie
  • *
  • Posts: 7
    • View Profile
InventoryGenerator errors with bounding box for location
« on: March 29, 2023, 03:43:25 PM »
Apologies for similar consecutive posts, but it may be easier to handle one issue at a time.

When defining a bounding box with coordinates for the location in InventoryGenerator, I am getting JSONDecodeError. Input and output are attached.

Thank you!

bacetiner

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: InventoryGenerator errors with bounding box for location
« Reply #1 on: March 29, 2023, 07:41:04 PM »
Thank you for using the SimCenter Forum!

I believe you are getting this error because of the way your bounding box input is defined. For bounding box entries, BRAILS expects the location parameter defined as a tuple in the format location=(lon1,lat1,lon2,lat2). Here the longitude and latitude values are the coordinates of the opposite vertices of a rectangular bounding box (at the moment, BRAILS only takes rectangular bounding box input).

For instance, one can get a random set of 100 buildings contained in the West Los Angeles bounding shown in the attachment by defining the bounding box based on the coordinates of its top left vertex (-118.4546,34.0111) and bottom right vertex (-118.3866,34.0436) via the syntax:

invGenerator = InventoryGenerator(location=(-118.4546,34.0111,-118.3866,34.0436),
                                  nbldgs=100, randomSelection=True,
                                  GoogleAPIKey="YOUR-API-KEY")

I hope this helps! Please let me know if you run into any other issues.

sklepac

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: InventoryGenerator errors with bounding box for location
« Reply #2 on: March 30, 2023, 02:31:18 PM »
Thank you for the quick response. This solved the problem.