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

Why do we need geojson type? #3341

Closed
domoritz opened this issue Feb 1, 2018 · 3 comments
Closed

Why do we need geojson type? #3341

domoritz opened this issue Feb 1, 2018 · 3 comments
Labels
Area - Map RFC / Discussion 💬 For discussing proposed changes
Milestone

Comments

@domoritz
Copy link
Member

domoritz commented Feb 1, 2018

We only use the type geojson for shapes. However, we don't need it if we join a dataset into an existing geojson.

We can reverse the geo repeat example

{
  "$schema": "https://vega.github.io/schema/vega-lite/v2.1.json",
  "description": "the population per state, engineers per state, and hurricanes per state",
  "repeat": {"row": ["population", "engineers", "hurricanes"]},
  "resolve": {
    "scale": {
      "color": "independent"
    }
  },
  "spec": {
    "width": 500,
    "height": 300,
    "data": {
      "url": "data/us-10m.json",
      "format": {
        "type": "topojson",
        "feature": "states"
      }
    },
    "transform": [
      {
        "lookup": "id",
        "from": {
          "data": {
            "url": "data/population_engineers_hurricanes.csv"
          },
          "key": "id",
          "fields": ["population", "engineers", "hurricanes"]
        }
      }
    ],
    "projection": {"type": "albersUsa"},
    "mark": "geoshape",
    "encoding": {
      "color": {
        "field": {"repeat": "row"},
        "type": "quantitative"
      }
    }
  }
}

I understand that it sometimes may make sense to do this the other way around. For instance, if data is missing or you want to run an aggregation. However, how important are these cases? Do we have one or two compelling use cases?

@domoritz domoritz added RFC / Discussion 💬 For discussing proposed changes Geo labels Feb 1, 2018
@kanitw
Copy link
Member

kanitw commented Feb 5, 2018

We also discussed that geoshape may be a better name that we might consider changing later.

@kanitw kanitw added this to the 2.x Map Patches milestone Feb 10, 2018
@kanitw kanitw removed the Geo label Apr 27, 2018
@iliatimofeev
Copy link

This might be related to current topic vega/vega#1319 .

"format": {
      "type": "geojson",
      "feature": "features", // like topojson or jpath 
      "properties": "foreign" // default value "nested"
}

Suggestion is to support GeoJSON format directly, see @mattijn motivation in vega issue.

@kanitw
Copy link
Member

kanitw commented Jun 30, 2018

I think that we won't change this.

Note that the format type discussion is different from the field type here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area - Map RFC / Discussion 💬 For discussing proposed changes
Projects
None yet
Development

No branches or pull requests

3 participants