Skip to content
GuidesBlogPlaygroundDashboard

Create a new dataset (admin only)

datasets.create(**kwargs) -> Dataset { id, inserted_at, name, 6 more }
POST/api/v1/datasets

Create a new dataset (admin only)

ParametersExpand Collapse
name: String

Human-readable dataset name

slug: String

URL-friendly identifier (lowercase, hyphens, no spaces)

attribution: String

Required attribution text

description: String

Dataset description

license: String

License identifier (e.g. CC-BY-4.0)

source_url: String

Source data URL

formaturi
ReturnsExpand Collapse
class Dataset { id, inserted_at, name, 6 more }

Metadata for a custom dataset. Datasets contain user-uploaded geospatial features separate from the OSM data.

id: String

Dataset UUID

formatuuid
inserted_at: Time

Creation timestamp (UTC)

formatdate-time
name: String

Human-readable dataset name

slug: String

URL-friendly identifier

updated_at: Time

Last update timestamp (UTC)

formatdate-time
attribution: String

Required attribution text

description: String

Dataset description

license: String

License identifier (e.g. CC-BY-4.0)

source_url: String

URL of the original data source

formaturi

Create a new dataset (admin only)

require "plaza"

plaza = Plaza::Client.new(
  api_key: "My API Key",
  environment: "local" # defaults to "production"
)

dataset = plaza.datasets.create(name: "NYC Bike Lanes", slug: "nyc-bike-lanes")

puts(dataset)
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "inserted_at": "2019-12-27T18:11:19.117Z",
  "name": "NYC Bike Lanes",
  "slug": "nyc-bike-lanes",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "attribution": "attribution",
  "description": "description",
  "license": "license",
  "source_url": "https://example.com"
}
Returns Examples
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "inserted_at": "2019-12-27T18:11:19.117Z",
  "name": "NYC Bike Lanes",
  "slug": "nyc-bike-lanes",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "attribution": "attribution",
  "description": "description",
  "license": "license",
  "source_url": "https://example.com"
}