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.
Python artificial-intelligencedagdata-sciencedata-visualizationdataflowdeveloper-toolsmachine-learningnotebookspipelinepythonreactivesqlweb-app
fix: improve memory usage on variable previews (#3635)
Myles Scolnick9c599f234d65
diff --git a/marimo/_messaging/ops.py b/marimo/_messaging/ops.pyindex e7f1ad1d56..278066e48c 100644--- a/marimo/_messaging/ops.py+++ b/marimo/_messaging/ops.py@@ -41,11 +41,11 @@ from marimo._messaging.errors import (from marimo._messaging.mimetypes import KnownMimeTypefrom marimo._messaging.streams import OUTPUT_MAX_BYTESfrom marimo._messaging.types import Stream+from marimo._messaging.variables import get_variable_previewfrom marimo._output.hypertext import Htmlfrom marimo._plugins.core.json_encoder import WebComponentEncoderfrom marimo._plugins.core.web_component import JSONTypefrom marimo._plugins.ui._core.ui_element import UIElement-from marimo._plugins.ui._impl.tables.utils import get_table_manager_or_nonefrom marimo._runtime.context import get_contextfrom marimo._runtime.context.utils import get_modefrom marimo._runtime.layout.layout import LayoutConfig@@ -532,16 +532,17 @@ class VariableValue:self.value = Nonedef _stringify(self, value: object) -> str:+ MAX_STR_LEN = 50++ if isinstance(value, str):+ if len(value) > MAX_STR_LEN:+ return value[:MAX_STR_LEN]+ return value+try:- # HACK: We pretty-print tables to avoid str(ibis_table)- # which can be very slow when `ibis.options.interactive = True`- table_manager = get_table_manager_or_none(value)- if table_manager is not None:- return str(table_manager)- else:- # TODO(akshayka): str(value) can be extremely expensive- # for some objects; find a better solution.- return str(value)[:50]+ # str(value) can be slow for large objects+ # or lead to large memory spikes+ return get_variable_preview(value, max_str_len=MAX_STR_LEN)except BaseException:# Catch-all: some libraries like Polars have bugs and raise# BaseExceptions, which shouldn't crash the kerneldiff --git a/marimo/_messaging/variables.py b/marimo/_messaging/variables.pynew file mode 100644index 0000000000..e1c5eeaccc--- /dev/null+++ b/marimo/_messaging/variables.py@@ -0,0 +1,164 @@+from __future__ import annotations++from typing import Any, Mapping, Sequence, Union++from marimo._plugins.ui._impl.tables.utils import get_table_manager_or_none+++def get_variable_preview(+ obj: Any,+ max_items: int = 5,+ max_str_len: int = 50,+ max_bytes: int = 32,+ _depth: int = 0,+ _seen: set[int] | None = None,+) -> str:+ """+ Generate a preview string for any Python object.++ Args:+ obj: Any Python object+ max_items: Maximum number of items to show for sequences/mappings+ max_str_len: Maximum length for string previews+ max_bytes: Maximum number of bytes to show for binary data+ _depth: Internal parameter to track recursion depth+ _seen: Set to track circular references++ Returns:+ str: A preview string+ """+ if _seen is None:+ _seen = set()++ # Check for circular references+ obj_id = id(obj)+ if obj_id in _seen:+ return f"<circular reference: {type(obj).__name__}>"++ # Track mutable objects that could be circular+ if isinstance(obj, (list, dict, set, tuple)):+ _seen.add(obj_id)++ # Add max recursion depth+ MAX_DEPTH = 5+ if _depth > MAX_DEPTH:+ return f"<max depth reached: {type(obj).__name__}>"++ def truncate_str(s: str, max_len: int) -> str:+ return s if len(s) <= max_len else s[:max_len]++ def preview_sequence(+ seq: Union[Sequence[Any], set[Any], frozenset[Any]],+ ) -> str:+ # Convert set-like objects to list for indexing+ if isinstance(seq, (set, frozenset)):+ seq = list(seq)++ length = len(seq)+ if length <= max_items:+ items = [+ get_variable_preview(+ x, max_items // 2, _depth=_depth + 1, _seen=_seen+ )+ for x in seq+ ]+ else:+ half = max_items // 2+ first = [+ get_variable_preview(+ x, max_items // 2, _depth=_depth + 1, _seen=_seen+ )+ for x in seq[:half]+ ]+ last = [+ get_variable_preview(+ x, max_items // 2, _depth=_depth + 1, _seen=_seen+ )+ for x in seq[-half:]+ ]+ items = first + ["..."] + last+ return f"[{', '.join(items)}]"++ def preview_mapping(d: Mapping[Any, Any]) -> str:+ length = len(d)+ if length <= max_items:+ items = [+ f"{get_variable_preview(k, max_items // 2, _depth=_depth + 1, _seen=_seen)}: {get_variable_preview(v, max_items // 2, _depth=_depth + 1, _seen=_seen)}"+ for k, v in d.items()+ ]+ else:+ half = max_items // 2+ items = (+ [+ f"{get_variable_preview(k, max_items // 2, _depth=_depth + 1, _seen=_seen)}: {get_variable_preview(v, max_items // 2, _depth=_depth + 1, _seen=_seen)}"+ for k, v in list(d.items())[:half]+ ]+ + ["..."]+ + [+ f"{get_variable_preview(k, max_items // 2, _depth=_depth + 1, _seen=_seen)}: {get_variable_preview(v, max_items // 2, _depth=_depth + 1, _seen=_seen)}"+ for k, v in list(d.items())[-half:]+ ]+ )+ return f"{{{', '.join(items)}}}"++ def preview_bytes(data: bytes | bytearray) -> str:+ length = len(data)+ if length <= max_bytes:+ preview = data.hex()+ else:+ half = max_bytes // 2+ preview = f"{data[:half].hex()}...{data[-half:].hex()}"+ return f"<{length} bytes: {preview}>"++ # Get type name+ type_name = type(obj).__name__++ try:+ # Handle None+ if obj is None:+ return "None"++ # Handle basic types+ elif isinstance(obj, (bool, int, float, complex)):+ return str(obj)++ # Handle strings+ elif isinstance(obj, str):+ return f"'{truncate_str(obj, max_str_len)}'"++ # Handle bytes and bytearray+ elif isinstance(obj, (bytes, bytearray)):+ return f"{type_name}{preview_bytes(obj)}"++ # Handle lists, tuples, sets+ elif isinstance(obj, (list, tuple, set, frozenset)):+ preview = preview_sequence(obj)+ if isinstance(obj, (set, frozenset)):+ preview = f"{{{preview[1:-1]}}}"+ elif isinstance(obj, tuple):+ preview = f"({preview[1:-1]})"+ return preview++ # Handle dictionaries+ elif isinstance(obj, dict):+ return preview_mapping(obj)++ # Handle dataframes+ table_manager = get_table_manager_or_none(obj)+ if table_manager is not None:+ return str(table_manager)++ # Handle common standard library types+ elif hasattr(obj, "__dict__"):+ return f"<{type_name} object at {hex(id(obj))}>"++ # Fallback for other types+ else:+ try:+ preview = str(obj)+ return truncate_str(preview, max_str_len)+ except Exception:+ return f"<unprintable {type_name} object>"++ except Exception as e:+ return f"<error previewing {type_name}: {str(e)}>"diff --git a/pyproject.toml b/pyproject.tomlindex 887d0e5337..bcde20fc09 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -232,7 +232,8 @@ extra-dependencies = ["polars~=1.9.0","pandas>=1.5.3","hvplot~=0.11.2",- "geopandas~=0.14.4; python_version > '3.9'",+ # Causes issues installing `shapely` (v2.0.7)+ # "geopandas~=1.0.1; python_version > '3.9'",# FOr testing sql"ibis-framework[duckdb]~=9.5.0; python_version > '3.9'",# For testing mo.imagediff --git a/tests/_messaging/test_ops.py b/tests/_messaging/test_ops.pyindex 09fb472466..f97fad3216 100644--- a/tests/_messaging/test_ops.py+++ b/tests/_messaging/test_ops.py@@ -26,4 +26,5 @@ def test_variable_value_broken_str() -> None:variable_value = VariableValue(name="o", value=Broken())assert variable_value.datatype == "Broken"- assert variable_value.value == "<UNKNOWN>"+ assert variable_value.value is not None+ assert variable_value.value.startswith("<Broken object at")diff --git a/tests/_messaging/test_variables.py b/tests/_messaging/test_variables.pynew file mode 100644index 0000000000..5a53977993--- /dev/null+++ b/tests/_messaging/test_variables.py@@ -0,0 +1,217 @@+from __future__ import annotations++import os+from typing import Any++import psutil+import pytest++from marimo._dependencies.dependencies import DependencyManager+from marimo._messaging.variables import get_variable_preview+from tests._data.mocks import create_dataframes+++def test_get_variable_preview() -> None:+ # Test with various types+ # Test None+ assert get_variable_preview(None) == "None"++ # Test basic types+ assert get_variable_preview(42) == "42"+ assert get_variable_preview(3.14) == "3.14"++ # Test strings+ assert get_variable_preview("Hello, world!") == "'Hello, world!'"+ assert get_variable_preview("A" * 1000).startswith("'AAAAA")+ assert len(get_variable_preview("A" * 1000)) <= 52++ # Test sequences+ assert (+ get_variable_preview([1, 2, 3, 4, 5, 6, 7, 8]) == "[1, 2, ..., 7, 8]"+ )+ assert (+ get_variable_preview((1, "two", 3.0, [4, 5]))+ == "(1, 'two', 3.0, [4, 5])"+ )+ assert (+ get_variable_preview({1, 2, 3, 4, 5, 6, 7, 8}) == "{1, 2, ..., 7, 8}"+ )++ # Test dict+ assert (+ get_variable_preview({"a": 1, "b": 2, "c": 3, "d": 4, "e": 5, "f": 6})+ == "{'a': 1, 'b': 2, ..., 'e': 5, 'f': 6}"+ )++ # Test bytes/bytearray+ bytearray_preview = get_variable_preview(bytearray(b"Hello" * 1000))+ assert bytearray_preview.startswith("bytearray<5000 bytes:")++ bytes_preview = get_variable_preview(bytes([x % 256 for x in range(1000)]))+ assert bytes_preview.startswith("bytes<1000 bytes:")++ # Test other types+ assert get_variable_preview(range(100)).startswith("range(0, 100)")+ assert get_variable_preview(Exception("test error")).startswith(+ "<Exception object at"+ )++ # Test nested structures+ assert (+ get_variable_preview([[1, 2], [3, 4], [5, 6]])+ == "[[1, 2], [3, 4], [5, 6]]"+ )+ assert (+ get_variable_preview({"a": [1, 2], "b": {"c": 3}})+ == "{'a': [1, 2], 'b': {'c': 3}}"+ )++ # Test empty containers+ assert get_variable_preview([]) == "[]"+ assert get_variable_preview({}) == "{}"+ assert get_variable_preview(set()) == "{}"+ assert get_variable_preview(tuple()) == "()"++ # Test single-element containers+ assert get_variable_preview([1]) == "[1]"+ assert get_variable_preview({1}) == "{1}"+ assert get_variable_preview((1,)) == "(1)"++ # Test special strings+ assert get_variable_preview("\n\t\r") == "'\n\t\r'"+ assert get_variable_preview("🐍🚀") == "'🐍🚀'"+ assert get_variable_preview("'quoted'") == "''quoted''"++ # Test numeric types+ assert get_variable_preview(float("inf")) == "inf"+ assert get_variable_preview(float("-inf")) == "-inf"+ assert get_variable_preview(float("nan")) == "nan"+ assert get_variable_preview(complex(1, 2)) == "(1+2j)"+ assert get_variable_preview(1234567890123456789) == "1234567890123456789"++ # Test custom objects+ class CustomClass:+ def __str__(self):+ return "CustomStr"++ def __repr__(self):+ return "CustomRepr"++ assert get_variable_preview(CustomClass()).startswith(+ "<CustomClass object at"+ )++ # Test iterables+ from itertools import count, cycle, repeat++ assert get_variable_preview(count()).startswith("count(0)")+ assert get_variable_preview(cycle([1, 2])).startswith(+ "<itertools.cycle object at"+ )+ assert get_variable_preview(repeat(1)).startswith("repeat(1)")++ # Test file objects+ from io import BytesIO, StringIO++ assert get_variable_preview(StringIO("test")).startswith(+ "<StringIO object at"+ )+ assert get_variable_preview(BytesIO(b"test")).startswith(+ "<BytesIO object at"+ )++ # Test more complex nested structures+ complex_dict = {+ "a": [1, 2, 3],+ "b": {"c": [4, 5, 6], "d": (7, 8, 9)},+ "e": {1, 2, 3},+ "f": range(10),+ }+ assert (+ get_variable_preview(complex_dict)+ == """{'a': [1, ..., 3], 'b': {'c': [..., 4, 5, 6], 'd': (..., 7, 8, 9)}, 'e': {1, ..., 3}, 'f': range(0, 10)}"""+ )++ # Test deeply nested structures+ deep_nest = [[[[1]]]]+ assert get_variable_preview(deep_nest) == "[[[[..., 1]]]]"++ # Test mixed type sequences+ mixed = [1, "two", 3.0, [4, 5], {6, 7}, {"eight": 9}, (10,)]+ assert get_variable_preview(mixed) == (+ "[1, 'two', ..., {'eight': 9}, (10)]"+ )++ # Recursive dict+ inner_dict: dict[str, Any] = {"a": 1, "b": 2}+ inner_dict["c"] = inner_dict+ assert get_variable_preview(inner_dict) == (+ "{'a': 1, 'b': 2, 'c': <circular reference: dict>}"+ )+++ not DependencyManager.numpy.has(),+ reason="Numpy is not installed",+)+def test_get_variable_preview_memory_numpy() -> None:+ # Test memory usage with large array+ import numpy as np++ process = psutil.Process(os.getpid())++ # Create 100MB array+ large_array = np.ones(100 * 1024 * 1024 // 8, dtype=np.float64)++ mem_before = process.memory_info().rss+ preview = get_variable_preview(large_array)+ mem_after = process.memory_info().rss++ mem_diff_mb = (mem_after - mem_before) / (1024 * 1024)++ # Memory shouldn't increase significantly during preview+ assert mem_diff_mb < 1, (+ f"Memory increased by {mem_diff_mb}MB during preview"+ )+ assert preview == "[1. 1. 1. ... 1. 1. 1.]"+++def test_get_variable_preview_bytesarray() -> None:+ process = psutil.Process(os.getpid())++ # Create 100MB bytesarray+ large_array = bytearray(b"A" * 100 * 1024 * 1024)++ mem_before = process.memory_info().rss+ preview = get_variable_preview(large_array)+ mem_after = process.memory_info().rss++ mem_diff_mb = (mem_after - mem_before) / (1024 * 1024)++ # Memory shouldn't increase significantly during preview+ assert mem_diff_mb < 1, (+ f"Memory increased by {mem_diff_mb}MB during preview"+ )+ assert (+ preview+ == "bytearray<104857600 bytes: 41414141414141414141414141414141...41414141414141414141414141414141>"+ )+++ "df",+ create_dataframes({"A": list(range(1000000)), "B": ["x"] * 1000000}),+)+def test_get_variable_preview_dataframe(df: Any) -> None:+ process = psutil.Process(os.getpid())++ mem_before = process.memory_info().rss+ preview = get_variable_preview(df)+ mem_after = process.memory_info().rss++ mem_diff_mb = (mem_after - mem_before) / (1024 * 1024)++ assert mem_diff_mb < 1, (+ f"Memory increased by {mem_diff_mb}MB during preview"+ )+ assert "2 columns" in previewdiff --git a/tests/_plugins/ui/_impl/snapshots/parse_spec_geopandas.txt b/tests/_plugins/ui/_impl/snapshots/parse_spec_geopandas.txtindex e560f3471b..72751f7e71 100644--- a/tests/_plugins/ui/_impl/snapshots/parse_spec_geopandas.txt+++ b/tests/_plugins/ui/_impl/snapshots/parse_spec_geopandas.txt@@ -6,7 +6,7 @@}},"data": {- "name": "data-303698c38c444bd1c0ea1c917c5c8185"+ "name": "data-cc0a8311b413c4168b2c1fac768ce667"},"mark": {"type": "geoshape"@@ -23,3385 +23,40 @@},"$schema": "https://vega.github.io/schema/vega-lite/v5.20.1.json","datasets": {- "data-303698c38c444bd1c0ea1c917c5c8185": [+ "data-cc0a8311b413c4168b2c1fac768ce667": [{- "pop_est": 1397715000.0,- "continent": "Asia",- "name": "China",- "iso_a3": "CHN",- "gdp_md_est": 14342903,+ "name": "USA",+ "pop_est": 331002651,"type": "Feature","geometry": {- "type": "MultiPolygon",+ "type": "Point","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- ]- ]- ]+ -95.0,+ 37.0]}},{- "pop_est": 1366417754.0,- "continent": "Asia",- "name": "India",- "iso_a3": "IND",- "gdp_md_est": 2868929,+ "name": "China",+ "pop_est": 1439323776,"type": "Feature","geometry": {- "type": "Polygon",+ "type": "Point","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- ]- ]+ 105.0,+ 35.0]}},{- "pop_est": 328239523.0,- "continent": "North America",- "name": "United States of America",- "iso_a3": "USA",- "gdp_md_est": 21433226,+ "name": "India",+ "pop_est": 1380004385,"type": "Feature","geometry": {- "type": "MultiPolygon",+ "type": "Point","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- ]- ]- ]+ 77.0,+ 20.0]}}diff --git a/tests/_plugins/ui/_impl/test_altair_chart.py b/tests/_plugins/ui/_impl/test_altair_chart.pyindex f0ae21eed8..eed1456063 100644--- a/tests/_plugins/ui/_impl/test_altair_chart.py+++ b/tests/_plugins/ui/_impl/test_altair_chart.py@@ -680,9 +680,17 @@ def test_parse_spec_geopandas() -> None:import altair as altimport 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)+ # Create a simple GeoDataFrame with 3 countries+ data = gpd.GeoDataFrame(+ {+ "name": ["USA", "China", "India"],+ "pop_est": [331002651, 1439323776, 1380004385],+ "geometry": [+ gpd.points_from_xy([x], [y])[0]+ for x, y in [(-95, 37), (105, 35), (77, 20)]+ ],+ }+ )chart = (alt.Chart(data).mark_geoshape()