geoprior.scripts.plot_geo_cumulative#

Plot cumulative subsidence maps on satellite basemap + optional hotspots.

Layout#

The figure uses two rows by N columns, with Nansha on top and Zhongshan on the bottom. The first columns show 2022 observed and predicted cumulative maps, followed by forecast cumulative maps for later years.

Background and overlays#

  • Background: Esri.WorldImagery satellite tiles via contextily.

  • Foreground: PS points colored by cumulative subsidence (mm) since a baseline year, default 2020.

  • Optional overlay: hotspot points from the Fig. 6 hotspot CSV.

Cumulative definition#

This script always plots cumulative since start_year, but the input CSV can be:

  1. --subsidence-kind=cumulative (default): values are already cumulative, so the script rebases them at the first year greater than or equal to start_year using cum(t) = value(t) - value(first).

  2. --subsidence-kind=increment or rate: values are yearly increments, so the script accumulates them using cum(t) = sum_y increment(y).

CRS handling (lat/lon vs UTM)#

coord_x/coord_y may be:

  • lon/lat (degrees), treated as EPSG:4326

  • UTM (meters), treated as EPSG:<utm_epsg> with default 32649

Auto-detection:

  • if abs(x) <= 180 and abs(y) <= 90, treat the coordinates as lon/lat

  • otherwise, treat them as UTM

You can override using –coords-mode and –utm-epsg.

Outputs#

Saves both PNG and PDF using –out (resolved under scripts/figs if relative).

Notes

  • Code style targets black+ruff with line length 62.

Functions

build_city_panels(val_df, fut_df, *, ...[, ...])

build_parser(*[, prog])

clip_bounds(arrays, *, clip)

draw_city_row(*, axes, row_idx, city, ...)

infer_xy_crs(df, *, mode, utm_epsg)

load_future_csv(path)

load_val_csv(path)

main(*[, prog])

parse_args([argv, prog])

plot_geo_cumulative_main([argv, prog])

to_web_mercator(df, *, src_crs)

geoprior.scripts.plot_geo_cumulative.build_parser(*, prog=None)[source]#
Parameters:

prog (str | None)

Return type:

ArgumentParser

geoprior.scripts.plot_geo_cumulative.parse_args(argv=None, *, prog=None)[source]#
Parameters:
Return type:

Namespace

geoprior.scripts.plot_geo_cumulative.load_val_csv(path)[source]#
Parameters:

path (str)

Return type:

DataFrame

geoprior.scripts.plot_geo_cumulative.load_future_csv(path)[source]#
Parameters:

path (str)

Return type:

DataFrame

geoprior.scripts.plot_geo_cumulative.infer_xy_crs(df, *, mode, utm_epsg)[source]#
Parameters:
Return type:

str

geoprior.scripts.plot_geo_cumulative.to_web_mercator(df, *, src_crs)[source]#
Parameters:
Return type:

GeoDataFrame

geoprior.scripts.plot_geo_cumulative.build_city_panels(val_df, fut_df, *, start_year, year_val, years_forecast, subs_kind='cumulative')[source]#
Parameters:
Return type:

dict[str, DataFrame]

geoprior.scripts.plot_geo_cumulative.clip_bounds(arrays, *, clip)[source]#
Parameters:
Return type:

tuple[float, float]

geoprior.scripts.plot_geo_cumulative.draw_city_row(*, axes, row_idx, city, panels_3857, col_keys, cmap, cum_tag, vmin, vmax, args, show_panel_titles, hotspots)[source]#
Parameters:
Return type:

None

geoprior.scripts.plot_geo_cumulative.plot_geo_cumulative_main(argv=None, *, prog=None)[source]#
Parameters:
Return type:

None

geoprior.scripts.plot_geo_cumulative.main(*, prog=None)[source]#
Parameters:

prog (str | None)

Return type:

None