crs-l2-svalbard-polar-areas
Map (reference ← swipe → agent)
0:00
svalbard_glaciers — I need an honest size ranking of these high-latitude glaciers using true geographic area, not the distorted values you'd get from raw lat/lon coordinates. Pick the most appropriate coordinate system for measuring area at these latitudes and give me the top 20 by area as CSV: columns name, area_km2, bbox_minx_polar, bbox_miny_polar, bbox_maxx_polar, bbox_maxy_polar, crs_epsg — bboxes in the same projected metres as the area, and crs_epsg the integer EPSG code of the CRS you used. Sort by area_km2 descending. File: svalbard_glaciers_top20.csv.
0:00
System info
{
"adapter": "openrouter",
"model": "google/gemma-4-26b-a4b-it",
"base_url": "https://openrouter.ai/api/v1"
}
0:01
Bash
ls -F
svalbard_glaciers_wgs84.gpkg
0:02
Bash
ogrinfo -al -so svalbard_glaciers_wgs84.gpkg
INFO: Open of `svalbard_glaciers_wgs84.gpkg'
using driver `GPKG' successful.
Layer name: glaciers
Geometry: Multi Polygon
Feature Count: 169
Extent: (10.787712, 77.463025) - (33.486668, 80.311555)
Layer SRS WKT:
GEOGCRS["WGS 84",
ENSEMBLE["World Geodetic System 1984 ensemble",
MEMBER["World Geodetic System 1984 (Transit)"],
MEMBER["World Geodetic System 1984 (G730)"],
MEMBER["World Geodetic System 1984 (G873)"],
MEMBER["World Geodetic System 1984 (G1150)"],
MEMBER["World Geodetic System 1984 (G1674)"],
MEMBER["World Geodetic System 1984 (G1762)"],
MEMBER["World Geodetic System 1984 (G2139)"],
MEMBER["World Geodetic System 1984 (G2296)"],
ELLIPSOID["WGS 84",6378137,298.257223563,
LENGTHUNIT["metre",1]],
ENSEMBLEACCURACY[2.0]],
PRIMEM["Greenwich",0,
ANGLEUNIT["degree",0.0174532925199433]],
CS[ellipsoidal,2],
AXIS["geodetic latitude (Lat)",north,
ORDER[1],
ANGLEUNIT["degree",0.0174532925199433]],
AXIS["geodetic longitude (Lon)",east,
ORDER[2],
ANGLEUNIT["degree",0.0174532925199433]],
USAGE[
SCOPE["Horizontal component of 3D system."],
AREA["World."],
BBOX[-90,-180,90,180]],
ID["EPSG",4326]]
Data axis to CRS axis mapping: 2,1
FID Column = fid
Geometry Column = geom
id: String (0.0)
name: String (0.0)
subtype: String (0.0)
class: String (0.0)
0:09
Write
solve.py
content · 53 lines · py
# /// script
# requires-python = ">=3.12"
# dependencies = ["geopandas", "shapely", "pyproj", "pandas"]
# ///
import geopandas as gpd
import pandas as pd
def solve():
# Load the glacier data
input_file = "svalbard_glaciers_wgs84.gpkg"
gdf = gpd.read_file(input_file)
# Svalbard is at high latitude (~78N).
# For area measurements in high latitudes, North Pole Stereographic is appropriate.
# EPSG:3413 is NSIDC Sea Ice Polar Stereographic North, which is standard for Arctic.
# Alternatively, EPSG:3031 (WGS 84 / Arctic Polar Stereographic) is also common.
# Let's use EPSG:3031 as it is a standard WGS84-based polar projection.
target_crs = "EPSG:3031"
# Project to the target CRS
gdf_projected = gdf.to_crs(target_crs)
# Calculate area in square meters and convert to km2
gdf_projected['area_km2'] = gdf_projected.geometry.area / 10**6
# Get bounding boxes in the projected CRS
# bounds returns (minx, miny, maxx, maxy)
bounds = gdf_projected.geometry.bounds
gdf_projected['bbox_minx_polar'] = bounds['minx']
gdf_projected['bbox_miny_polar'] = bounds['miny']
gdf_projected['bbox_maxx_polar'] = bounds['maxx']
gdf_projected['bbox_maxy_polar'] = bounds['maxy']
# Get EPSG code
epsg_code = int(gdf_projected.crs.to_epsg())
gdf_projected['crs_epsg'] = epsg_code
# Sort by area descending and take top 20
top_20 = gdf_projected.sort_values(by='area_km2', ascending=False).head(20)
# Select and rename columns as requested
# columns: name, area_km2, bbox_minx_polar, bbox_miny_polar, bbox_maxx_polar, bbox_maxy_polar, crs_epsg
result_df = top_20[['name', 'area_km2', 'bbox_minx_polar', 'bbox_miny_polar', 'bbox_maxx_polar', 'bbox_maxy_polar', 'crs_epsg']]
# Save to CSV
output_file = "svalbard_glaciers_top20.csv"
result_df.to_csv(output_file, index=False)
print(f"Successfully saved top 20 glaciers to {output_file}")
if __name__ == "__main__":
solve()
file_path must be inside the working directory (/work): '/home/nhp/project/benchmark/harness/.sessions/30e0b30f48be40018c5994740dcc7484/solve.py'
0:10
Bash
pwd
/work
0:17
Write
solve.py
content · 51 lines · py
# /// script
# requires-python = ">=3.12"
# dependencies = ["geopandas", "shapely", "pyproj", "pandas", "pyogrio"]
# ///
import geopandas as gpd
import pandas as pd
def solve():
# Load the glacier data
# The file is in the current directory based on the prompt's context
input_file = "svalbard_glaciers_wgs84.gpkg"
gdf = gpd.read_file(input_file)
# Svalbard is at high latitude (~78N).
# For area measurements in high latitudes, North Pole Stereographic is appropriate.
# EPSG:3031 (WGS 84 / Arctic Polar Stereographic) is standard.
target_crs = "EPSG:3031"
# Project to the target CRS
gdf_projected = gdf.to_crs(target_crs)
# Calculate area in square meters and convert to km2
gdf_projected['area_km2'] = gdf_projected.geometry.area / 10**6
# Get bounding boxes in the projected CRS
bounds = gdf_projected.geometry.bounds
gdf_projected['bbox_minx_polar'] = bounds['minx']
gdf_projected['bbox_miny_polar'] = bounds['miny']
gdf_projected['bbox_maxx_polar'] = bounds['maxx']
gdf_projected['bbox_maxy_polar'] = bounds['maxy']
# Get EPSG code
epsg_code = int(gdf_projected.crs.to_epsg())
gdf_projected['crs_epsg'] = epsg_code
# Sort by area descending and take top 20
top_20 = gdf_projected.sort_values(by='area_km2', ascending=False).head(20)
# Select and rename columns as requested
# columns: name, area_km2, bbox_minx_polar, bbox_miny_polar, bbox_maxx_polar, bbox_maxy_polar, crs_epsg
result_df = top_20[['name', 'area_km2', 'bbox_minx_polar', 'bbox_miny_polar', 'bbox_maxx_polar', 'bbox_maxy_polar', 'crs_epsg']]
# Save to CSV
output_file = "svalbard_glaciers_top20.csv"
result_df.to_csv(output_file, index=False)
print(f"Successfully saved top 20 glaciers to {output_file}")
if __name__ == "__main__":
solve()
Wrote solve.py (1852 chars).
0:18
Bash
uv run solve.py
Successfully saved top 20 glaciers to svalbard_glaciers_top20.csv
Installed 10 packages in 229ms
0:22
Bash
ls -F
solve.py svalbard_glaciers_top20.csv svalbard_glaciers_wgs84.gpkg
0:23
Read
svalbard_glaciers_top20.csv
1 name,area_km2,bbox_minx_polar,bbox_miny_polar,bbox_maxx_polar,bbox_maxy_polar,crs_epsg
2 Sørfonna,57913207.89351027,46941647.79333892,118954232.00494866,59420060.387675144,127783867.77723171,3031
3 Vestfonna,37707706.73774842,43705731.40312292,128249331.77495892,53031608.05047808,135874965.56225777,3031
4 Åsgardfonna,12226016.786616925,36537732.89152416,125714373.61756578,39792146.482076816,132371904.27632824,3031
5 Kvitøyjøkulen,10732333.177224262,74017637.72312304,118960064.02436376,79290550.07520366,122094321.29060802,3031
6 Valhallfonna,6071320.3433117345,39698075.54659533,128607917.6486717,42306003.801349305,132624298.32826297,3031
7 Sveabreen,1221838.5028002842,28646943.22864956,118643946.76391493,30280552.316836372,121243380.68575503,3031
8 Veteranen,1157698.2227456167,37892655.70003966,123314298.47382578,39787955.05311167,125947405.74349065,3031
9 Nordmannsfonna,1105022.9101809333,37109571.799567156,112711691.07408309,38533283.21042101,114567912.85072823,3031
10 Himingbjørgfonna,1015527.9245778427,36880664.5001257,124600251.80513896,38766520.132834084,125937159.99885535,3031
11 Gruvfonna,871746.4926695547,32689273.931831565,111254025.4783313,34535306.37840269,112313500.49374367,3031
12 Hellefonna,663822.7203122829,35189808.55434789,111888320.80988273,36390315.861885324,113420384.37387468,3031
13 Nordenskiöldbreen,653331.4982344685,36041264.54560634,118075182.24845412,37046080.1270617,119095482.81476085,3031
14 Heuglinbreen,630754.9381876655,38467469.15823377,113890881.54777053,39370092.963049,115181847.16131006,3031
15 Dunérbreen,596305.5026633329,39543579.46631282,130761201.82438363,40232771.84169448,132481535.2123377,3031
16 Eidembreen,594634.8770678077,26960369.77025206,117563128.6258552,28614746.810331862,118306479.15828134,3031
17 Ahlmannfonna,586081.8159835485,54266747.1870608,130699308.04089881,55279105.818796664,131581781.40053818,3031
18 Gullfaksebreen,454587.9346835967,38910002.63607969,128111035.23705325,40592181.772507295,128932377.9127014,3031
19 Isrosa,385176.2937207799,36988785.94189373,112228409.45351635,38238454.00550968,112915663.84789449,3031
20 Esmarkbreen,371679.82391033403,28218740.677263625,116397860.95466171,29017820.094119154,117627853.15332879,3031
21 Venernbreen,370310.11395664193,27250534.319327656,116939677.63326854,28489466.600492135,117578969.23474543,3031
0:28
Write
solve.py
content · 51 lines · py
# /// script
# requires-python = ">=3.12"
# dependencies = ["geopandas", "shapely", "pyproj", "pandas", "pyogrio"]
# ///
import geopandas as gpd
import pandas as pd
def solve():
# Load the glacier data
input_file = "svalbard_glaciers_wgs84.gpkg"
gdf = gpd.read_file(input_file)
# Svalbard is at high latitude (~78N).
# For area measurements in high latitudes, North Pole Stereographic is appropriate.
# EPSG:3031 (WGS 84 / Arctic Polar Stereographic) is standard.
target_crs = "EPSG:3031"
# Project to the target CRS
gdf_projected = gdf.to_crs(target_crs)
# Calculate area in square meters and convert to km2
gdf_projected['area_km2'] = gdf_projected.geometry.area / 10**6
# Get bounding boxes in the projected CRS
# bounds returns (minx, miny, maxx, maxy)
bounds = gdf_projected.geometry.bounds
gdf_projected['bbox_minx_polar'] = bounds['minx']
gdf_projected['bbox_miny_polar'] = bounds['miny']
gdf_projected['bbox_maxx_polar'] = bounds['maxx']
gdf_projected['bbox_maxy_polar'] = bounds['maxy']
# Get EPSG code
epsg_code = int(gdf_projected.crs.to_epsg())
gdf_projected['crs_epsg'] = epsg_code
# Sort by area descending and take top 20
top_20 = gdf_projected.sort_values(by='area_km2', ascending=False).head(20)
# Select and rename columns as requested
# columns: name, area_km2, bbox_minx_polar, bbox_miny_polar, bbox_maxx_polar, bbox_maxy_polar, crs_epsg
result_df = top_20[['name', 'area_km2', 'bbox_minx_polar', 'bbox_miny_polar', 'bbox_maxx_polar', 'bbox_maxy_polar', 'crs_epsg']]
# Save to CSV
output_file = "svalbard_glaciers_top20.csv"
result_df.to_csv(output_file, index=False)
print(f"Successfully saved top 20 glaciers to {output_file}")
if __name__ == "__main__":
solve()
Wrote solve.py (1825 chars).
0:29
Bash
# No changes needed, just a check.
# No changes needed, just a check. cat svalbard_glaciers_top20.csv | head -n 5
name,area_km2,bbox_minx_polar,bbox_miny_polar,bbox_maxx_polar,bbox_maxy_polar,crs_epsg Sørfonna,57913207.89351027,46941647.79333892,118954232.00494866,59420060.387675144,127783867.77723171,3031 Vestfonna,37707706.73774842,43705731.40312292,128249331.77495892,53031608.05047808,135874965.56225777,3031 Åsgardfonna,12226016.786616925,36537732.89152416,125714373.61756578,39792146.482076816,132371904.27632824,3031 Kvitøyjøkulen,10732333.177224262,74017637.72312304,118960064.02436376,79290550.07520366,122094321.29060802,3031
0:30
Bash
# The previous cat showed an extra line with line numbers if I'm not mistaken?
# The previous cat showed an extra line with line numbers if I'm not mistaken? # Oh, I see, it was from the Read tool output. # Let's check the actual file content. head -n 5 svalbard_glaciers_top20.csv
name,area_km2,bbox_minx_polar,bbox_miny_polar,bbox_maxx_polar,bbox_maxy_polar,crs_epsg Sørfonna,57913207.89351027,46941647.79333892,118954232.00494866,59420060.387675144,127783867.77723171,3031 Vestfonna,37707706.73774842,43705731.40312292,128249331.77495892,53031608.05047808,135874965.56225777,3031 Åsgardfonna,12226016.786616925,36537732.89152416,125714373.61756578,39792146.482076816,132371904.27632824,3031 Kvitøyjøkulen,10732333.177224262,74017637.72312304,118960064.02436376,79290550.07520366,122094321.29060802,3031
0:36