Skip to content

Instantly share code, notes, and snippets.

@pelson pelson/index.ipynb
Last active Jan 5, 2019

Embed
What would you like to do?
First pass at documenting the cartopy project_segment algorithm
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# How does cartopy project line segments?\n",
"\n",
"Cartopy goes through a number of steps to transform line segments from one coordinate system to a projection.\n",
"\n",
"**Note**: *This notebook is intended to illustrate the projection process for those wanting to maintain the cartopy codebase. It is not inteded to be definitive, nor to document public Cartopy APIs. If you are looking for usage documentation, please visit the cartopy docs.*\n",
"\n",
"Take the following example:"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAV0AAAC1CAYAAAD86CzsAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvDW2N/gAAB8lJREFUeJzt3VuIVeUfx+HvaEfDDhpllnmIlMoITCvsRFhkJN0YZUbdSEEURVDRRXSAuugAUUkFRRFkEBRFJfWnpAwMCicKI1JJ6SREU5KVWon7f7EYxpyDZs5vnJnngcXgvGv2fkX2xzXvXmvttlarFQBqjBjoCQAMJ6ILUEh0AQqJLkAh0QUotF9fg3Pnzm11dHRUzQVgSGhvb/9fq9Wa29NYn9Ht6OjIypUr+2dWAENUW1vbkb2NWV4AKCS6AIVEF6CQ6AIUEl2AQqILUEh0AQqJLkAh0QUoJLoAhUQXoJDoAhQSXYBCogtQSHQBCokuQCHRBSjU5ydH/PhjsnhxctBBvW+jRiUTJyaHHFI1ZYB9w5YtSUdH960vba1Wq/fBtpmtZPc+rmf8+OTEE5OpU5uvndsJJzRxBtiX/f13zwHta9u8ubdHa2tvtVozexzZW9Ht/TGSCRO6IrxjlCdPTg444D89PMBua7WS1auTZcuS5cuTb7/tCuivv+7NZxrA6PZlxIhk0q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
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"%matplotlib inline\n",
"\n",
"import cartopy.crs as ccrs\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"\n",
"plt.figure()\n",
"ax = plt.axes(projection=ccrs.PlateCarree(central_longitude=180))\n",
"ax.set_global()\n",
"\n",
"# Plot geodetic vertices, and let cartopy figure out how to\n",
"# interpolate it & cut it just right.\n",
"ax.plot(\n",
" [60, -60], [50, 50],\n",
" transform=ccrs.Geodetic(), color='blue', lw=4);"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"How did cartopy know that the line should be interpolated into two lines, each made up of multiple straight-line segments (giving the appearance of a curved line)? "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Underneath the hood, cartopy has a (private) Interpolator object which knows how interpolate between two points (either as a straight line, or as a great circle, depending on the coordinate systems in use).\n",
"\n",
"We can hook into this interpolator (for debug purposes only: See cartopy.geodesic for a similar public API)."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"from cartopy.trace import _Testing as TraceTesting\n",
"import cartopy.crs as ccrs\n",
"\n",
"# Keep a hold of references to the coord systems.\n",
"# If they get GCed, then you *will* segfault.\n",
"source, dest = ccrs.Geodetic(), ccrs.PlateCarree(central_longitude=180)\n",
"\n",
"interp = TraceTesting.interpolator(source, dest)\n",
"\n",
"# Define a helper to pretty print the points that come out.\n",
"def print_pt(pt):\n",
" print(f'{pt[\"x\"]:.2f}, {pt[\"y\"]:.2f}')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This interpolator knows how to calculate a point given a line start and end, and the fraction along the line desired (referred to a \"t\"):"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"t=0.0: point= -60.00, 50.00\n",
"t=0.25: point= -38.18, 61.94\n",
"t=0.5: point= -0.00, 67.27\n",
"t=0.75: point= 38.18, 61.94\n",
"t=1.0: point= 60.00, 50.00\n"
]
}
],
"source": [
"import numpy as np\n",
"\n",
"for i in np.linspace(0, 1, 5):\n",
" print(f't={i}: point=', end=' ')\n",
" print_pt(TraceTesting.interp_t_pt(\n",
" interp, {'x': 120, 'y': 50}, {'x': -120, 'y': 50},\n",
" i))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The interpolator also knows how to project from the source to the destination coordinate system."
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"-60.00, 50.00\n"
]
}
],
"source": [
"print_pt(TraceTesting.interp_prj_pt(interp, {'x': 120, 'y': 50}))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The task of identifying whether a segment must be interpolated and/or cut is iterative.\n",
"\n",
"We start by setting up the full segment, and iterating a ``t_min`` and ``t_max`` until we find a values that produce straight (enough) lines *in both* projected and non-projected space."
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"i: 0 to 0.9; straight enough?: no\n",
"i: 0 to 0.8; straight enough?: no\n",
"i: 0 to 0.7; straight enough?: no\n",
"i: 0 to 0.6; straight enough?: no\n",
"i: 0 to 0.5; straight enough?: no\n",
"i: 0 to 0.4; straight enough?: yes\n"
]
}
],
"source": [
"from cartopy.trace import _Testing as TraceTesting\n",
"\n",
"line_start = {'x': 60, 'y': 50}\n",
"line_end = {'x': -60, 'y': 50}\n",
"\n",
"# We choose a threshold that isn't as high as the one defined\n",
"# in cartopy so that we can see the process in action.\n",
"threshold = dest.threshold * 10\n",
"\n",
"i, good = 1.0, False\n",
"while i > 0 and not good:\n",
" i -= 0.1\n",
" \n",
" good = TraceTesting.straight_and_within(\n",
" line_start, line_end, 0.0, i,\n",
" interp, threshold, dest.domain\n",
" )\n",
" print(f'i: 0 to {i:.1f}; straight enough?: {\"yes\" if good else \"no\"}')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"To visualise what is going on here:"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAgQAAAEJCAYAAADrdD/VAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvDW2N/gAAIABJREFUeJzt3XlclPX+Pv5rxAVRVLJciiIscRmZGcQF3GBM0UL9YCGKlhLuaZj9VNRCLS1LPWrmOfTT3FqRMI+e1DITcsMjLrhAKqckJTcwwAXZX98/bhlZZmBGkM3r+XjMg2Xuue83dDxzcd/v+32pRARERET0aKtT1QMgIiKiqsdAQERERAwERERExEBAREREYCAgIiIiMBAQERERgLqlPTlw4EBJSUmprLEQERHRQ3Ts2LGfRGSgsedKDQQpKSk4evTowxkVERERVSqVSvW4qed4yYCIiIgYCIiIiIiBgIiIiFDGHAIiouogJycHSUlJyMzMrOqhENUI1tbWsLe3R7169cx+DQMBEVV7SUlJsLW1xbPPPguVSlXVwyGq1kQEN27cQFJSEhwdHc1+HS8ZEFG1l5mZiebNmzMMEJlBpVKhefPmFp9RYyAgohqBYYDIfA/y74WBgIhqpbg4oFMn5WNtl5iYiG+++cai13z44YcPdKyVK1ciIyPjgV5L1RsDARHVOnfuAC+9BMTHA97eyte1WWUFgry8PAaCWoyBgIhqncBA4Pp1QAS4dg0YO7Z8+7tz5w68vb2h1WrRqVMnbN68GQBw7NgxeHh4wNXVFQMGDMCVK1cAADExMdBoNHB3d8fMmTPRqVMnAMDGjRvh4+ODwYMHw9HREatXr8by5cvh4uICNzc3/P333wCA33//HQMHDoSrqyt69+6Ns2fPAgACAgIQFBSEHj16oE2bNoiIiAAAzJ49G/v374dOp8OKFSuKjP3KlSvo06cPdDodOnXqhP3792P27Nm4e/cudDodRo0aBQDw8fGBq6sr1Go11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qztrbGjRs3GAqIzCAiuHHjhsVLGnNSIRFVe/b29khKSkJycnJVD4WoRrC2toa9vb1Fr2EgIKJqr169enB0dKzqYRDVarxkQERERAwERERExEBAREREYCAgIiIiMBAQERERGAiIiIgIDAREREQEBgIiIiICAwERERGBgYCIiIjAQEBERERgICAiIiIwEBAREREYCIiIiAgMBERERAQGAiIiIgIDAREREYGBgIiIiMBAQERERGAgICIiIjAQEBERERgIiIiICAwEREREBAYCIiIiAgMBERERgYGAiIiIwEBAREREYCAgIiIiMBAQERERGAiIiIgIDAREREQEBgIiIiICAwERERGBgYCIiIjAQEBERERgICAiIiIwEBAREREYCIiIiAgMBERERAQGAiIiIgIDAREREYGBgIiIiMBAQERERGAgICIiIjAQEBERERgIiIiICAwEREREBAYCIiIiAgMBERERgYGAiIiIwEBAREREYCAgIiIiMBAQERERGAiIiIgIDAREREQEBgIiIiICAwERERGBgYCIiIjAQEBERERgICAiIiIwEBAREREYCIiIiAgMBERERAQGAiIiIgIDAREREYGBgIiIiMBAQERERGAgICIiIjAQEBERERgIiIiICAwEREREBAYCIiIiAgMBERERgYGAiIiIwEBAREREYCAgIiIiMBAQERERGAiIiIgIDAREREQEBgIiIiICAwERERGBgYCIiIjAQEBERERgICAiIiIwEBAREREYCIiIiAgMBERERAQGAiIiIgIDAREREYGBgIiIiMBAQERERGAgICIiIjAQEBERERgIiIiICAwEREREBAYCIiIiAgMBERERgYGAiIiIwEBAREREYCAgIiIiMBAQERERGAiIiIgIDAREREQEBgIiIiICAwERERGBgYCIiIjAQEBERERgICAiIiIwEBAREREYCIiIiAgMBERERAQGAiIiIgIDAREREYGBgIiIiMBAQERERGAgICIiIjAQEBERERgIiIiICAwEREREBAYCIiIiAgMBERERAVCJiOknVaqjlTgWIiIierhSRGSgsSdKDQRERET0aOAlAyIiImIgICIiIgYCIiIiAgMBERERgYGAiIiIAPw/AlqVGnGkv/gAAAAASUVORK5CYII=\n",
"text/plain": [
"<Figure size 648x648 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"import cartopy.crs as ccrs\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"\n",
"\n",
"def points_to_verts(points):\n",
" return np.array([[point['x'], point['y']] for point in points])\n",
"\n",
"\n",
"def visualise_iteration(line_start, line_end, source, dest):\n",
" interp = TraceTesting.interpolator(source, dest)\n",
"\n",
" plt.figure(figsize=(9, 9))\n",
" ax = plt.axes(projection=dest)\n",
" \n",
" verts = points_to_verts([line_start, line_end])\n",
"\n",
" # Plot these geodetic vertices, and figure out how to\n",
" # interpolate it & cut it just right.\n",
" ax.plot(\n",
" verts[:, 0], verts[:, 1],\n",
" transform=source, color='blue', lw=1)\n",
"\n",
" p0 = TraceTesting.interp_prj_pt(interp, line_start)\n",
" ax.plot(p0['x'], p0['y'],\n",
" marker='d',\n",
" color='blue',\n",
" transform=dest, label='segment start')\n",
"\n",
" i, good = 1.0, False\n",
" while i > 0 and not good:\n",
" good = TraceTesting.straight_and_within(\n",
" line_start, line_end, 0.0, i,\n",
" interp, threshold, dest.domain\n",
" )\n",
" p1 = TraceTesting.interp_t_pt(interp, line_start, line_end, i)\n",
" ax.plot(p1['x'], p1['y'],\n",
" marker='o' if good else 'x', markersize=(1-i)*10 + 3,\n",
" color='blue' if good else 'red',\n",
" transform=dest, label=f'segment straight enough @ t={i:.1f}' if good else f'{i:.1f} not straight enough')\n",
" i -= 0.1\n",
"\n",
" plt.legend()\n",
" ax.set_global()\n",
"\n",
"ax = visualise_iteration({'x': 60, 'y': 50}, {'x': 180, 'y': 50}, source, dest)\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The fact that the \"straightness\" metric is based on both source and projected coordinate systems is a key piece of being able to identify wrap-arounds and cuts.\n",
"The following short line segment demonstrates this clearly:"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAgQAAAEJCAYA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JhXv37pXH49H48eO1detWLVy4UJI0f/58ud1uPfzww8rIyJDP55Pb7dayZcuUkpLS6bbmz5+v++67j5MKhyBHV4ecJkyYYAcPHuzD4QBAe//5z3902223BbVOUZE0a5a0aZPkcl2mgXXizJkzGj58uCTpqaee0smTJ/WHP/yhbweBK15HvzcOh6PQzCZ0tDznEAAYklwu6ejR/tn29u3btXLlSvl8PsXFxenll1/un4EAQSAIAOAbNmvWLM2aNau/hwEEhXMIAAAAQQAAAAgCAAAgggAAAIggAIBBry+nP3700UdVXFzc5TJz5swJTLzUWm/G2VdaPibaE++8846ysrKUmJgor9erNWvWqKmpqcNlDx06pB07dgQ1lpycHI0cOTIwKVZHzEx5eXm6+eab5Xa7A39w6lIQBAAwyH2TQWBmar54MohW/vSnP2ncuHFBbavFQA6Cnlq7dq2eeeYZrVy5UkeOHNGePXtUV1enH//4xx3+KeneBMGcOXP097//vctldu7cqZKSEpWUlGjdunV67LHHgtpGRwgCAENSQYG0cqX/+lIN9emPy8rKdNttt2nBggW6/fbbdeLECT322GOaMGGCXC6XnnjiicDzpaWlqeUP1q1fv15jx45VWlqacnNz9Ytf/CKw3Pvvvx/UOCXp2Wef1R133CG32x3YZsvYcnNz5XK5NHXqVNXX10vy72xTUlLkdrs1ffr0wDwSrcdYXV2tMWPGSJLq6ur0ox/9SG63W7NmzdLEiRPV+o/v/frXv1ZSUpJSUlI6nDiqpKREmzdv1ltvvRX4N42MjNTSpUt16623tjsq0tDQoOXLl2vTpk3yeDyBn5vuTJ48Wddcc02Xy7zxxht65JFH5HA4lJKSotra2sDPX691Ng2iMf0xgAEimOmPU1PNPJ4LUyCHhPhvd7X8lT79cWlpqTkcDisoKAjc1zIdss/ns9TUVDt8+LCZmaWmptqBAwfss88+s7i4OKupqbGGhga766677Oc//3mvx7lr1y7Lzc215uZma2pqsszMTHvvvfestLTUQkND7d///reZmc2cOdNeeeUVMzNLTEy0vXv3mpnZsmXLbOH//iFbxmhmVlVVZXFxcWZm9uyzz9r8+f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BAAAARBAAAAARBAAAQAQBAAAQQQAAAEQQAAAAEQQAAEAEAQAAEEEAAABEEAAAABEEAABABAEAABBBAAAARBAAAAARBAAAQAQBAAAQQQAAAEQQAAAAEQQAAEAEAQAAEEEAAABEEAAAABEEAABABAEAABBBAAAARBAAAAARBAAAQAQBAAAQQQAAAEQQAAAAEQQAAEAEAQAAEEEAAABEEAAAAEkOM+v8QYfjYB+OBQAAXF7VZpbR0QNdBgEAALgy8JYBAAAgCAAAAEEAAABEEAAAABEEAABA0v8DIIffuYlTOCcAAAAASUVORK5CYII=\n",
"text/plain": [
"<Figure size 648x648 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAgQAAAEJCAYAAADrdD/VAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvDW2N/gAAIABJREFUeJzt3X98zvXi//HHzI+F+ZFDqbFGIbNr18yPTdguCTV8psNYCk3kR1F9zdBhnH7o4CA5h1sS6tZpRD45oSPZQuYYWrEl+8iSOGzaxmJs8/r+cbWrzX5jPzjP++22264fr+v9el3rdnU9va/39X46GWMQERGR/241qnoBIiIiUvUUCERERESBQERERBQIREREBAUCERERQYFAREREgJol3dmvXz+TmppaWWsRERGRCnTgwIF/GWP6FXVfiYEgNTWV/fv3V8yqREREpFI5OTn9obj79JGBiIiIKBCIiIiIAoGIiIigQCAiIiIoEIiIiAgKBCIiIoICgYiIiKBAICIiIigQiIiICAoEIiIiggKBiIiIoEAgIiIiKBCIiIgICgQiIiKCAoGIiIigQCAiIiIoEIiIiAgKBCIiIoICgYiIiKBAICIiIigQiIiICAoEIiIiggKBiIiIoEAgIiIiKBCIiIgICgQiIiKCAoGIiIigQCAiIiIoEIiIiAgKBCIiIoICgYi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9v6bRd8yEBERqXglBYJqcerievXsxxK0bw+bNysMiIiIVLZyfe2wInl6wuHDVb0KERGR/07VYg+BiIiIVC0FAhEREVEgEBEREQUCERERQYFAREREUCAQERERFAhEREQEBQIRERFBgUBERERQIBAREREUCERERAQFAhEREUGBQERERFAgEBERERQIREREBAUCERERQYFAREREUCAQERERFAhEREQEBQIRERFBgUBERERQIBAREREUCERERAQFAhEREUGBQERERFAgEBERERQIREREBAUCERERQYFAREREUCAQERERFAhEREQEBQIRERFBgUBERERQIBAREREUCERERAQFAhEREUGBQERERFAgEBERERQIREREBAUCERERQYFAREREUCAQERERFAhEREQEBQIRERFBgUBERERQIBAREREUCERERAQFAhEREUGBQERERFAgEBERERQIREREBAUCERERQYFAREREUCAQERERFAhEREQEBQIRERFBgUBERERQIBAREREUCERERAQFAhEREUGBQERERFAgEBERERQIREREBAUCERERQYFAREREUCAQERERFAhEREQEBQIRERFBgUBERERQIBAREREUCERERAQFAhEREUGBQERERFAgEBERERQIREREBAUCERERQYFAREREgJrlfUB2djYnT54kKyurItYjcltycXHBzc2NWrVqVfVSRESKVO5AcPLkSVxdXbnvvvtwcnKqiDWJ3FaMMZw7d46TJ0/i4eFR1csRESlSuT8yyMrKokmTJgoDImXk5OREkyZNtFdNRKq16zqGQGFApHz0mhGR6q5SDipMSIAOHey/b3fJycn84x//KNdjXn/99euaa/HixVy8ePG6HisiIpJfhQeCX3+Fxx6DxEQICrJfv51VViDIzc1VIBARkZumwgNBWBicPQvGwJkzMHr0jW3v119/JSgoCG9vbzp06MDatWsBOHDgAAEBAfj6+tK3b19Onz4NQFxcHBaLBX9/f8LDw+nQoQMAq1evJjg4mAEDBuDh4cHSpUtZuHAhPj4++Pn58csvvwBw7Ngx+vXrh6+vLz169ODIkSMAjBo1ikmTJtGtWzdatWrF+vXrAZg2bRq7du3CarWyaNGiAms/ffo0PXv2xGq10qFDB3bt2sW0adO4dOkSVquV4cOHAxAcHIyvry+enp68/fbbjsfXr1+fWbNm0bVrV1577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CTbtm2jY8eObN26lebNm+Pq6lri+otbJ8AHH3zAypUr8fb2xtPTs9SDMgcNGoTFYsHb25tevXoxb9487r77blq0aEFISIjjoxIfHx8A7rjjDv7+97/Tr18/unfvzl133aX6YxGRak71x7eAy5cv4+zsTM2aNYmNjWX8+PHF7vKvLvLqj40xTJw4kQceeIAXX3yxqpdVpfTaEZGqpvrjW9yJEycICQnh6tWr1K5dmxUrVlT1kkq1YsUK1qxZw5UrV/Dx8eHZZ5+t6iWJiEgJtIdApJLotSMiVa2kPQS35KmLRURE5OZSIBAREREFAhEREVEgEBEREW7RQFCW+mOAdevW0b59ezw9PXniiSduytyqP74xqj8WEamebtv646SkJObOnctXX31FQkICi8tymuUyUP2xiIjcjm7b+uMVK1YwceJERxFQs2bNCo1R/bHqj0VE5DfF1SCaW7z++H/+539MeHi46datm+natavZunVroTGqP1b9cWVS/bGIVDX+G+uPc3JySEpKIiYmhpMnT9KjRw8OHz5Mo0aNCoxT/bHqj0VE5DauP3Zzc8PPz49atWrh4eFB27ZtSUpKovM1H1eo/rj47RnVH4uI/Ne4beuPg4ODif5tntTUVI4ePUqrVq3KNIfqjwtS/bGIyO3vtq0/7tu3L02aNKF9+/bYbDbmz59PkyZNyjyP6o9/p/pjEZHbn8qNbgGqP7496LUjIlVN9ce3ONUfi4hIRdMeApFKoteOiFQ11R+LiIhIiRQIRERERIFAREREFAhERESECg4EmZn2ExM2bQo1ath/R0bab79dJScn849//KNcj3n99deva65nnnmmyKbH/EaNGuUoKcrvetZZWerXr1/msTt27GDAgAF4eXnh7+/P4sWLiz2fQ3x8PFu2bCnXWspStb169WqaNm2K1WrFarXyzjvvlGsOEZHqoMICQWYm+PnZm45TU8EY++958+y3366h4GYGAmNMgVMDX+udd96hffv25ZorT3UOBGW1bNky5s2bx9y5czl06BDbt2/n4sWLDBs2rMjTJ5c3EJS1ahtg6NChxMfHEx8fzzPPPHPdz0lEpKpUWCCYPx+OHYPfTm/vkJVlv33+/Ovb7q+//kpQUBDe3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QVy6dAlfX1/S09NJSEigfv36hIWFFXqMzWYjMTGxzAcVlrVqe8mSJXh6euLt7c2SJUtYvXp1mZ+HiEh1UaHlRpmZ9m8TLFsG585Bkyb2PQPh4VCOr5rfkLwaXoA33niD06dP8+abb1bO5JUo73nm5OQwaNAgwsLCGDRoUFUvq1i5ublkZ2fj4uLCsWPHePjhhzl69Ci1a9cu8zYWLFhAbGwsixYtomXLlly6dImPP/6Ynj170qJFiwpc/fVRuZGIVLUqqz+uXx/mzLH/VJXNmzczd+5ccnJycHd3v23/9TZ79my2b99OVlYWffr0ITg4uKqXVKKLFy9is9nIzs7GGMOyZcvKFQbAvvdhy5YtjBkzhrNnz9KwYUNCQ0O59957K2jVIiK3L9Ufi1QSvXZEpKqp/lhERERKdF2BoCxfXROR3+k1IyLVXbkDgYuLC+fOndP/4ETKyBjDuXPncCnue7giItVAuQ8qdHNz4+TJk6SkpFTEekRuSy4uLri5uVX1MkREilXuQFCrVi08PDwqYi0iIiJSRXRQoYiIiCgQiIiIiAKBiIiIUMqJiZycnPYXe6eIiIjcalKNMf2KuqPEQCAiIiL/HfSRgYiIiCgQiIiIiAKBiIiIoEAgIiIiKBCIiIgI8P8Br3y82svj/LUAAAAASUVORK5CYII=\n",
"text/plain": [
"<Figure size 648x648 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"visualise_iteration({'x': 20, 'y': 50}, {'x': -20, 'y': 50}, source, ccrs.PlateCarree())\n",
"visualise_iteration({'x': 20, 'y': 50}, {'x': -20, 'y': 50}, source, ccrs.PlateCarree(180))\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Is is now obvious that one input line segment may produce multiple projected line segments. Some of these will be connected to one another, while others will be entirely disjoint.\n",
"\n",
"To identify the salient projected segments we perform successive binary searches. The cartopy implementation searches for the first t after t_min that would produce an appropriately straight segment. In pseudo code, one of these binary searches does the following:"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Bisecting from 0.15 to (0.15 .. 1.0)\n",
"Bisecting from 0.15 to (0.15 .. 0.575)\n",
"Bisecting from 0.15 to (0.3625 .. 0.575)\n",
"Bisecting from 0.15 to (0.46875 .. 0.575)\n",
"Bisecting from 0.15 to (0.46875 .. 0.521875)\n",
"Bisecting from 0.15 to (0.4953125 .. 0.521875)\n",
"Bisecting from 0.15 to (0.4953125 .. 0.50859375)\n",
"Bisecting from 0.15 to (0.4953125 .. 0.501953125)\n",
"Bisecting from 0.15 to (0.4986328125 .. 0.501953125)\n",
"Bisecting from 0.15 to (0.4986328125 .. 0.50029296875)\n",
"\n",
"First cut t from 0.15 is in range (0.499462890625 .. 0.50029296875)\n"
]
}
],
"source": [
"def bisect(line_start, line_end, t_start, interpolator, threshold, domain, DEBUG=True):\n",
" \"\"\"\n",
" The objective of this function is to find a range of t values which\n",
" contain a value of t that maximises the length of the straight line segment.\n",
" \"\"\"\n",
" # Track the min and max of t_current\n",
" t_min = t_start\n",
" t_max = 1.0\n",
" t_current = (t_min + t_max) * 0.5\n",
" \n",
" # Iterate until we have a particular confidence in t_current.\n",
" while t_max - t_min > 1e-3:\n",
" if DEBUG: print(f'Bisecting from {t_start} to ({t_min} .. {t_max})')\n",
" \n",
" # Determine if the current value of t_current produces a good\n",
" # line based on the straightness criteria.\n",
" good = TraceTesting.straight_and_within(\n",
" line_start, line_end, t_start, t_current,\n",
" interpolator, threshold, domain\n",
" )\n",
" # The line was good, so we could potentially grow it a\n",
" # little to get a longer straight line.\n",
" if good:\n",
" t_min = t_current\n",
" else:\n",
" t_max= t_current\n",
" t_current = (t_min + t_max) * 0.5\n",
"\n",
" return t_min, t_max\n",
"\n",
"t_start = 0.15\n",
"t_min, t_max = bisect(\n",
" {'x': 20, 'y': 50}, {'x': -20, 'y': 50},\n",
" t_start, interp, threshold, dest.domain)\n",
"print()\n",
"print(f'First cut t from {t_start} is in range ({t_min} .. {t_max})')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Finally, let's implement the full segment splitting in pseudo code:"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[[0.0, 0.5], [0.5009765625, 0.9990253448486328], []]\n"
]
}
],
"source": [
"import shapely.geometry as sgeom\n",
"segments = [[]]\n",
"\n",
"t_current = 0.0\n",
"\n",
"def point_inside(point, region):\n",
" p = TraceTesting.interp_t_pt(interp, line_start, line_end, t_min)\n",
" t_min_inside = dest.domain.contains(sgeom.Point([p['x'], p['y']]))\n",
"\n",
"\n",
"line_start, line_end = {'x': 20, 'y': 50}, {'x': -20, 'y': 50}\n",
"while t_current < 1:\n",
" t_min, t_max = bisect(\n",
" line_start, line_end,\n",
" t_current, interp, threshold, dest.domain, DEBUG=False)\n",
"\n",
" p_min = TraceTesting.interp_t_pt(\n",
" interp, line_start, line_end, t_min)\n",
" t_min_inside = dest.domain.covers(\n",
" sgeom.Point([p_min['x'], p_min['y']]))\n",
" \n",
" p_current = TraceTesting.interp_t_pt(\n",
" interp, line_start, line_end, t_current)\n",
" t_current_inside = dest.domain.covers(\n",
" sgeom.Point([p_current['x'], p_current['y']]))\n",
"\n",
" if t_min_inside:\n",
" if not segments[-1]: # add_point if empty.\n",
" segments[-1].append(t_current)\n",
" if t_min == t_current:\n",
" # Our confidence range hasn't moved on. So we need to jump on to the next segment.\n",
" t_current = t_max\n",
" if t_current_inside:\n",
" segments.append([])\n",
" else:\n",
" # We have refined a new segment, so let's add it and move on.\n",
" segments[-1].append(t_min)\n",
" t_current = t_min\n",
" else: # NB: in the actual implementation we also handle NANs.\n",
" if t_min != t_current:\n",
" t_current = t_min\n",
" else:\n",
" t_current = t_max\n",
" if t_current_inside:\n",
" lines.new_line()\n",
"\n",
"print(segments)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.