diff --git a/docs_src/notebooks/fractopo_validation_2.ipynb b/docs_src/notebooks/fractopo_validation_2.ipynb index e84ad49..41be8a1 100644 --- a/docs_src/notebooks/fractopo_validation_2.ipynb +++ b/docs_src/notebooks/fractopo_validation_2.ipynb @@ -33,7 +33,9 @@ "\n", "import geopandas as gpd\n", "from fractopo import Validation\n", - "import matplotlib.pyplot as plt" + "import matplotlib.pyplot as plt\n", + "from shapely.geometry import box\n", + "import numpy as np" ] }, { @@ -134,7 +136,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "The KB7 dataset contains the above errors of which `MULTI JUNCTION` and `TRACE UNDERLAPS TARGET AREA` are disruptive in further analysis.\n", + "The KB7 dataset contains the above errors of which `MULTI JUNCTION`, `V NODE`, `STACKED TRACES` and `TRACE UNDERLAPS TARGET AREA` are disruptive in further analysis.\n", "\n", "See documentation: https://nialov.github.io/fractopo/validation/errors.html" ] @@ -143,7 +145,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Visualization of errors in notebook\n", + "## Visualization of `MULTI JUNCTION` and `TRACE UNDERLAPS TARGET AREA` errors in notebook\n", "\n", "Though visualization here is possible, GIS-software (e.g. QGIS, ArcGIS) are much more interactive and are recommended for actual fixing and further error inspection." ] @@ -161,13 +163,23 @@ "metadata": {}, "outputs": [], "source": [ - "# Find MULTI JUNCTION erroneous traces in GeoDataFrame\n", - "kb7_multijunctions = kb7_validated.loc[\n", - " [\"MULTI JUNCTION\" in err for err in kb7_validated[kb7_validation.ERROR_COLUMN]]\n", + "are_in_box = kb7_validated.intersects(box(466020, 6692090, 466030, 6692105))\n", + "are_multi_junction = [\n", + " \"MULTI JUNCTION\" in err for err in kb7_validated[kb7_validation.ERROR_COLUMN]\n", "]\n", + "kb7_multijunctions = kb7_validated.loc[np.logical_and(are_in_box, are_multi_junction)]\n", "kb7_multijunctions" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "kb7_multijunctions.plot()" + ] + }, { "cell_type": "code", "execution_count": null, @@ -193,25 +205,6 @@ "Additionally the orange trace has a dangling end instead of being accurately snapped to the black trace. " ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Example fix for blue and green traces\n", - "from shapely.ops import linemerge\n", - "\n", - "gpd.GeoSeries(\n", - " [\n", - " linemerge(\n", - " [kb7_multijunctions.geometry.iloc[4], kb7_multijunctions.geometry.iloc[2]]\n", - " ),\n", - " kb7_multijunctions.geometry.iloc[0],\n", - " ]\n", - ").plot(colors=[\"green\", \"red\"])" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -261,13 +254,6 @@ "source": [ "The plot shows that the trace underlaps the target area at least on the northern end and maybe on the southern end. The fix is implemented by extending the trace to meet the target area boundary." ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { @@ -286,7 +272,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.18" + "version": "3.12.5" } }, "nbformat": 4,