Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix: altair geo charts: don't use custom transformers and don't enable selection (#2015)

Myles Scolnickdd3ad6db1244
diff --git a/frontend/src/plugins/impl/vega/__tests__/__snapshots__/make-selectable.test.ts.snap b/frontend/src/plugins/impl/vega/__tests__/__snapshots__/make-selectable.test.ts.snap
index 31e386095f..d0cd3fb415 100644
--- a/frontend/src/plugins/impl/vega/__tests__/__snapshots__/make-selectable.test.ts.snap
+++ b/frontend/src/plugins/impl/vega/__tests__/__snapshots__/make-selectable.test.ts.snap
@@ -537,6 +537,27 @@ exports[`makeSelectable > should skip field selection if empty or false 1`] = `
}
`;
+exports[`makeSelectable > should work for geoshape 1`] = `
+{
+ "encoding": {
+ "color": {
+ "datum": "red",
+ "type": "nominal",
+ },
+ "x": {
+ "field": "x",
+ "type": "quantitative",
+ },
+ "y": {
+ "field": "y",
+ "type": "quantitative",
+ },
+ },
+ "mark": "geoshape",
+ "params": [],
+}
+`;
+
exports[`makeSelectable > should work for multi-layered charts 1`] = `
{
"data": {
diff --git a/frontend/src/plugins/impl/vega/__tests__/make-selectable.test.ts b/frontend/src/plugins/impl/vega/__tests__/make-selectable.test.ts
index 4092a928a6..fc263187d1 100644
--- a/frontend/src/plugins/impl/vega/__tests__/make-selectable.test.ts
+++ b/frontend/src/plugins/impl/vega/__tests__/make-selectable.test.ts
@@ -1,7 +1,7 @@
/* Copyright 2024 Marimo. All rights reserved. */
import { expect, describe, it } from "vitest";
import { makeSelectable } from "../make-selectable";
-import { VegaLiteSpec } from "../types";
+import type { VegaLiteSpec } from "../types";
import { getSelectionParamNames } from "../params";
describe("makeSelectable", () => {
@@ -357,4 +357,27 @@ describe("makeSelectable", () => {
"pan_zoom",
]);
});
+
+ it("should work for geoshape", () => {
+ const spec = {
+ mark: "geoshape",
+ encoding: {
+ color: {
+ datum: "red",
+ type: "nominal",
+ },
+ x: {
+ field: "x",
+ type: "quantitative",
+ },
+ y: {
+ field: "y",
+ type: "quantitative",
+ },
+ },
+ } as VegaLiteSpec;
+ const newSpec = makeSelectable(spec, {});
+ expect(newSpec).toMatchSnapshot();
+ expect(getSelectionParamNames(newSpec)).toEqual([]);
+ });
});
diff --git a/frontend/src/plugins/impl/vega/make-selectable.ts b/frontend/src/plugins/impl/vega/make-selectable.ts
index 4e39498f82..919d9eb465 100644
--- a/frontend/src/plugins/impl/vega/make-selectable.ts
+++ b/frontend/src/plugins/impl/vega/make-selectable.ts
@@ -1,5 +1,5 @@
/* Copyright 2024 Marimo. All rights reserved. */
-import {
+import type {
GenericVegaSpec,
Mark,
SelectionType,
@@ -101,6 +101,10 @@ function makeLegendSelectable(
/**
* Given a spec, add the necessary parameters to make the chart selectable.
+ *
+ * Not supported marks:
+ * - geoshape
+ * - text
*/
function makeChartSelectable(
spec: VegaLiteUnitSpec,
@@ -123,8 +127,8 @@ function makeChartSelectable(
return spec;
}
- // We don't do anything if the mark is text
- if (mark === "text") {
+ // We don't do anything if the mark is text or geoshape
+ if (mark === "geoshape" || mark === "text") {
return spec;
}
@@ -149,7 +153,25 @@ function makeChartSelectable(
} as VegaLiteUnitSpec;
}
+/**
+ * Given a spec, add the necessary parameters to make the chart pan/zoomable.
+ *
+ * Not supported marks:
+ * - geoshape
+ */
function makeChartPanZoom(spec: VegaLiteUnitSpec): VegaLiteUnitSpec {
+ let mark: Mark | undefined;
+ try {
+ mark = Marks.getMarkType(spec.mark);
+ } catch {
+ // noop
+ }
+
+ // We don't do anything if the mark is geoshape
+ if (mark === "geoshape") {
+ return spec;
+ }
+
const params = spec.params || [];
const alreadyHasScalesParam = params.some((param) => param.bind === "scales");
@@ -165,6 +187,9 @@ function makeChartPanZoom(spec: VegaLiteUnitSpec): VegaLiteUnitSpec {
/**
* Makes a chart clickable and adds an opacity encoding to the chart.
+ *
+ * Not supported marks:
+ * - text
*/
function makeChartInteractive<T extends GenericVegaSpec>(spec: T): T {
const prevEncodings = "encoding" in spec ? spec.encoding : undefined;
@@ -176,6 +201,7 @@ function makeChartInteractive<T extends GenericVegaSpec>(spec: T): T {
}
const mark = Marks.getMarkType(spec.mark);
+
// We don't do anything if the mark is text
if (mark === "text") {
return spec;
diff --git a/marimo/_dependencies/dependencies.py b/marimo/_dependencies/dependencies.py
index 80c1328b4a..f50b60766d 100644
--- a/marimo/_dependencies/dependencies.py
+++ b/marimo/_dependencies/dependencies.py
@@ -3,14 +3,11 @@ from __future__ import annotations
import importlib.metadata
import importlib.util
+import sys
from dataclasses import dataclass
from packaging import version
-from marimo import _loggers
-
-LOGGER = _loggers.marimo_logger()
-
@dataclass
class Dependency:
@@ -120,14 +117,14 @@ def _version_check(
msg = f"Mismatched version of {pkg}: expected >={min_v}, got {v}"
if raise_error:
raise RuntimeError(msg)
- LOGGER.warning(f"{msg}. Some features may not work correctly.")
+ sys.stderr.write(f"{msg}. Some features may not work correctly.")
return False
if parsed_max_version is not None and parsed_v >= parsed_max_version:
msg = f"Mismatched version of {pkg}: expected <{max_v}, got {v}"
if raise_error:
raise RuntimeError(msg)
- LOGGER.warning(f"{msg}. Some features may not work correctly.")
+ sys.stderr.write(f"{msg}. Some features may not work correctly.")
return False
return True
diff --git a/marimo/_plugins/ui/_impl/altair_chart.py b/marimo/_plugins/ui/_impl/altair_chart.py
index fbf97dd119..56a376293b 100644
--- a/marimo/_plugins/ui/_impl/altair_chart.py
+++ b/marimo/_plugins/ui/_impl/altair_chart.py
@@ -49,6 +49,18 @@ def _has_binning(spec: VegaSpec) -> bool:
return False
+def _has_geoshape(spec: VegaSpec) -> bool:
+ """Return True if the spec has geoshape."""
+ if "mark" not in spec:
+ return False
+ type_or_dict = spec.get("mark", {})
+ if isinstance(type_or_dict, str):
+ return type_or_dict == "geoshape"
+
+ mark_type: str | None = type_or_dict.get("type")
+ return mark_type == "geoshape"
+
+
def _filter_dataframe(
df: pd.DataFrame, selection: ChartSelection
) -> pd.DataFrame:
@@ -127,6 +139,13 @@ def _parse_spec(spec: altair.TopLevelMixin) -> VegaSpec:
# instead of using a vega-lite spec
if altair.data_transformers.active == "vegafusion":
return spec.to_dict(format="vega") # type: ignore
+
+ # If this is a geoshape, use default transformer
+ # since ours does not support geoshapes
+ if _has_geoshape(spec.to_dict()):
+ with altair.data_transformers.enable("default"):
+ return spec.to_dict() # type: ignore
+
with altair.data_transformers.enable("marimo"):
return spec.to_dict() # type: ignore
@@ -259,6 +278,14 @@ class altair_chart(UIElement[ChartSelection, "pd.DataFrame"]):
)
chart_selection = False
legend_selection = False
+ if _has_geoshape(vega_spec) and (has_chart_selection):
+ sys.stderr.write(
+ "Geoshapes + chart selection is not yet supported in "
+ "marimo.ui.chart.\n"
+ "If you'd like this feature, please file an issue: "
+ "https://github.com/marimo-team/marimo/issues\n"
+ )
+ chart_selection = False
self.dataframe = self._get_dataframe_from_chart(chart)
diff --git a/marimo/_plugins/ui/_impl/charts/altair_transformer.py b/marimo/_plugins/ui/_impl/charts/altair_transformer.py
index 0c23d847ff..784bdd6f9b 100644
--- a/marimo/_plugins/ui/_impl/charts/altair_transformer.py
+++ b/marimo/_plugins/ui/_impl/charts/altair_transformer.py
@@ -2,20 +2,27 @@
from __future__ import annotations
import base64
-import json
from typing import TYPE_CHECKING, Any, Dict, Literal, TypedDict, Union
import marimo._output.data.data as mo_data
+from marimo._dependencies.dependencies import DependencyManager
from marimo._output.utils import build_data_url
from marimo._plugins.ui._impl.tables.utils import (
get_table_manager,
+ get_table_manager_or_none,
)
if TYPE_CHECKING:
+ import narwhals as nw # type: ignore[import-not-found,import-untyped,unused-ignore] # noqa: E501
import pandas as pd
+ import polars as pl
-Data = Union[Dict[Any, Any], "pd.DataFrame"]
-_DataType = Union[Dict[Any, Any], "pd.DataFrame"]
+Data = Union[
+ Dict[Any, Any], "pd.DataFrame", "pl.DataFrame", "nw.DataFrame[Any]"
+]
+_DataType = Union[
+ Dict[Any, Any], "pd.DataFrame", "pl.DataFrame", "nw.DataFrame[Any]"
+]
class _JsonFormatDict(TypedDict):
@@ -79,19 +86,33 @@ def _data_to_json_string(data: _DataType) -> str:
import pandas as pd
if isinstance(data, pd.DataFrame):
- sanitized = alt.utils.sanitize_dataframe(data)
+ if "sanitize_pandas_dataframe" in dir(alt.utils):
+ sanitized = alt.utils.sanitize_pandas_dataframe(data)
+ elif "sanitize_dataframe" in dir(alt.utils):
+ sanitized = alt.utils.sanitize_dataframe(data)
+ else:
+ raise NotImplementedError(
+ "No sanitize_pandas_dataframe or "
+ "sanitize_dataframe in altair.utils."
+ )
as_str = sanitized.to_json(orient="records", double_precision=15)
assert isinstance(as_str, str)
return as_str
- elif isinstance(data, dict):
- if "values" not in data:
- raise KeyError("values expected in data dict, but not present.")
- return json.dumps(data["values"], sort_keys=True)
- else:
- raise NotImplementedError(
- "to_marimo_json only works with data expressed as a DataFrame "
- + " or as a dict"
- )
+
+ if DependencyManager.narwhals.has():
+ import narwhals # type: ignore[import-not-found,import-untyped,unused-ignore] # noqa: E501
+
+ if isinstance(data, narwhals.DataFrame):
+ return _data_to_json_string(narwhals.to_native(data))
+
+ tm = get_table_manager_or_none(data)
+ if tm:
+ return tm.to_json().decode("utf-8")
+
+ raise NotImplementedError(
+ "to_marimo_json only works with data expressed as a DataFrame "
+ + " or as a dict. Got %s" % type(data)
+ )
def _data_to_csv_string(data: _DataType) -> str:
diff --git a/marimo/_smoke_tests/altair/altair_brush.py b/marimo/_smoke_tests/altair/altair_brush.py
index 58d5688a6b..351849c836 100644
--- a/marimo/_smoke_tests/altair/altair_brush.py
+++ b/marimo/_smoke_tests/altair/altair_brush.py
@@ -1,13 +1,14 @@
# Copyright 2024 Marimo. All rights reserved.
+
import marimo
-__generated_with = "0.7.5"
+__generated_with = "0.7.20"
app = marimo.App(width="medium")
@app.cell
def __(mo):
- mo.md(r"## Data")
+ mo.md(r"""## Data""")
return
@@ -33,7 +34,7 @@ def __():
@app.cell
def __(mo):
- mo.md(r"## Plain Altair")
+ mo.md(r"""## Plain Altair""")
return
@@ -61,7 +62,7 @@ def __(alt, traces):
@app.cell
def __(mo):
- mo.md(r"## Example of the Or ( | ) operator")
+ mo.md(r"""## Example of the Or ( | ) operator""")
return
@@ -91,7 +92,7 @@ def __(alt, mo, traces):
@app.cell
def __(mo):
- mo.md(r"## Example of the Or ( | ) operator with selection")
+ mo.md(r"""## Example of the Or ( | ) operator with selection""")
return
diff --git a/marimo/_smoke_tests/altair/altair_charts.py b/marimo/_smoke_tests/altair/altair_charts.py
index 36634606b2..b556d3f919 100644
--- a/marimo/_smoke_tests/altair/altair_charts.py
+++ b/marimo/_smoke_tests/altair/altair_charts.py
@@ -2,7 +2,7 @@
import marimo
-__generated_with = "0.7.9"
+__generated_with = "0.7.20"
app = marimo.App(width="full")
@@ -80,7 +80,7 @@ def __(alt, cars, chart_selection_value, legend_selection_value, mo):
@app.cell
def __(mo):
- mo.md("# Basic Chart")
+ mo.md("""# Basic Chart""")
return
@@ -135,7 +135,7 @@ def __(alt, chart_selection_value, employment, legend_selection_value, mo):
@app.cell
def __(mo):
- mo.md("# Another Chart")
+ mo.md("""# Another Chart""")
return
@@ -147,7 +147,7 @@ def __(chart2, mo):
@app.cell
def __(mo):
- mo.md("# Defined Width + Height")
+ mo.md("""# Defined Width + Height""")
return
@@ -203,7 +203,7 @@ def __(alt, chart_selection_value, iris, legend_selection_value, mo):
@app.cell
def __(mo):
- mo.md("# Chart + Chart")
+ mo.md("""# Chart + Chart""")
return
@@ -215,7 +215,7 @@ def __(chart3, mo):
@app.cell
def __(mo):
- mo.md("# Chart + Table")
+ mo.md("""# Chart + Table""")
return
@@ -227,7 +227,7 @@ def __(chart3, mo):
@app.cell
def __(mo):
- mo.md("# Chart + Table returned as an array")
+ mo.md("""# Chart + Table returned as an array""")
return
@@ -267,7 +267,7 @@ def __(alt, cars, chart_selection_value, legend_selection_value, mo):
@app.cell
def __(mo):
- mo.md("# Chart with transform")
+ mo.md("""# Chart with transform""")
return
@@ -279,7 +279,7 @@ def __(chart4, mo):
@app.cell
def __(mo):
- mo.md("# Bar chart")
+ mo.md("""# Bar chart""")
return
@@ -331,7 +331,7 @@ def __(hist, mo):
@app.cell
def __(mo):
- mo.md("# Pivot and horizontal bar chart")
+ mo.md("""# Pivot and horizontal bar chart""")
return
@@ -417,7 +417,7 @@ def __(mo, pie):
@app.cell
def __(mo):
- mo.md("# Line Chart")
+ mo.md("""# Line Chart""")
return
@@ -442,7 +442,7 @@ def __(line_chart, mo):
@app.cell
def __(mo):
- mo.md("# Multi-Line Chart")
+ mo.md("""# Multi-Line Chart""")
return
@@ -548,7 +548,7 @@ def __(mo, with_transform):
@app.cell
def __(mo):
- mo.md("# Layers")
+ mo.md("""# Layers""")
return
@@ -598,7 +598,7 @@ def __(layered_chart, mo):
@app.cell
def __(mo):
- mo.md(r"# layered")
+ mo.md(r"""# layered""")
return
@@ -621,7 +621,7 @@ def __(alt, data, datum, mo):
@app.cell
def __(mo):
- mo.md(r"# hconcat")
+ mo.md(r"""# hconcat""")
return
@@ -633,7 +633,7 @@ def __(base, mo):
@app.cell
def __(mo):
- mo.md("# vconcat")
+ mo.md("""# vconcat""")
return
diff --git a/marimo/_smoke_tests/altair/altair_geoshape.py b/marimo/_smoke_tests/altair/altair_geoshape.py
new file mode 100644
index 0000000000..3e9407513e
--- /dev/null
+++ b/marimo/_smoke_tests/altair/altair_geoshape.py
@@ -0,0 +1,68 @@
+# Copyright 2024 Marimo. All rights reserved.
+import marimo
+
+__generated_with = "0.7.20"
+app = marimo.App(width="medium")
+
+
+def __():
+ import marimo as mo
+ return mo,
+
+
+def __():
+ import altair as alt
+ from vega_datasets import data
+ import geopandas as gpd
+
+ url = "https://naciscdn.org/naturalearth/110m/cultural/ne_110m_admin_0_countries.zip"
+ gdf_ne = gpd.read_file(url) # zipped shapefile
+ gdf_ne = gdf_ne[["NAME", "CONTINENT", "POP_EST", "geometry"]]
+ return alt, data, gdf_ne, gpd, url
+
+
+def __(gdf_ne):
+ gdf_sel = gdf_ne.query("CONTINENT == 'Africa'")
+ return gdf_sel,
+
+
+def __(alt, gdf_sel):
+ chart = (
+ alt.Chart(gdf_sel)
+ .mark_geoshape(stroke="white", strokeWidth=1.5)
+ .encode(fill="NAME:N")
+ )
+ return chart,
+
+
+def __(chart):
+ chart
+ return
+
+
+def __(chart, mo):
+ mo_chart = mo.ui.altair_chart(chart)
+ mo_chart
+ return mo_chart,
+
+
+def __(mo, mo_chart):
+ mo.ui.table(mo_chart.value)
+ return
+
+
+def __(chart, mo):
+ mo.ui.altair_chart(chart, chart_selection=None)
+ return
+
+
+if __name__ == "__main__":
+ app.run()
diff --git a/pyproject.toml b/pyproject.toml
index c24159964d..78a78557b3 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -125,9 +125,10 @@ testcore = [
testoptional = [
# For testing mo.ui.chart, table, ...
- "altair>=5.0.0",
+ "altair>=5.4.0",
"pandas>=1.3.0",
"pandas-stubs>=1.3.0",
+ "geopandas~=0.13.0",
"pyarrow>=15.0.2,<16",
"pyarrow-stubs>=10",
"pillow~=10.2.0",
diff --git a/tests/_plugins/ui/_impl/charts/test_altair_transformers.py b/tests/_plugins/ui/_impl/charts/test_altair_transformers.py
new file mode 100644
index 0000000000..d719073595
--- /dev/null
+++ b/tests/_plugins/ui/_impl/charts/test_altair_transformers.py
@@ -0,0 +1,102 @@
+from __future__ import annotations
+
+import json
+from typing import TYPE_CHECKING
+from unittest.mock import MagicMock, patch
+
+import pytest
+
+from marimo._dependencies.dependencies import DependencyManager
+from marimo._plugins.ui._impl.charts.altair_transformer import (
+ _data_to_csv_string,
+ _data_to_json_string,
+ _to_marimo_csv,
+ _to_marimo_inline_csv,
+ _to_marimo_json,
+ register_transformers,
+)
+
+if TYPE_CHECKING:
+ import pandas as pd
+
+HAS_DEPS = DependencyManager.pandas.has() and DependencyManager.altair.has()
+
+
+def get_data() -> pd.DataFrame:
+ import pandas as pd
+
+ return pd.DataFrame({"A": [1, 2, 3], "B": ["a", "b", "c"]})
+
+
[email protected](not HAS_DEPS, reason="optional dependencies not installed")
+def test_to_marimo_json():
+ sample_data = get_data()
+ result = _to_marimo_json(sample_data)
+
+ assert isinstance(result, dict)
+ assert "url" in result
+ assert "format" in result
+ assert result["format"] == {"type": "json"}
+
+
[email protected](not HAS_DEPS, reason="optional dependencies not installed")
+def test_to_marimo_csv():
+ sample_data = get_data()
+ result = _to_marimo_csv(sample_data)
+
+ assert isinstance(result, dict)
+ assert "url" in result
+ assert "format" in result
+ assert result["format"] == {"type": "csv"}
+
+
[email protected](not HAS_DEPS, reason="optional dependencies not installed")
+def test_to_marimo_inline_csv():
+ sample_data = get_data()
+ result = _to_marimo_inline_csv(sample_data)
+
+ assert isinstance(result, dict)
+ assert "url" in result
+ assert result["url"].startswith("data:text/csv;base64,")
+ assert "format" in result
+ assert result["format"] == {"type": "csv"}
+
+
[email protected](not HAS_DEPS, reason="optional dependencies not installed")
+def test_data_to_json_string():
+ sample_data = get_data()
+ result = _data_to_json_string(sample_data)
+
+ assert isinstance(result, str)
+ parsed = json.loads(result)
+ assert len(parsed) == 3
+ assert all(set(item.keys()) == {"A", "B"} for item in parsed)
+
+
[email protected](not HAS_DEPS, reason="optional dependencies not installed")
+def test_data_to_csv_string():
+ sample_data = get_data()
+ result = _data_to_csv_string(sample_data)
+
+ assert isinstance(result, str)
+ lines = result.strip().split("\n")
+ assert len(lines) == 4 # header + 3 data rows
+ assert lines[0] == "A,B" or lines[0] == "A,B\r"
+
+
+@patch("altair.data_transformers")
[email protected](not HAS_DEPS, reason="optional dependencies not installed")
+def test_register_transformers(mock_data_transformers: MagicMock):
+ register_transformers()
+
+ assert mock_data_transformers.register.call_count == 4
+ mock_data_transformers.register.assert_any_call("marimo", _to_marimo_csv)
+ mock_data_transformers.register.assert_any_call(
+ "marimo_inline_csv", _to_marimo_inline_csv
+ )
+ mock_data_transformers.register.assert_any_call(
+ "marimo_json", _to_marimo_json
+ )
+ mock_data_transformers.register.assert_any_call(
+ "marimo_csv", _to_marimo_csv
+ )
diff --git a/tests/_plugins/ui/_impl/snapshots/parse_spec_geopandas.txt b/tests/_plugins/ui/_impl/snapshots/parse_spec_geopandas.txt
new file mode 100644
index 0000000000..e560f3471b
--- /dev/null
+++ b/tests/_plugins/ui/_impl/snapshots/parse_spec_geopandas.txt
@@ -0,0 +1,3410 @@
+{
+ "config": {
+ "view": {
+ "continuousWidth": 300,
+ "continuousHeight": 300
+ }
+ },
+ "data": {
+ "name": "data-303698c38c444bd1c0ea1c917c5c8185"
+ },
+ "mark": {
+ "type": "geoshape"
+ },
+ "encoding": {
+ "color": {
+ "field": "pop_est",
+ "type": "quantitative"
+ },
+ "shape": {
+ "field": "geometry",
+ "type": "nominal"
+ }
+ },
+ "$schema": "https://vega.github.io/schema/vega-lite/v5.20.1.json",
+ "datasets": {
+ "data-303698c38c444bd1c0ea1c917c5c8185": [
+ {
+ "pop_est": 1397715000.0,
+ "continent": "Asia",
+ "name": "China",
+ "iso_a3": "CHN",
+ "gdp_md_est": 14342903,
+ "type": "Feature",
+ "geometry": {
+ "type": "MultiPolygon",
+ "coordinates": [
+ [
+ [
+ [
+ 109.47520958866365,
+ 18.197700913968575
+ ],
+ [
+ 108.65520796105616,
+ 18.507681993071387
+ ],
+ [
+ 108.62621748254044,
+ 19.367887885001906
+ ],
+ [
+ 109.11905561730804,
+ 19.821038519769345
+ ],
+ [
+ 110.21159874882281,
+ 20.101253973872033
+ ],
+ [
+ 110.78655073450221,
+ 20.077534491450052
+ ],
+ [
+ 111.01005130416458,
+ 19.69592987719072
+ ],
+ [
+ 110.57064660038677,
+ 19.25587921800927
+ ],
+ [
+ 110.33918786015147,
+ 18.678395087147592
+ ],
+ [
+ 109.47520958866365,
+ 18.197700913968575
+ ]
+ ]
+ ],
+ [
+ [
+ [
+ 80.2599902688853,
+ 42.34999929459906
+ ],
+ [
+ 80.1801501809943,
+ 42.92006785742694
+ ],
+ [
+ 80.86620649610126,
+ 43.18036204688101
+ ],
+ [
+ 79.96610639844141,
+ 44.91751699480463
+ ],
+ [
+ 81.9470707539181,
+ 45.31702749285312
+ ],
+ [
+ 82.45892581576906,
+ 45.539649563166506
+ ],
+ [
+ 83.18048383986047,
+ 47.33003123635086
+ ],
+ [
+ 85.16429039911324,
+ 47.0009557155161
+ ],
+ [
+ 85.72048383987067,
+ 47.452969468773105
+ ],
+ [
+ 85.7682328633083,
+ 48.45575063739699
+ ],
+ [
+ 86.59877648310336,
+ 48.549181626980626
+ ],
+ [
+ 87.35997033076265,
+ 49.21498078062912
+ ],
+ [
+ 87.75126427607671,
+ 49.297197984405486
+ ],
+ [
+ 88.01383222855173,
+ 48.599462795600616
+ ],
+ [
+ 88.85429772334676,
+ 48.069081732772965
+ ],
+ [
+ 90.28082563676392,
+ 47.69354909930793
+ ],
+ [
+ 90.97080936072501,
+ 46.88814606382293
+ ],
+ [
+ 90.58576826371828,
+ 45.71971609148753
+ ],
+ [
+ 90.9455395853343,
+ 45.28607330991028
+ ],
+ [
+ 92.13389082231822,
+ 45.11507599545646
+ ],
+ [
+ 93.4807336771413,
+ 44.975472113619965
+ ],
+ [
+ 94.68892866412533,
+ 44.35233185482842
+ ],
+ [
+ 95.30687544147153,
+ 44.24133087826547
+ ],
+ [
+ 95.76245486855669,
+ 43.319449164394605
+ ],
+ [
+ 96.34939578652781,
+ 42.725635280928685
+ ],
+ [
+ 97.45175744017801,
+ 42.74888967546002
+ ],
+ [
+ 99.51581749878004,
+ 42.524691473961724
+ ],
+ [
+ 100.84586551310827,
+ 42.66380442969145
+ ],
+ [
+ 101.83304039917994,
+ 42.51487295182628
+ ],
+ [
+ 103.31227827353482,
+ 41.9074681666676
+ ],
+ [
+ 104.52228193564899,
+ 41.908346666016556
+ ],
+ [
+ 104.96499393109347,
+ 41.59740957291635
+ ],
+ [
+ 106.12931562706169,
+ 42.13432770442891
+ ],
+ [
+ 107.74477257693795,
+ 42.48151581478187
+ ],
+ [
+ 109.24359581913146,
+ 42.5194463160841
+ ],
+ [
+ 110.41210330611528,
+ 42.87123362891103
+ ],
+ [
+ 111.12968224492023,
+ 43.40683401140015
+ ],
+ [
+ 111.82958784388137,
+ 43.74311839453952
+ ],
+ [
+ 111.66773725794323,
+ 44.07317576758771
+ ],
+ [
+ 111.34837690637946,
+ 44.45744171811009
+ ],
+ [
+ 111.8733061056003,
+ 45.10207937273506
+ ],
+ [
+ 112.43606245325881,
+ 45.01164561622429
+ ],
+ [
+ 113.46390669154417,
+ 44.80889313412712
+ ],
+ [
+ 114.46033165899607,
+ 45.339816799493825
+ ],
+ [
+ 115.98509647020009,
+ 45.727235012386004
+ ],
+ [
+ 116.71786828009886,
+ 46.38820241961521
+ ],
+ [
+ 117.42170128791419,
+ 46.67273285581426
+ ],
+ [
+ 118.87432579963873,
+ 46.80541209572365
+ ],
+ [
+ 119.66326989143876,
+ 46.69267995867892
+ ],
+ [
+ 119.7728239278975,
+ 47.04805878355013
+ ],
+ [
+ 118.86657433479495,
+ 47.74706004494617
+ ],
+ [
+ 118.06414269416672,
+ 48.06673045510369
+ ],
+ [
+ 117.29550744025741,
+ 47.69770905210743
+ ],
+ [
+ 116.30895267137323,
+ 47.85341014260284
+ ],
+ [
+ 115.74283735561579,
+ 47.72654450132629
+ ],
+ [
+ 115.48528201707306,
+ 48.13538259540344
+ ],
+ [
+ 116.19180219936757,
+ 49.134598090199106
+ ],
+ [
+ 116.67880089728612,
+ 49.888531399121405
+ ],
+ [
+ 117.8792444194264,
+ 49.510983384796965
+ ],
+ [
+ 119.2884607280258,
+ 50.142882798862004
+ ],
+ [
+ 119.27939000000003,
+ 50.58292
+ ],
+ [
+ 120.18208000000016,
+ 51.64355000000012
+ ],
+ [
+ 120.7382,
+ 51.96411000000006
+ ],
+ [
+ 120.72578901579197,
+ 52.516226304730935
+ ],
+ [
+ 120.17708865771681,
+ 52.75388621684124
+ ],
+ [
+ 121.00308475147017,
+ 53.25140106873119
+ ],
+ [
+ 122.24574791879283,
+ 53.431725979213695
+ ],
+ [
+ 123.57146999999998,
+ 53.45880000000005
+ ],
+ [
+ 125.06821129771038,
+ 53.16104482686886
+ ],
+ [
+ 125.94634891164617,
+ 52.79279857035698
+ ],
+ [
+ 126.56439904185697,
+ 51.7842554795327
+ ],
+ [
+ 126.93915652883766,
+ 51.35389415140592
+ ],
+ [
+ 127.28745568248485,
+ 50.73979726826548
+ ],
+ [
+ 127.65740000000028,
+ 49.760270000000105
+ ],
+ [
+ 129.39781782442043,
+ 49.44060008401544
+ ],
+ [
+ 130.58229332898242,
+ 48.72968740497614
+ ],
+ [
+ 130.9872600000001,
+ 47.79013000000003
+ ],
+ [
+ 132.50669000000005,
+ 47.78896000000003
+ ],
+ [
+ 133.37359581922794,
+ 48.18344167743487
+ ],
+ [
+ 135.02631147678665,
+ 48.478229885443874
+ ],
+ [
+ 134.50081,
+ 47.57845000000009
+ ],
+ [
+ 134.1123500000001,
+ 47.212480000000085
+ ],
+ [
+ 133.76964399631288,
+ 46.116926988299014
+ ],
+ [
+ 133.09712000000013,
+ 45.14409000000006
+ ],
+ [
+ 131.8834542176595,
+ 45.32116160743652
+ ],
+ [
+ 131.02519000000018,
+ 44.96796000000006
+ ],
+ [
+ 131.28855512911548,
+ 44.11151968034828
+ ],
+ [
+ 131.1446879416149,
+ 42.92998973242689
+ ],
+ [
+ 130.63386640840974,
+ 42.90301463477053
+ ],
+ [
+ 130.63999970690955,
+ 42.39502427522179
+ ],
+ [
+ 129.99426720593323,
+ 42.985386867843786
+ ],
+ [
+ 129.59666873587952,
+ 42.42498179785456
+ ],
+ [
+ 128.0522152039723,
+ 41.99428457291795
+ ],
+ [
+ 128.20843305879066,
+ 41.46677155208249
+ ],
+ [
+ 127.34378299368302,
+ 41.50315176041597
+ ],
+ [
+ 126.86908328664987,
+ 41.81656932226619
+ ],
+ [
+ 126.18204511932943,
+ 41.10733612727637
+ ],
+ [
+ 125.07994184784064,
+ 40.56982371679245
+ ],
+ [
+ 124.26562462778531,
+ 39.928493353834156
+ ],
+ [
+ 122.86757042856095,
+ 39.63778758397622
+ ],
+ [
+ 122.1313879741309,
+ 39.170451768544666
+ ],
+ [
+ 121.05455447803286,
+ 38.897471014962846
+ ],
+ [
+ 121.58599490772248,
+ 39.36085358332407
+ ],
+ [
+ 121.37675703337268,
+ 39.75026133885949
+ ],
+ [
+ 122.16859500538106,
+ 40.422442531896024
+ ],
+ [
+ 121.64035851449353,
+ 40.94638987890333
+ ],
+ [
+ 120.76862877816194,
+ 40.59338816991754
+ ],
+ [
+ 119.63960208544907,
+ 39.898055935214245
+ ],
+ [
+ 119.02346398323306,
+ 39.252333075511146
+ ],
+ [
+ 118.04274865119791,
+ 39.2042739934797
+ ],
+ [
+ 117.53270226447711,
+ 38.73763580988408
+ ],
+ [
+ 118.05969852098964,
+ 38.06147553156106
+ ],
+ [
+ 118.87814985562832,
+ 37.89732534438593
+ ],
+ [
+ 118.91163618375344,
+ 37.44846385349871
+ ],
+ [
+ 119.70280236214205,
+ 37.15638865818505
+ ],
+ [
+ 120.8234574728236,
+ 37.87042776137801
+ ],
+ [
+ 121.711258579598,
+ 37.48112335870718
+ ],
+ [
+ 122.35793745329849,
+ 37.45448415786072
+ ],
+ [
+ 122.5199947449658,
+ 36.93061432550185
+ ],
+ [
+ 121.10416385303307,
+ 36.651329047180425
+ ],
+ [
+ 120.63700890511453,
+ 36.111439520811075
+ ],
+ [
+ 119.66456180224606,
+ 35.60979055433772
+ ],
+ [
+ 119.1512081238586,
+ 34.90985911716044
+ ],
+ [
+ 120.22752485563373,
+ 34.36033193616865
+ ],
+ [
+ 120.62036909391655,
+ 33.37672272392514
+ ],
+ [
+ 121.22901411345023,
+ 32.46031871187719
+ ],
+ [
+ 121.90814578663003,
+ 31.692174384074647
+ ],
+ [
+ 121.89191938689038,
+ 30.949351508095106
+ ],
+ [
+ 121.26425744027328,
+ 30.6762674016487
+ ],
+ [
+ 121.50351932178467,
+ 30.14291494396429
+ ],
+ [
+ 122.0921138855891,
+ 29.83252045340315
+ ],
+ [
+ 121.93842817595306,
+ 29.01802236583478
+ ],
+ [
+ 121.68443851123851,
+ 28.225512600206617
+ ],
+ [
+ 121.12566124886649,
+ 28.135673122667185
+ ],
+ [
+ 120.39547326058232,
+ 27.05320689544932
+ ],
+ [
+ 119.5854968608395,
+ 25.740780544532612
+ ],
+ [
+ 118.65687137255452,
+ 24.54739085540024
+ ],
+ [
+ 117.28160647997088,
+ 23.624501451099658
+ ],
+ [
+ 115.89073530483512,
+ 22.78287323657807
+ ],
+ [
+ 114.76382734584624,
+ 22.668074042241667
+ ],
+ [
+ 114.15254682826564,
+ 22.22376007739615
+ ],
+ [
+ 113.80677981980074,
+ 22.5483397486214
+ ],
+ [
+ 113.24107791550159,
+ 22.051367499270455
+ ],
+ [
+ 111.84359215703248,
+ 21.550493679281473
+ ],
+ [
+ 110.78546552942407,
+ 21.397143866455338
+ ],
+ [
+ 110.44403934127168,
+ 20.34103261970633
+ ],
+ [
+ 109.88986128137361,
+ 20.282457383703488
+ ],
+ [
+ 109.62765506392466,
+ 21.008227037026703
+ ],
+ [
+ 109.86448815311832,
+ 21.395050970947523
+ ],
+ [
+ 108.5228129415244,
+ 21.715212307211814
+ ],
+ [
+ 108.05018029178294,
+ 21.55237986906012
+ ],
+ [
+ 107.04342003787264,
+ 21.811898912029914
+ ],
+ [
+ 106.56727339073532,
+ 22.21820486092477
+ ],
+ [
+ 106.72540327354847,
+ 22.79426788989842
+ ],
+ [
+ 105.81124718630522,
+ 22.976892401617903
+ ],
+ [
+ 105.32920942588663,
+ 23.352063300056912
+ ],
+ [
+ 104.47685835166448,
+ 22.819150092046968
+ ],
+ [
+ 103.50451460166056,
+ 22.70375661873921
+ ],
+ [
+ 102.7069922221001,
+ 22.708795070887675
+ ],
+ [
+ 102.17043582561358,
+ 22.464753119389304
+ ],
+ [
+ 101.65201785686152,
+ 22.318198757409547
+ ],
+ [
+ 101.80311974488293,
+ 21.17436676684507
+ ],
+ [
+ 101.27002566935997,
+ 21.201651923095184
+ ],
+ [
+ 101.18000532430754,
+ 21.436572984294028
+ ],
+ [
+ 101.15003299357825,
+ 21.849984442629022
+ ],
+ [
+ 100.41653771362738,
+ 21.558839423096614
+ ],
+ [
+ 99.98348921102149,
+ 21.7429367131364
+ ],
+ [
+ 99.24089887898725,
+ 22.11831431730458
+ ],
+ [
+ 99.5319922220874,
+ 22.94903880461258
+ ],
+ [
+ 98.89874922078278,
+ 23.14272207284253
+ ],
+ [
+ 98.66026248575577,
+ 24.063286037689966
+ ],
+ [
+ 97.60471967976198,
+ 23.897404690033042
+ ],
+ [
+ 97.72460900267914,
+ 25.083637193293
+ ],
+ [
+ 98.67183800658916,
+ 25.918702500913525
+ ],
+ [
+ 98.71209394734451,
+ 26.743535874940267
+ ],
+ [
+ 98.68269005737046,
+ 27.50881216075062
+ ],
+ [
+ 98.2462309102333,
+ 27.74722138112918
+ ],
+ [
+ 97.91198774616944,
+ 28.335945136014345
+ ],
+ [
+ 97.32711388549004,
+ 28.26158274994634
+ ],
+ [
+ 96.24883344928779,
+ 28.411030992134442
+ ],
+ [
+ 96.58659061074749,
+ 28.83097951915434
+ ],
+ [
+ 96.11767866413103,
+ 29.452802028922466
+ ],
+ [
+ 95.40480228066464,
+ 29.03171662039213
+ ],
+ [
+ 94.56599043170294,
+ 29.277438055939985
+ ],
+ [
+ 93.41334760943269,
+ 28.640629380807226
+ ],
+ [
+ 92.50311893104364,
+ 27.89687632904645
+ ],
+ [
+ 91.69665652869668,
+ 27.771741848251665
+ ],
+ [
+ 91.25885379431992,
+ 28.040614325466294
+ ],
+ [
+ 90.7305139505678,
+ 28.064953925075756
+ ],
+ [
+ 90.01582889197118,
+ 28.296438503527217
+ ],
+ [
+ 89.47581017452111,
+ 28.042758897406397
+ ],
+ [
+ 88.81424848832056,
+ 27.299315904239364
+ ],
+ [
+ 88.73032596227856,
+ 28.086864732367516
+ ],
+ [
+ 88.12044070836987,
+ 27.876541652939594
+ ],
+ [
+ 86.9545170430006,
+ 27.974261786403517
+ ],
+ [
+ 85.82331994013151,
+ 28.203575954698707
+ ],
+ [
+ 85.01163821812304,
+ 28.642773952747344
+ ],
+ [
+ 84.23457970575015,
+ 28.839893703724698
+ ],
+ [
+ 83.89899295444673,
+ 29.320226141877658
+ ],
+ [
+ 83.33711510613719,
+ 29.463731594352197
+ ],
+ [
+ 82.32751264845088,
+ 30.115268052688137
+ ],
+ [
+ 81.52580447787474,
+ 30.42271698660863
+ ],
+ [
+ 81.11125613802932,
+ 30.183480943313402
+ ],
+ [
+ 79.7213668151071,
+ 30.88271474865473
+ ],
+ [
+ 78.73889448437401,
+ 31.515906073527063
+ ],
+ [
+ 78.45844648632601,
+ 32.61816437431273
+ ],
+ [
+ 79.17612877799553,
+ 32.48377981213771
+ ],
+ [
+ 79.20889163606859,
+ 32.994394639613716
+ ],
+ [
+ 78.81108646028574,
+ 33.50619802503242
+ ],
+ [
+ 78.91226891471322,
+ 34.32193634697579
+ ],
+ [
+ 77.83745079947457,
+ 35.494009507787766
+ ],
+ [
+ 76.19284834178569,
+ 35.89840342868783
+ ],
+ [
+ 75.89689741405013,
+ 36.666806138651836
+ ],
+ [
+ 75.15802778514092,
+ 37.13303091078912
+ ],
+ [
+ 74.98000247589542,
+ 37.419990139305895
+ ],
+ [
+ 74.8299857929521,
+ 37.9900070257014
+ ],
+ [
+ 74.86481570831683,
+ 38.3788463404816
+ ],
+ [
+ 74.25751427602273,
+ 38.60650686294345
+ ],
+ [
+ 73.92885216664644,
+ 38.50581533462274
+ ],
+ [
+ 73.6753792662548,
+ 39.4312368841056
+ ],
+ [
+ 73.96001305531843,
+ 39.660008449861735
+ ],
+ [
+ 73.8222436868283,
+ 39.893973497063186
+ ],
+ [
+ 74.77686242055606,
+ 40.36642527929163
+ ],
+ [
+ 75.4678279967307,
+ 40.56207225194867
+ ],
+ [
+ 76.52636803579745,
+ 40.42794607193512
+ ],
+ [
+ 76.90448449087708,
+ 41.06648590754965
+ ],
+ [
+ 78.18719689322597,
+ 41.18531586360481
+ ],
+ [
+ 78.54366092317531,
+ 41.58224254003869
+ ],
+ [
+ 80.11943037305139,
+ 42.12394074153825
+ ],
+ [
+ 80.2599902688853,
+ 42.34999929459906
+ ]
+ ]
+ ]
+ ]
+ }
+ },
+ {
+ "pop_est": 1366417754.0,
+ "continent": "Asia",
+ "name": "India",
+ "iso_a3": "IND",
+ "gdp_md_est": 2868929,
+ "type": "Feature",
+ "geometry": {
+ "type": "Polygon",
+ "coordinates": [
+ [
+ [
+ 97.32711388549004,
+ 28.26158274994634
+ ],
+ [
+ 97.40256147663614,
+ 27.882536119085444
+ ],
+ [
+ 97.0519885599681,
+ 27.69905894623315
+ ],
+ [
+ 97.1339990580153,
+ 27.083773505149964
+ ],
+ [
+ 96.41936567585097,
+ 27.264589341739224
+ ],
+ [
+ 95.12476769407496,
+ 26.5735720891323
+ ],
+ [
+ 95.1551534362626,
+ 26.001307277932085
+ ],
+ [
+ 94.60324913938538,
+ 25.162495428970402
+ ],
+ [
+ 94.55265791217164,
+ 24.675238348890336
+ ],
+ [
+ 94.10674197792507,
+ 23.85074087167348
+ ],
+ [
+ 93.3251876159428,
+ 24.078556423432204
+ ],
+ [
+ 93.28632693885928,
+ 23.043658352139005
+ ],
+ [
+ 93.06029422401463,
+ 22.70311066333557
+ ],
+ [
+ 93.16612755734837,
+ 22.278459580977103
+ ],
+ [
+ 92.67272098182556,
+ 22.041238918541254
+ ],
+ [
+ 92.14603478390681,
+ 23.627498684172593
+ ],
+ [
+ 91.86992760617132,
+ 23.624346421802784
+ ],
+ [
+ 91.70647505083211,
+ 22.985263983649187
+ ],
+ [
+ 91.15896325069973,
+ 23.50352692310439
+ ],
+ [
+ 91.46772993364368,
+ 24.072639471934792
+ ],
+ [
+ 91.91509280799443,
+ 24.130413723237112
+ ],
+ [
+ 92.37620161333481,
+ 24.976692816664965
+ ],
+ [
+ 91.79959598182208,
+ 25.147431748957317
+ ],
+ [
+ 90.87221072791212,
+ 25.132600612889547
+ ],
+ [
+ 89.92069258012185,
+ 25.26974986419218
+ ],
+ [
+ 89.83248091019962,
+ 25.96508209889548
+ ],
+ [
+ 89.35509402868729,
+ 26.014407253518073
+ ],
+ [
+ 88.56304935094977,
+ 26.446525580342723
+ ],
+ [
+ 88.2097892598025,
+ 25.768065700782714
+ ],
+ [
+ 88.93155398962308,
+ 25.238692328384776
+ ],
+ [
+ 88.30637251175602,
+ 24.866079413344206
+ ],
+ [
+ 88.08442223506242,
+ 24.501657212821925
+ ],
+ [
+ 88.69994022009092,
+ 24.23371491138856
+ ],
+ [
+ 88.52976972855379,
+ 23.631141872649167
+ ],
+ [
+ 88.87631188350309,
+ 22.87914642993783
+ ],
+ [
+ 89.03196129756623,
+ 22.055708319582976
+ ],
+ [
+ 88.88876590368542,
+ 21.690588487224748
+ ],
+ [
+ 88.20849734899522,
+ 21.703171698487807
+ ],
+ [
+ 86.97570438024027,
+ 21.49556163175521
+ ],
+ [
+ 87.03316857294887,
+ 20.743307806882413
+ ],
+ [
+ 86.49935102737379,
+ 20.151638495356607
+ ],
+ [
+ 85.0602657409097,
+ 19.4785788029711
+ ],
+ [
+ 83.94100589390001,
+ 18.302009792549725
+ ],
+ [
+ 83.18921715691785,
+ 17.67122142177898
+ ],
+ [
+ 82.19279218946592,
+ 17.016636053937816
+ ],
+ [
+ 82.19124189649719,
+ 16.556664130107848
+ ],
+ [
+ 81.69271935417748,
+ 16.310219224507904
+ ],
+ [
+ 80.79199913933014,
+ 15.951972357644493
+ ],
+ [
+ 80.32489586784388,
+ 15.89918488205835
+ ],
+ [
+ 80.02506920768644,
+ 15.136414903214147
+ ],
+ [
+ 80.2332735533904,
+ 13.835770778859981
+ ],
+ [
+ 80.28629357292186,
+ 13.006260687710835
+ ],
+ [
+ 79.8625468281285,
+ 12.056215318240888
+ ],
+ [
+ 79.85799930208682,
+ 10.35727509199711
+ ],
+ [
+ 79.340511509116,
+ 10.30885427493962
+ ],
+ [
+ 78.88534549348918,
+ 9.546135972527722
+ ],
+ [
+ 79.1897196796883,
+ 9.216543687370148
+ ],
+ [
+ 78.2779407083305,
+ 8.933046779816934
+ ],
+ [
+ 77.94116539908435,
+ 8.252959092639742
+ ],
+ [
+ 77.53989790233794,
+ 7.965534776232332
+ ],
+ [
+ 76.59297895702167,
+ 8.89927623131419
+ ],
+ [
+ 76.13006147655108,
+ 10.299630031775521
+ ],
+ [
+ 75.7464673196485,
+ 11.308250637248307
+ ],
+ [
+ 75.39610110870959,
+ 11.781245022015824
+ ],
+ [
+ 74.86481570831683,
+ 12.741935736537897
+ ],
+ [
+ 74.61671715688354,
+ 13.99258291264968
+ ],
+ [
+ 74.44385949086723,
+ 14.617221787977698
+ ],
+ [
+ 73.5341992532334,
+ 15.99065216721496
+ ],
+ [
+ 73.11990929554943,
+ 17.928570054592498
+ ],
+ [
+ 72.82090945830865,
+ 19.208233547436166
+ ],
+ [
+ 72.8244751321368,
+ 20.419503282141534
+ ],
+ [
+ 72.6305334817454,
+ 21.356009426351008
+ ],
+ [
+ 71.17527347197395,
+ 20.757441311114235
+ ],
+ [
+ 70.4704586119451,
+ 20.877330634031384
+ ],
+ [
+ 69.16413008003883,
+ 22.0892980005727
+ ],
+ [
+ 69.6449276060824,
+ 22.450774644454338
+ ],
+ [
+ 69.34959679553435,
+ 22.84317963306269
+ ],
+ [
+ 68.1766451353734,
+ 23.69196503345671
+ ],
+ [
+ 68.84259931831878,
+ 24.35913361256094
+ ],
+ [
+ 71.04324018746823,
+ 24.3565239527302
+ ],
+ [
+ 70.84469933460284,
+ 25.21510203704352
+ ],
+ [
+ 70.2828731627256,
+ 25.72222870533983
+ ],
+ [
+ 70.16892662952202,
+ 26.491871649678842
+ ],
+ [
+ 69.51439293811313,
+ 26.940965684511372
+ ],
+ [
+ 70.61649620960193,
+ 27.989196275335868
+ ],
+ [
+ 71.77766564320032,
+ 27.913180243434525
+ ],
+ [
+ 72.8237516620847,
+ 28.961591701772054
+ ],
+ [
+ 73.45063846221743,
+ 29.97641347911987
+ ],
+ [
+ 74.42138024282028,
+ 30.979814764931177
+ ],
+ [
+ 74.40592898956501,
+ 31.69263947196528
+ ],
+ [
+ 75.25864179881322,
+ 32.2711054550405
+ ],
+ [
+ 74.45155927927871,
+ 32.7648996038055
+ ],
+ [
+ 74.10429365427734,
+ 33.44147329358685
+ ],
+ [
+ 73.74994835805197,
+ 34.31769887952785
+ ],
+ [
+ 74.24020267120497,
+ 34.748887030571254
+ ],
+ [
+ 75.75706098826834,
+ 34.50492259372132
+ ],
+ [
+ 76.87172163280403,
+ 34.65354401299274
+ ],
+ [
+ 77.83745079947457,
+ 35.494009507787766
+ ],
+ [
+ 78.91226891471322,
+ 34.32193634697579
+ ],
+ [
+ 78.81108646028574,
+ 33.50619802503242
+ ],
+ [
+ 79.20889163606859,
+ 32.994394639613716
+ ],
+ [
+ 79.17612877799553,
+ 32.48377981213771
+ ],
+ [
+ 78.45844648632601,
+ 32.61816437431273
+ ],
+ [
+ 78.73889448437401,
+ 31.515906073527063
+ ],
+ [
+ 79.7213668151071,
+ 30.88271474865473
+ ],
+ [
+ 81.11125613802932,
+ 30.183480943313402
+ ],
+ [
+ 80.4767212259174,
+ 29.72986522065534
+ ],
+ [
+ 80.08842451367627,
+ 28.79447011974014
+ ],
+ [
+ 81.05720258985203,
+ 28.416095282499043
+ ],
+ [
+ 81.99998742058497,
+ 27.925479234319994
+ ],
+ [
+ 83.30424889519955,
+ 27.36450572357556
+ ],
+ [
+ 84.6750179381738,
+ 27.234901231387536
+ ],
+ [
+ 85.25177859898338,
+ 26.726198431906344
+ ],
+ [
+ 86.02439293817918,
+ 26.63098460540857
+ ],
+ [
+ 87.2274719583663,
+ 26.397898057556077
+ ],
+ [
+ 88.06023766474982,
+ 26.41461538340249
+ ],
+ [
+ 88.17480431514092,
+ 26.81040517832595
+ ],
+ [
+ 88.04313276566123,
+ 27.445818589786825
+ ],
+ [
+ 88.12044070836987,
+ 27.876541652939594
+ ],
+ [
+ 88.73032596227856,
+ 28.086864732367516
+ ],
+ [
+ 88.81424848832056,
+ 27.299315904239364
+ ],
+ [
+ 88.83564253128938,
+ 27.098966376243762
+ ],
+ [
+ 89.74452762243885,
+ 26.719402981059957
+ ],
+ [
+ 90.37327477413407,
+ 26.87572418874288
+ ],
+ [
+ 91.21751264848643,
+ 26.808648179628022
+ ],
+ [
+ 92.03348351437509,
+ 26.83831045176356
+ ],
+ [
+ 92.10371178585974,
+ 27.452614040633208
+ ],
+ [
+ 91.69665652869668,
+ 27.771741848251665
+ ],
+ [
+ 92.50311893104364,
+ 27.89687632904645
+ ],
+ [
+ 93.41334760943269,
+ 28.640629380807226
+ ],
+ [
+ 94.56599043170294,
+ 29.277438055939985
+ ],
+ [
+ 95.40480228066464,
+ 29.03171662039213
+ ],
+ [
+ 96.11767866413103,
+ 29.452802028922466
+ ],
+ [
+ 96.58659061074749,
+ 28.83097951915434
+ ],
+ [
+ 96.24883344928779,
+ 28.411030992134442
+ ],
+ [
+ 97.32711388549004,
+ 28.26158274994634
+ ]
+ ]
+ ]
+ }
+ },
+ {
+ "pop_est": 328239523.0,
+ "continent": "North America",
+ "name": "United States of America",
+ "iso_a3": "USA",
+ "gdp_md_est": 21433226,
+ "type": "Feature",
+ "geometry": {
+ "type": "MultiPolygon",
+ "coordinates": [
+ [
+ [
+ [
+ -122.84000000000003,
+ 49.000000000000114
+ ],
+ [
+ -120.0,
+ 49.000000000000114
+ ],
+ [
+ -117.03121,
+ 49.0
+ ],
+ [
+ -116.04818,
+ 49.0
+ ],
+ [
+ -113.0,
+ 49.0
+ ],
+ [
+ -110.05000000000001,
+ 49.0
+ ],
+ [
+ -107.05000000000001,
+ 49.0
+ ],
+ [
+ -104.04826000000003,
+ 48.99986000000007
+ ],
+ [
+ -100.65000000000003,
+ 49.000000000000114
+ ],
+ [
+ -97.2287200000048,
+ 49.0007
+ ],
+ [
+ -95.15906950917206,
+ 49.0
+ ],
+ [
+ -95.15609,
+ 49.38425000000001
+ ],
+ [
+ -94.81758000000002,
+ 49.38905
+ ],
+ [
+ -94.64,
+ 48.84
+ ],
+ [
+ -94.32914000000001,
+ 48.67074
+ ],
+ [
+ -93.63087000000002,
+ 48.609260000000006
+ ],
+ [
+ -92.61000000000001,
+ 48.44999999999993
+ ],
+ [
+ -91.64,
+ 48.14
+ ],
+ [
+ -90.83,
+ 48.27
+ ],
+ [
+ -89.60000000000002,
+ 48.010000000000105
+ ],
+ [
+ -89.27291744663665,
+ 48.01980825458281
+ ],
+ [
+ -88.37811418328671,
+ 48.302917588893706
+ ],
+ [
+ -87.43979262330028,
+ 47.94
+ ],
+ [
+ -86.46199083122826,
+ 47.553338019392
+ ],
+ [
+ -85.65236324740341,
+ 47.22021881773051
+ ],
+ [
+ -84.8760798815149,
+ 46.90008331968238
+ ],
+ [
+ -84.77923824739992,
+ 46.63710195574902
+ ],
+ [
+ -84.54374874544584,
+ 46.538684190449146
+ ],
+ [
+ -84.60490000000004,
+ 46.439599999999984
+ ],
+ [
+ -84.33670000000001,
+ 46.408770000000004
+ ],
+ [
+ -84.1421195136734,
+ 46.51222585711571
+ ],
+ [
+ -84.0918512641615,
+ 46.27541860613826
+ ],
+ [
+ -83.89076534700574,
+ 46.116926988299014
+ ],
+ [
+ -83.61613094759059,
+ 46.116926988299014
+ ],
+ [
+ -83.46955074739469,
+ 45.994686387712534
+ ],
+ [
+ -83.59285071484311,
+ 45.81689362241252
+ ],
+ [
+ -82.55092464875821,
+ 45.34751658790543
+ ],
+ [
+ -82.33776312543114,
+ 44.440000000000055
+ ],
+ [
+ -82.13764238150395,
+ 43.57108755143997
+ ],
+ [
+ -82.42999999999999,
+ 42.980000000000004
+ ],
+ [
+ -82.9,
+ 42.43
+ ],
+ [
+ -83.12,
+ 42.08
+ ],
+ [
+ -83.14199968131264,
+ 41.975681057292874
+ ],
+ [
+ -83.029810146807,
+ 41.83279572200598
+ ],
+ [
+ -82.69008928092023,
+ 41.675105088867326
+ ],
+ [
+ -82.4392777167916,
+ 41.675105088867326
+ ],
+ [
+ -81.27774654816716,
+ 42.209025987306816
+ ],
+ [
+ -80.24744767934794,
+ 42.36619985612255
+ ],
+ [
+ -78.93936214874375,
+ 42.86361135514798
+ ],
+ [
+ -78.92,
+ 42.964999999999996
+ ],
+ [
+ -79.01,
+ 43.27
+ ],
+ [
+ -79.17167355011186,
+ 43.46633942318426
+ ],
+ [
+ -78.72027991404235,
+ 43.62508942318493
+ ],
+ [
+ -77.7378850979577,
+ 43.62905558936328
+ ],
+ [
+ -76.82003414580558,
+ 43.628784288093755
+ ],
+ [
+ -76.50000000000001,
+ 44.01845889375865
+ ],
+ [
+ -76.375,
+ 44.09631
+ ],
+ [
+ -75.31821000000001,
+ 44.81645
+ ],
+ [
+ -74.86700000000002,
+ 45.000480000000096
+ ],
+ [
+ -73.34783,
+ 45.00738
+ ],
+ [
+ -71.50506,
+ 45.0082
+ ],
+ [
+ -71.405,
+ 45.254999999999995
+ ],
+ [
+ -71.08482000000004,
+ 45.30524000000014
+ ],
+ [
+ -70.66,
+ 45.46
+ ],
+ [
+ -70.305,
+ 45.915
+ ],
+ [
+ -69.99997,
+ 46.69307
+ ],
+ [
+ -69.237216,
+ 47.447781
+ ],
+ [
+ -68.90500000000003,
+ 47.18500000000006
+ ],
+ [
+ -68.23444,
+ 47.354859999999974
+ ],
+ [
+ -67.79046000000001,
+ 47.066359999999996
+ ],
+ [
+ -67.79134,
+ 45.70281000000001
+ ],
+ [
+ -67.13741,
+ 45.13753
+ ],
+ [
+ -66.96465999999998,
+ 44.809700000000134
+ ],
+ [
+ -68.03251999999998,
+ 44.325199999999995
+ ],
+ [
+ -69.05999999999995,
+ 43.980000000000075
+ ],
+ [
+ -70.11616999999995,
+ 43.68405000000013
+ ],
+ [
+ -70.64547563341102,
+ 43.09023834896402
+ ],
+ [
+ -70.81488999999999,
+ 42.865299999999934
+ ],
+ [
+ -70.82499999999999,
+ 42.33499999999998
+ ],
+ [
+ -70.49499999999995,
+ 41.80500000000001
+ ],
+ [
+ -70.07999999999998,
+ 41.78000000000003
+ ],
+ [
+ -70.185,
+ 42.145000000000095
+ ],
+ [
+ -69.88496999999995,
+ 41.92283000000009
+ ],
+ [
+ -69.96502999999996,
+ 41.63717000000014
+ ],
+ [
+ -70.63999999999999,
+ 41.47500000000002
+ ],
+ [
+ -71.12039000000004,
+ 41.49445000000014
+ ],
+ [
+ -71.8599999999999,
+ 41.32000000000005
+ ],
+ [
+ -72.29500000000002,
+ 41.26999999999998
+ ],
+ [
+ -72.87643000000003,
+ 41.220650000000035
+ ],
+ [
+ -73.71000000000004,
+ 40.93110235165449
+ ],
+ [
+ -72.24125999999995,
+ 41.119480000000124
+ ],
+ [
+ -71.94499999999988,
+ 40.930000000000064
+ ],
+ [
+ -73.34499999999997,
+ 40.63000000000005
+ ],
+ [
+ -73.98200000000003,
+ 40.62799999999993
+ ],
+ [
+ -73.95232499999997,
+ 40.75075000000004
+ ],
+ [
+ -74.25671,
+ 40.47351000000003
+ ],
+ [
+ -73.96243999999996,
+ 40.42763000000002
+ ],
+ [
+ -74.17838,
+ 39.70925999999997
+ ],
+ [
+ -74.90603999999996,
+ 38.93954000000002
+ ],
+ [
+ -74.98041,
+ 39.19640000000004
+ ],
+ [
+ -75.20002,
+ 39.248450000000105
+ ],
+ [
+ -75.52805000000001,
+ 39.49850000000009
+ ],
+ [
+ -75.32,
+ 38.960000000000036
+ ],
+ [
+ -75.07183476478986,
+ 38.782032230179254
+ ],
+ [
+ -75.05672999999996,
+ 38.40412000000009
+ ],
+ [
+ -75.37746999999996,
+ 38.015510000000006
+ ],
+ [
+ -75.94022999999999,
+ 37.21689000000009
+ ],
+ [
+ -76.03126999999995,
+ 37.25659999999999
+ ],
+ [
+ -75.72204999999985,
+ 37.93705000000011
+ ],
+ [
+ -76.23286999999999,
+ 38.319214999999986
+ ],
+ [
+ -76.35000000000002,
+ 39.14999999999998
+ ],
+ [
+ -76.54272499999996,
+ 38.71761500000008
+ ],
+ [
+ -76.32933000000003,
+ 38.08326000000005
+ ],
+ [
+ -76.98999793161352,
+ 38.23999176691336
+ ],
+ [
+ -76.30161999999996,
+ 37.91794499999992
+ ],
+ [
+ -76.25873999999999,
+ 36.96640000000008
+ ],
+ [
+ -75.97179999999997,
+ 36.89726000000002
+ ],
+ [
+ -75.8680399999999,
+ 36.55125000000004
+ ],
+ [
+ -75.72748999999999,
+ 35.55074000000013
+ ],
+ [
+ -76.36318,
+ 34.80854000000011
+ ],
+ [
+ -77.39763499999992,
+ 34.512009999999975
+ ],
+ [
+ -78.05496,
+ 33.92547000000002
+ ],
+ [
+ -78.55434999999989,
+ 33.86133000000012
+ ],
+ [
+ -79.06067000000002,
+ 33.493949999999984
+ ],
+ [
+ -79.20357000000001,
+ 33.158390000000054
+ ],
+ [
+ -80.30132499999996,
+ 32.509355000000085
+ ],
+ [
+ -80.86498,
+ 32.033300000000054
+ ],
+ [
+ -81.33629000000002,
+ 31.44049000000001
+ ],
+ [
+ -81.49041999999997,
+ 30.7299900000001
+ ],
+ [
+ -81.31371000000001,
+ 30.035520000000076
+ ],
+ [
+ -80.97999999999996,
+ 29.18000000000012
+ ],
+ [
+ -80.53558499999991,
+ 28.472129999999993
+ ],
+ [
+ -80.52999999999986,
+ 28.040000000000077
+ ],
+ [
+ -80.05653928497759,
+ 26.88000000000011
+ ],
+ [
+ -80.08801499999998,
+ 26.205764999999985
+ ],
+ [
+ -80.13155999999992,
+ 25.816775000000064
+ ],
+ [
+ -80.38103000000001,
+ 25.20616000000001
+ ],
+ [
+ -80.67999999999995,
+ 25.08000000000004
+ ],
+ [
+ -81.17212999999998,
+ 25.201260000000104
+ ],
+ [
+ -81.33000000000004,
+ 25.639999999999986
+ ],
+ [
+ -81.70999999999987,
+ 25.870000000000005
+ ],
+ [
+ -82.23999999999995,
+ 26.730000000000132
+ ],
+ [
+ -82.70515,
+ 27.495040000000074
+ ],
+ [
+ -82.85525999999999,
+ 27.886240000000043
+ ],
+ [
+ -82.64999999999998,
+ 28.550000000000125
+ ],
+ [
+ -82.92999999999995,
+ 29.10000000000008
+ ],
+ [
+ -83.70958999999999,
+ 29.936560000000043
+ ],
+ [
+ -84.09999999999997,
+ 30.09000000000009
+ ],
+ [
+ -85.10881999999998,
+ 29.636150000000043
+ ],
+ [
+ -85.28784000000002,
+ 29.68612000000013
+ ],
+ [
+ -85.7731,
+ 30.152610000000095
+ ],
+ [
+ -86.39999999999992,
+ 30.40000000000009
+ ],
+ [
+ -87.53035999999992,
+ 30.27433000000002
+ ],
+ [
+ -88.41781999999995,
+ 30.384900000000016
+ ],
+ [
+ -89.1804899999999,
+ 30.315980000000025
+ ],
+ [
+ -89.5938311784198,
+ 30.159994004836847
+ ],
+ [
+ -89.41373499999997,
+ 29.89418999999998
+ ],
+ [
+ -89.43,
+ 29.488639999999975
+ ],
+ [
+ -89.21767,
+ 29.291080000000022
+ ],
+ [
+ -89.40822999999995,
+ 29.159610000000043
+ ],
+ [
+ -89.77927999999997,
+ 29.307140000000118
+ ],
+ [
+ -90.15463,
+ 29.11743000000007
+ ],
+ [
+ -90.88022499999994,
+ 29.148535000000095
+ ],
+ [
+ -91.62678499999993,
+ 29.677000000000135
+ ],
+ [
+ -92.49905999999999,
+ 29.552300000000002
+ ],
+ [
+ -93.22636999999997,
+ 29.783750000000055
+ ],
+ [
+ -93.84841999999998,
+ 29.71363000000008
+ ],
+ [
+ -94.69,
+ 29.480000000000132
+ ],
+ [
+ -95.60025999999999,
+ 28.738630000000057
+ ],
+ [
+ -96.59403999999995,
+ 28.307480000000055
+ ],
+ [
+ -97.13999999999987,
+ 27.83000000000004
+ ],
+ [
+ -97.36999999999995,
+ 27.380000000000052
+ ],
+ [
+ -97.37999999999994,
+ 26.690000000000055
+ ],
+ [
+ -97.32999999999998,
+ 26.210000000000093
+ ],
+ [
+ -97.13999999999987,
+ 25.870000000000005
+ ],
+ [
+ -97.52999999999992,
+ 25.84000000000009
+ ],
+ [
+ -98.23999999999995,
+ 26.06000000000006
+ ],
+ [
+ -99.01999999999992,
+ 26.37000000000006
+ ],
+ [
+ -99.30000000000001,
+ 26.840000000000032
+ ],
+ [
+ -99.51999999999992,
+ 27.54000000000002
+ ],
+ [
+ -100.10999999999996,
+ 28.110000000000127
+ ],
+ [
+ -100.45584000000002,
+ 28.69612000000012
+ ],
+ [
+ -100.95759999999996,
+ 29.380710000000136
+ ],
+ [
+ -101.66239999999999,
+ 29.77930000000009
+ ],
+ [
+ -102.48000000000002,
+ 29.75999999999999
+ ],
+ [
+ -103.11000000000001,
+ 28.970000000000027
+ ],
+ [
+ -103.94,
+ 29.27000000000004
+ ],
+ [
+ -104.4569699999999,
+ 29.571960000000047
+ ],
+ [
+ -104.70574999999997,
+ 30.121730000000014
+ ],
+ [
+ -105.03737000000001,
+ 30.644019999999955
+ ],
+ [
+ -105.63159000000002,
+ 31.08383000000009
+ ],
+ [
+ -106.1429,
+ 31.399950000000047
+ ],
+ [
+ -106.50758999999988,
+ 31.754520000000014
+ ],
+ [
+ -108.24000000000001,
+ 31.754853718166373
+ ],
+ [
+ -108.24193999999994,
+ 31.342220000000054
+ ],
+ [
+ -109.03500000000003,
+ 31.341940000000136
+ ],
+ [
+ -111.02361000000002,
+ 31.334719999999948
+ ],
+ [
+ -113.30498,
+ 32.03914000000009
+ ],
+ [
+ -114.815,
+ 32.52528000000001
+ ],
+ [
+ -114.72138999999993,
+ 32.72082999999992
+ ],
+ [
+ -115.99134999999995,
+ 32.61239000000012
+ ],
+ [
+ -117.12775999999985,
+ 32.53533999999996
+ ],
+ [
+ -117.29593769127393,
+ 33.04622461520387
+ ],
+ [
+ -117.94400000000002,
+ 33.621236431201396
+ ],
+ [
+ -118.41060227589753,
+ 33.74090922312445
+ ],
+ [
+ -118.51989482279976,
+ 34.02778157757575
+ ],
+ [
+ -119.08100000000002,
+ 34.07799999999992
+ ],
+ [
+ -119.43884064201671,
+ 34.34847717828427
+ ],
+ [
+ -120.36777999999998,
+ 34.447110000000066
+ ],
+ [
+ -120.62286,
+ 34.60854999999998
+ ],
+ [
+ -120.74432999999999,
+ 35.15686000000011
+ ],
+ [
+ -121.71456999999992,
+ 36.161529999999914
+ ],
+ [
+ -122.54746999999998,
+ 37.551760000000115
+ ],
+ [
+ -122.51201000000003,
+ 37.78339000000011
+ ],
+ [
+ -122.95319,
+ 38.11371000000008
+ ],
+ [
+ -123.72720000000004,
+ 38.95166000000012
+ ],
+ [
+ -123.86516999999998,
+ 39.76699000000008
+ ],
+ [
+ -124.39807000000002,
+ 40.313199999999995
+ ],
+ [
+ -124.17885999999999,
+ 41.142020000000116
+ ],
+ [
+ -124.21370000000002,
+ 41.99964000000011
+ ],
+ [
+ -124.53283999999996,
+ 42.7659900000001
+ ],
+ [
+ -124.14213999999998,
+ 43.708380000000034
+ ],
+ [
+ -124.020535,
+ 44.615894999999966
+ ],
+ [
+ -123.89892999999995,
+ 45.52341000000007
+ ],
+ [
+ -124.079635,
+ 46.864750000000015
+ ],
+ [
+ -124.39566999999994,
+ 47.72017000000011
+ ],
+ [
+ -124.68721008300781,
+ 48.18443298339855
+ ],
+ [
+ -124.56610107421875,
+ 48.37971496582037
+ ],
+ [
+ -123.12,
+ 48.04000000000002
+ ],
+ [
+ -122.58735999999993,
+ 47.09600000000006
+ ],
+ [
+ -122.34000000000003,
+ 47.360000000000014
+ ],
+ [
+ -122.5,
+ 48.180000000000064
+ ],
+ [
+ -122.84000000000003,
+ 49.000000000000114
+ ]
+ ]
+ ],
+ [
+ [
+ [
+ -155.40214,
+ 20.07975
+ ],
+ [
+ -155.22452,
+ 19.99302
+ ],
+ [
+ -155.06226,
+ 19.8591
+ ],
+ [
+ -154.80741,
+ 19.50871
+ ],
+ [
+ -154.83147,
+ 19.453280000000003
+ ],
+ [
+ -155.22217,
+ 19.23972
+ ],
+ [
+ -155.54211,
+ 19.08348
+ ],
+ [
+ -155.68817,
+ 18.91619
+ ],
+ [
+ -155.93665,
+ 19.05939
+ ],
+ [
+ -155.90806,
+ 19.33888
+ ],
+ [
+ -156.07347000000001,
+ 19.70294
+ ],
+ [
+ -156.02368,
+ 19.81422
+ ],
+ [
+ -155.85008000000002,
+ 19.97729
+ ],
+ [
+ -155.91907,
+ 20.17395
+ ],
+ [
+ -155.86108000000002,
+ 20.267210000000002
+ ],
+ [
+ -155.78505,
+ 20.2487
+ ],
+ [
+ -155.40214,
+ 20.07975
+ ]
+ ]
+ ],
+ [
+ [
+ [
+ -155.99566000000002,
+ 20.76404
+ ],
+ [
+ -156.07926,
+ 20.643970000000003
+ ],
+ [
+ -156.41445,
+ 20.57241
+ ],
+ [
+ -156.58673,
+ 20.783
+ ],
+ [
+ -156.70167,
+ 20.8643
+ ],
+ [
+ -156.71054999999998,
+ 20.92676
+ ],
+ [
+ -156.61258,
+ 21.01249
+ ],
+ [
+ -156.25711,
+ 20.917450000000002
+ ],
+ [
+ -155.99566000000002,
+ 20.76404
+ ]
+ ]
+ ],
+ [
+ [
+ [
+ -156.75824,
+ 21.176840000000002
+ ],
+ [
+ -156.78933,
+ 21.068730000000002
+ ],
+ [
+ -157.32521,
+ 21.097770000000004
+ ],
+ [
+ -157.25027,
+ 21.219579999999997
+ ],
+ [
+ -156.75824,
+ 21.176840000000002
+ ]
+ ]
+ ],
+ [
+ [
+ [
+ -158.0252,
+ 21.71696
+ ],
+ [
+ -157.94161,
+ 21.65272
+ ],
+ [
+ -157.65283000000002,
+ 21.322170000000003
+ ],
+ [
+ -157.70703,
+ 21.26442
+ ],
+ [
+ -157.7786,
+ 21.27729
+ ],
+ [
+ -158.12667000000002,
+ 21.31244
+ ],
+ [
+ -158.2538,
+ 21.53919
+ ],
+ [
+ -158.29265,
+ 21.57912
+ ],
+ [
+ -158.0252,
+ 21.71696
+ ]
+ ]
+ ],
+ [
+ [
+ [
+ -159.36569,
+ 22.21494
+ ],
+ [
+ -159.34512,
+ 21.982000000000003
+ ],
+ [
+ -159.46372,
+ 21.88299
+ ],
+ [
+ -159.80051,
+ 22.065330000000003
+ ],
+ [
+ -159.74877,
+ 22.1382
+ ],
+ [
+ -159.5962,
+ 22.236179999999997
+ ],
+ [
+ -159.36569,
+ 22.21494
+ ]
+ ]
+ ],
+ [
+ [
+ [
+ -166.46779212142462,
+ 60.384169826897754
+ ],
+ [
+ -165.67442969466364,
+ 60.29360687930625
+ ],
+ [
+ -165.57916419173358,
+ 59.90998688418753
+ ],
+ [
+ -166.19277014876727,
+ 59.75444082298899
+ ],
+ [
+ -166.84833736882197,
+ 59.941406155020985
+ ],
+ [
+ -167.45527706609008,
+ 60.21306915957936
+ ],
+ [
+ -166.46779212142462,
+ 60.384169826897754
+ ]
+ ]
+ ],
+ [
+ [
+ [
+ -153.22872941792113,
+ 57.96896841087248
+ ],
+ [
+ -152.56479061583514,
+ 57.901427313866996
+ ],
+ [
+ -152.1411472239064,
+ 57.591058661522
+ ],
+ [
+ -153.00631405333692,
+ 57.11584219016593
+ ],
+ [
+ -154.0050902984581,
+ 56.734676825581076
+ ],
+ [
+ -154.51640275777004,
+ 56.99274892844669
+ ],
+ [
+ -154.67099280497118,
+ 57.46119578717253
+ ],
+ [
+ -153.7627795074415,
+ 57.81657461204373
+ ],
+ [
+ -153.22872941792113,
+ 57.96896841087248
+ ]
+ ]
+ ],
+ [
+ [
+ [
+ -140.98598761037601,
+ 69.71199839952635
+ ],
+ [
+ -140.986,
+ 69.712
+ ],
+ [
+ -140.9925,
+ 66.00003000000001
+ ],
+ [
+ -140.99778,
+ 60.30639000000001
+ ],
+ [
+ -140.013,
+ 60.27682000000001
+ ],
+ [
+ -139.03900000000002,
+ 60.0
+ ],
+ [
+ -138.34089,
+ 59.562110000000004
+ ],
+ [
+ -137.4525,
+ 58.905
+ ],
+ [
+ -136.47972000000004,
+ 59.46389000000005
+ ],
+ [
+ -135.47583,
+ 59.787780000000005
+ ],
+ [
+ -134.94500000000005,
+ 59.2705600000001
+ ],
+ [
+ -134.27111000000002,
+ 58.86111000000005
+ ],
+ [
+ -133.35556000000003,
+ 58.41028000000001
+ ],
+ [
+ -132.73042,
+ 57.692890000000006
+ ],
+ [
+ -131.70781,
+ 56.55212
+ ],
+ [
+ -130.00778000000003,
+ 55.915830000000085
+ ],
+ [
+ -129.98,
+ 55.285000000000004
+ ],
+ [
+ -130.53611,
+ 54.802780000000006
+ ],
+ [
+ -130.53610895273684,
+ 54.80275447679924
+ ],
+ [
+ -130.5361101894673,
+ 54.8027534043494
+ ],
+ [
+ -131.08581823797215,
+ 55.17890615500204
+ ],
+ [
+ -131.9672114671423,
+ 55.497775580459006
+ ],
+ [
+ -132.2500107428595,
+ 56.3699962428974
+ ],
+ [
+ -133.53918108435641,
+ 57.17888743756214
+ ],
+ [
+ -134.07806292029608,
+ 58.12306753196691
+ ],
+ [
+ -135.0382110322791,
+ 58.18771474876394
+ ],
+ [
+ -136.62806230995471,
+ 58.21220937767043
+ ],
+ [
+ -137.800006279686,
+ 58.49999542910376
+ ],
+ [
+ -139.867787041413,
+ 59.53776154238915
+ ],
+ [
+ -140.825273817133,
+ 59.727517401765056
+ ],
+ [
+ -142.57444353556446,
+ 60.08444651960497
+ ],
+ [
+ -143.9588809948799,
+ 59.999180406323376
+ ],
+ [
+ -145.92555681682788,
+ 60.45860972761426
+ ],
+ [
+ -147.11437394914665,
+ 60.884656073644635
+ ],
+ [
+ -148.22430620012761,
+ 60.67298940697714
+ ],
+ [
+ -148.01806555885082,
+ 59.97832896589364
+ ],
+ [
+ -148.57082251686086,
+ 59.914172675203304
+ ],
+ [
+ -149.72785783587585,
+ 59.70565827090553
+ ],
+ [
+ -150.60824337461642,
+ 59.368211168039466
+ ],
+ [
+ -151.7163927886833,
+ 59.15582103131993
+ ],
+ [
+ -151.85943315326722,
+ 59.744984035879554
+ ],
+ [
+ -151.40971900124717,
+ 60.72580272077937
+ ],
+ [
+ -150.3469414947325,
+ 61.03358755150987
+ ],
+ [
+ -150.62111080625704,
+ 61.2844249538544
+ ],
+ [
+ -151.89583919981683,
+ 60.727197984451266
+ ],
+ [
+ -152.57832984109558,
+ 60.061657212964235
+ ],
+ [
+ -154.01917212625764,
+ 59.35027944603428
+ ],
+ [
+ -153.28751135965317,
+ 58.86472768821977
+ ],
+ [
+ -154.23249243875847,
+ 58.14637360293051
+ ],
+ [
+ -155.3074914215102,
+ 57.727794501366304
+ ],
+ [
+ -156.30833472392305,
+ 57.422774359763594
+ ],
+ [
+ -156.55609737854638,
+ 56.97998484967064
+ ],
+ [
+ -158.11721655986779,
+ 56.46360809999419
+ ],
+ [
+ -158.43332129619714,
+ 55.99415355083852
+ ],
+ [
+ -159.60332739971741,
+ 55.56668610292013
+ ],
+ [
+ -160.28971961163427,
+ 55.643580634170576
+ ],
+ [
+ -161.22304765525777,
+ 55.364734605523495
+ ],
+ [
+ -162.23776607974105,
+ 55.02418691672011
+ ],
+ [
+ -163.06944658104638,
+ 54.68973704692712
+ ],
+ [
+ -164.78556922102717,
+ 54.40417308208214
+ ],
+ [
+ -164.94222632552007,
+ 54.57222483989534
+ ],
+ [
+ -163.84833960676565,
+ 55.03943146424609
+ ],
+ [
+ -162.87000139061595,
+ 55.34804311789321
+ ],
+ [
+ -161.80417497459607,
+ 55.89498647727038
+ ],
+ [
+ -160.5636047027812,
+ 56.00805451112501
+ ],
+ [
+ -160.07055986228448,
+ 56.41805532492873
+ ],
+ [
+ -158.6844429189195,
+ 57.01667511659787
+ ],
+ [
+ -158.46109737855403,
+ 57.21692129172885
+ ],
+ [
+ -157.72277035218391,
+ 57.57000051536306
+ ],
+ [
+ -157.55027442119362,
+ 58.328326321030204
+ ],
+ [
+ -157.04167497457698,
+ 58.91888458926172
+ ],
+ [
+ -158.19473120830554,
+ 58.61580231386978
+ ],
+ [
+ -158.51721798402303,
+ 58.78778148053732
+ ],
+ [
+ -159.0586061269288,
+ 58.42418610293163
+ ],
+ [
+ -159.71166704001737,
+ 58.93139028587632
+ ],
+ [
+ -159.98128882550017,
+ 58.572549140041644
+ ],
+ [
+ -160.3552711659965,
+ 59.07112335879361
+ ],
+ [
+ -161.3550034251151,
+ 58.670837714260756
+ ],
+ [
+ -161.96889360252632,
+ 58.67166453717738
+ ],
+ [
+ -162.05498653872465,
+ 59.26692536074745
+ ],
+ [
+ -161.8741707021354,
+ 59.63362132429057
+ ],
+ [
+ -162.51805904849212,
+ 59.98972361921386
+ ],
+ [
+ -163.8183414378202,
+ 59.79805573184336
+ ],
+ [
+ -164.66221757714652,
+ 60.26748444278263
+ ],
+ [
+ -165.3463877024748,
+ 60.50749563256238
+ ],
+ [
+ -165.3508318756519,
+ 61.073895168697504
+ ],
+ [
+ -166.12137915755602,
+ 61.50001902937623
+ ],
+ [
+ -165.73445187077058,
+ 62.074996853271784
+ ],
+ [
+ -164.9191786367179,
+ 62.63307648380794
+ ],
+ [
+ -164.56250790103934,
+ 63.14637848576302
+ ],
+ [
+ -163.75333248599708,
+ 63.21944896102377
+ ],
+ [
+ -163.06722449445786,
+ 63.05945872664802
+ ],
+ [
+ -162.26055538638175,
+ 63.54193573674115
+ ],
+ [
+ -161.53444983624863,
+ 63.455816962326764
+ ],
+ [
+ -160.7725066803211,
+ 63.766108100023246
+ ],
+ [
+ -160.9583351308426,
+ 64.22279857040274
+ ],
+ [
+ -161.51806840721218,
+ 64.40278758407527
+ ],
+ [
+ -160.77777767641481,
+ 64.78860382756642
+ ],
+ [
+ -161.39192623598765,
+ 64.77723501246231
+ ],
+ [
+ -162.4530500966689,
+ 64.55944468856819
+ ],
+ [
+ -162.75778601789415,
+ 64.33860545516876
+ ],
+ [
+ -163.54639421288428,
+ 64.5591604681905
+ ],
+ [
+ -164.96082984114514,
+ 64.44694509546883
+ ],
+ [
+ -166.42528825586447,
+ 64.68667206487066
+ ],
+ [
+ -166.8450042389391,
+ 65.08889557561452
+ ],
+ [
+ -168.11056006576715,
+ 65.66999705673675
+ ],
+ [
+ -166.70527116602193,
+ 66.08831777613938
+ ],
+ [
+ -164.47470964257548,
+ 66.5766600612975
+ ],
+ [
+ -163.65251176659564,
+ 66.5766600612975
+ ],
+ [
+ -163.78860165103623,
+ 66.07720734319668
+ ],
+ [
+ -161.67777442121013,
+ 66.11611969671242
+ ],
+ [
+ -162.48971452538004,
+ 66.73556509059512
+ ],
+ [
+ -163.71971696679117,
+ 67.11639455837008
+ ],
+ [
+ -164.4309913808565,
+ 67.61633820257777
+ ],
+ [
+ -165.39028683170673,
+ 68.04277212185025
+ ],
+ [
+ -166.76444068099605,
+ 68.35887685817966
+ ],
+ [
+ -166.20470740462667,
+ 68.88303091091615
+ ],
+ [
+ -164.43081051334346,
+ 68.91553538682774
+ ],
+ [
+ -163.1686136546145,
+ 69.37111481391287
+ ],
+ [
+ -162.930566169262,
+ 69.85806183539927
+ ],
+ [
+ -161.90889726463556,
+ 70.33332998318764
+ ],
+ [
+ -160.93479651593367,
+ 70.44768992784958
+ ],
+ [
+ -159.03917578838713,
+ 70.89164215766891
+ ],
+ [
+ -158.11972286683394,
+ 70.82472117785102
+ ],
+ [
+ -156.58082455139808,
+ 71.35776357694175
+ ],
+ [
+ -155.06779029032427,
+ 71.14777639432367
+ ],
+ [
+ -154.3441652089412,
+ 70.69640859647018
+ ],
+ [
+ -153.9000062733926,
+ 70.88998851183567
+ ],
+ [
+ -152.21000606993528,
+ 70.82999217394485
+ ],
+ [
+ -152.27000240782613,
+ 70.60000621202983
+ ],
+ [
+ -150.73999243874448,
+ 70.43001658800569
+ ],
+ [
+ -149.7200030181675,
+ 70.53001048449045
+ ],
+ [
+ -147.61336157935705,
+ 70.2140349392418
+ ],
+ [
+ -145.68998980022533,
+ 70.12000967068673
+ ],
+ [
+ -144.9200109590764,
+ 69.98999176704046
+ ],
+ [
+ -143.58944618042523,
+ 70.15251414659832
+ ],
+ [
+ -142.07251034871348,
+ 69.85193817817265
+ ],
+ [
+ -140.98598752156073,
+ 69.71199839952635
+ ],
+ [
+ -140.98598761037601,
+ 69.71199839952635
+ ]
+ ]
+ ],
+ [
+ [
+ [
+ -171.73165686753944,
+ 63.782515367275934
+ ],
+ [
+ -171.1144335602453,
+ 63.59219106714495
+ ],
+ [
+ -170.4911124339407,
+ 63.694975490973505
+ ],
+ [
+ -169.6825054596536,
+ 63.43111562769119
+ ],
+ [
+ -168.6894394603007,
+ 63.297506212000556
+ ],
+ [
+ -168.77194088445466,
+ 63.18859813094544
+ ],
+ [
+ -169.5294398672051,
+ 62.97693146427792
+ ],
+ [
+ -170.29055620021595,
+ 63.194437567794424
+ ],
+ [
+ -170.67138566799093,
+ 63.3758218451389
+ ],
+ [
+ -171.55306311753873,
+ 63.317789211675105
+ ],
+ [
+ -171.79111060289122,
+ 63.40584585230046
+ ],
+ [
+ -171.73165686753944,
+ 63.782515367275934
+ ]
+ ]
+ ]
+ ]
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/tests/_plugins/ui/_impl/snapshots/parse_spec_narwhal.txt b/tests/_plugins/ui/_impl/snapshots/parse_spec_narwhal.txt
new file mode 100644
index 0000000000..5098349ddb
--- /dev/null
+++ b/tests/_plugins/ui/_impl/snapshots/parse_spec_narwhal.txt
@@ -0,0 +1,24 @@
+{
+ "config": {
+ "view": {
+ "continuousWidth": 300,
+ "continuousHeight": 300
+ }
+ },
+ "data": {
+ "url": "data:text/csv;base64,dmFsdWVzCjEKMgozCg==",
+ "format": {
+ "type": "csv"
+ }
+ },
+ "mark": {
+ "type": "point"
+ },
+ "encoding": {
+ "x": {
+ "field": "values",
+ "type": "quantitative"
+ }
+ },
+ "$schema": "https://vega.github.io/schema/vega-lite/v5.20.1.json"
+}
\ No newline at end of file
diff --git a/tests/_plugins/ui/_impl/snapshots/parse_spec_pandas.txt b/tests/_plugins/ui/_impl/snapshots/parse_spec_pandas.txt
new file mode 100644
index 0000000000..5098349ddb
--- /dev/null
+++ b/tests/_plugins/ui/_impl/snapshots/parse_spec_pandas.txt
@@ -0,0 +1,24 @@
+{
+ "config": {
+ "view": {
+ "continuousWidth": 300,
+ "continuousHeight": 300
+ }
+ },
+ "data": {
+ "url": "data:text/csv;base64,dmFsdWVzCjEKMgozCg==",
+ "format": {
+ "type": "csv"
+ }
+ },
+ "mark": {
+ "type": "point"
+ },
+ "encoding": {
+ "x": {
+ "field": "values",
+ "type": "quantitative"
+ }
+ },
+ "$schema": "https://vega.github.io/schema/vega-lite/v5.20.1.json"
+}
\ No newline at end of file
diff --git a/tests/_plugins/ui/_impl/snapshots/parse_spec_url.txt b/tests/_plugins/ui/_impl/snapshots/parse_spec_url.txt
new file mode 100644
index 0000000000..d1b3e51027
--- /dev/null
+++ b/tests/_plugins/ui/_impl/snapshots/parse_spec_url.txt
@@ -0,0 +1,21 @@
+{
+ "config": {
+ "view": {
+ "continuousWidth": 300,
+ "continuousHeight": 300
+ }
+ },
+ "data": {
+ "url": "https://cdn.jsdelivr.net/npm/[email protected]/data/stocks.csv"
+ },
+ "mark": {
+ "type": "point"
+ },
+ "encoding": {
+ "x": {
+ "field": "values",
+ "type": "quantitative"
+ }
+ },
+ "$schema": "https://vega.github.io/schema/vega-lite/v5.20.1.json"
+}
\ No newline at end of file
diff --git a/tests/_plugins/ui/_impl/test_altair_chart.py b/tests/_plugins/ui/_impl/test_altair_chart.py
index e0434a4bd2..3af904a82d 100644
--- a/tests/_plugins/ui/_impl/test_altair_chart.py
+++ b/tests/_plugins/ui/_impl/test_altair_chart.py
@@ -1,6 +1,9 @@
# Copyright 2024 Marimo. All rights reserved.
from __future__ import annotations
+import json
+import sys
+
import pytest
from marimo._dependencies.dependencies import DependencyManager
@@ -8,11 +11,20 @@ from marimo._plugins.ui._impl import altair_chart
from marimo._plugins.ui._impl.altair_chart import (
ChartSelection,
_filter_dataframe,
+ _parse_spec,
)
from marimo._runtime.runtime import Kernel
from tests.conftest import ExecReqProvider
+from tests.mocks import snapshotter
+
+snapshot = snapshotter(__file__)
-HAS_DEPS = DependencyManager.pandas.has() and DependencyManager.altair.has()
+HAS_DEPS = (
+ DependencyManager.pandas.has()
+ and DependencyManager.altair.has()
+ # altair produces different output on windows
+ and sys.platform != "win32"
+)
if HAS_DEPS:
import pandas as pd
@@ -252,3 +264,52 @@ def test_get_dataframe_json() -> None:
alt.Chart(data).mark_point().encode(x="values:Q")
)
assert isinstance(chart.dataframe, pd.DataFrame)
+
+
[email protected](not HAS_DEPS, reason="optional dependencies not installed")
+def test_parse_spec_url() -> None:
+ import altair as alt
+
+ data = "https://cdn.jsdelivr.net/npm/[email protected]/data/stocks.csv"
+ chart = alt.Chart(data).mark_point().encode(x="values:Q")
+ spec = _parse_spec(chart)
+ snapshot("parse_spec_url.txt", json.dumps(spec, indent=2))
+
+
[email protected](not HAS_DEPS, reason="optional dependencies not installed")
+def test_parse_spec_pandas() -> None:
+ import altair as alt
+ import pandas as pd
+
+ data = pd.DataFrame({"values": [1, 2, 3]})
+ chart = alt.Chart(data).mark_point().encode(x="values:Q")
+ spec = _parse_spec(chart)
+ snapshot("parse_spec_pandas.txt", json.dumps(spec, indent=2))
+
+
[email protected](not HAS_DEPS, reason="optional dependencies not installed")
+def test_parse_spec_narwhal() -> None:
+ import altair as alt
+ import narwhals as nw
+
+ data = nw.from_native(pd.DataFrame({"values": [1, 2, 3]}))
+ chart = alt.Chart(data).mark_point().encode(x="values:Q")
+ spec = _parse_spec(chart)
+ snapshot("parse_spec_narwhal.txt", json.dumps(spec, indent=2))
+
+
[email protected](not HAS_DEPS, reason="optional dependencies not installed")
+def test_parse_spec_geopandas() -> None:
+ import altair as alt
+ import geopandas as gpd
+
+ data = gpd.read_file(gpd.datasets.get_path("naturalearth_lowres"))
+ # take top 3 countries with largest population
+ data = data.sort_values(by="pop_est", ascending=False).head(3)
+ chart = (
+ alt.Chart(data)
+ .mark_geoshape()
+ .encode(shape="geometry", color="pop_est:Q")
+ )
+ spec = _parse_spec(chart)
+ snapshot("parse_spec_geopandas.txt", json.dumps(spec, indent=2))