{ "cells": [ { "cell_type": "code", "execution_count": 36, "metadata": { "scrolled": true }, "outputs": [], "source": [ "import geopandas as gpd\n", "from tqdm import tqdm\n", "import fiona\n", "import itertools as it\n", "\n", "from pyproj import Transformer, CRS, Geod\n", "from shapely.geometry import Point\n", "import matplotlib.pyplot as plt\n", "\n", "import osmnx as ox\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# From PixC to river profiles\n", "\n", "This Tutorial describes how combine the SWOT L2 HR Pixel Cloud product with a river centerline (in this use case from OpenStreetMap) to compute a custom high resolution river profile. \n", "\n", "This example originates from a study presented by Gasnier & Zawadzki at EGU 2025 on the potential of SWOT data on narrow rivers. It is located in China, near Xiaohaizi reservoir. \n", "\n", "*contact to recreate the study: Lionel.Zawadzki@cnes.fr*" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Define the zone of interest\n", "\n", "In this example, the zone of interest originates from a river centerline. This centerline may be defined with many different approaches, for instance:\n", "* from the SWOT Prior River Database\n", "* from OpenStreetMap python API\n", "* from the QuickOSM QGIS plugin (same features as the API), then exported in a shapefile or geopackage are similar vector format\n", "* from a user-defined vector/polygon drawn with a GIS software, then exported in a shapefile or geopackage are similar vector format \n", "\n", "In the following example, we are using the OpenStreetMap python API. Here again, there several possibilities. We will define a center point and serach for all river and canal references around this point" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | element | \n", "id | \n", "geometry | \n", "waterway | \n", "
---|---|---|---|---|
0 | \n", "way | \n", "1326050667 | \n", "LINESTRING (78.79138 39.66405, 78.79283 39.661... | \n", "river | \n", "