From 36969944014012851aeda34e2bc06ee08c73da19 Mon Sep 17 00:00:00 2001 From: Michael Grund <23025878+michaelgrund@users.noreply.github.com> Date: Tue, 24 Dec 2024 15:45:35 +0100 Subject: [PATCH 01/17] Update gpd lines gallery example --- examples/gallery/lines/rivers.py | 28 +++++++++++++++++++ examples/gallery/lines/roads.py | 46 -------------------------------- 2 files changed, 28 insertions(+), 46 deletions(-) create mode 100644 examples/gallery/lines/rivers.py delete mode 100644 examples/gallery/lines/roads.py diff --git a/examples/gallery/lines/rivers.py b/examples/gallery/lines/rivers.py new file mode 100644 index 00000000000..4957773d2bb --- /dev/null +++ b/examples/gallery/lines/rivers.py @@ -0,0 +1,28 @@ +# ruff: noqa: RUF003 +""" +Rivers +===== + +The :meth:`pygmt.Figure.plot` method allows us to plot geographical data such +as lines which are stored in a :class:`geopandas.GeoDataFrame` object. Use +:func:`geopandas.read_file` to load data from any supported OGR format such as +a shapefile (.shp), GeoJSON (.geojson), geopackage (.gpkg), etc. Then, pass the +:class:`geopandas.GeoDataFrame` as an argument to the ``data`` parameter of +:meth:`pygmt.Figure.plot`, and style the geometry using the ``pen`` parameter. +""" + +# %% +import geopandas as gpd +import pygmt + +# Read shapefile data using geopandas +gpd_lines = gpd.read_file( + "https://www.eea.europa.eu/data-and-maps/data/wise-large-rivers-and-large-lakes/zipped-shapefile-with-wise-large-rivers-vector-line/zipped-shapefile-with-wise-large-rivers-vector-line/at_download/file/" + \ + "wise_large_rivers.zip" +) + + + + + + diff --git a/examples/gallery/lines/roads.py b/examples/gallery/lines/roads.py deleted file mode 100644 index c2a5f69980a..00000000000 --- a/examples/gallery/lines/roads.py +++ /dev/null @@ -1,46 +0,0 @@ -# ruff: noqa: RUF003 -""" -Roads -===== - -The :meth:`pygmt.Figure.plot` method allows us to plot geographical data such -as lines which are stored in a :class:`geopandas.GeoDataFrame` object. Use -:func:`geopandas.read_file` to load data from any supported OGR format such as -a shapefile (.shp), GeoJSON (.geojson), geopackage (.gpkg), etc. Then, pass the -:class:`geopandas.GeoDataFrame` as an argument to the ``data`` parameter of -:meth:`pygmt.Figure.plot`, and style the geometry using the ``pen`` parameter. -""" - -# %% -import geopandas as gpd -import pygmt - -# Read shapefile data using geopandas -gdf = gpd.read_file( - "https://www2.census.gov/geo/tiger/TIGER2015/PRISECROADS/tl_2015_15_prisecroads.zip" -) -# The dataset contains different road types listed in the RTTYP column, -# here we select the following ones to plot: -roads_common = gdf[gdf.RTTYP == "M"] # Common name roads -roads_state = gdf[gdf.RTTYP == "S"] # State recognized roads -roads_interstate = gdf[gdf.RTTYP == "I"] # Interstate roads - -fig = pygmt.Figure() - -# Define target region around Oʻahu (Hawaiʻi) -region = [-158.3, -157.6, 21.2, 21.75] # xmin, xmax, ymin, ymax - -title = "Main roads of O`ahu (Hawai`i)" # Approximating the Okina letter ʻ with ` -fig.basemap(region=region, projection="M12c", frame=["af", f"WSne+t{title}"]) -fig.coast(land="gray", water="dodgerblue4", shorelines="1p,black") - -# Plot the individual road types with different pen settings and assign labels -# which are displayed in the legend -fig.plot(data=roads_common, pen="5p,dodgerblue", label="CommonName") -fig.plot(data=roads_state, pen="2p,gold", label="StateRecognized") -fig.plot(data=roads_interstate, pen="2p,red", label="Interstate") - -# Add legend -fig.legend() - -fig.show() From c6bfba46e6a7947bbac2508540adab3a78ed7cf6 Mon Sep 17 00:00:00 2001 From: Michael Grund Date: Tue, 24 Dec 2024 15:53:56 +0100 Subject: [PATCH 02/17] update --- examples/gallery/lines/rivers.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/examples/gallery/lines/rivers.py b/examples/gallery/lines/rivers.py index 4957773d2bb..ed2d4b93659 100644 --- a/examples/gallery/lines/rivers.py +++ b/examples/gallery/lines/rivers.py @@ -19,7 +19,29 @@ gpd_lines = gpd.read_file( "https://www.eea.europa.eu/data-and-maps/data/wise-large-rivers-and-large-lakes/zipped-shapefile-with-wise-large-rivers-vector-line/zipped-shapefile-with-wise-large-rivers-vector-line/at_download/file/" + \ "wise_large_rivers.zip" -) +) + +gpd_lines.crs +# Convert to EPSG 4326 +gpd_lines_new = gpd_lines.to_crs("EPSG:4326") +gpd_lines_new + +# ----------------------------------------------------------------------------- +fig = pygmt.Figure() + +fig.coast( + projection="M10c", + region=[-10, 30, 35, 57], + resolution="l", + land="gray99", + shorelines="1/0.1p,gray50", + borders="1/0.1,gray30", + frame=True, +) + +fig.plot(data=gpd_lines_new, pen="0.5p,steelblue") + +fig.show() From 8c5bfa8cf132b4b5696694a46fc8e062f2799ff8 Mon Sep 17 00:00:00 2001 From: Michael Grund Date: Wed, 25 Dec 2024 12:26:39 +0100 Subject: [PATCH 03/17] update name --- examples/gallery/lines/{rivers.py => linestrings.py} | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename examples/gallery/lines/{rivers.py => linestrings.py} (85%) diff --git a/examples/gallery/lines/rivers.py b/examples/gallery/lines/linestrings.py similarity index 85% rename from examples/gallery/lines/rivers.py rename to examples/gallery/lines/linestrings.py index ed2d4b93659..a317f61de5e 100644 --- a/examples/gallery/lines/rivers.py +++ b/examples/gallery/lines/linestrings.py @@ -1,6 +1,6 @@ # ruff: noqa: RUF003 """ -Rivers +Plotting lines with LineString/MultiLineString geometry ===== The :meth:`pygmt.Figure.plot` method allows us to plot geographical data such @@ -22,24 +22,24 @@ ) gpd_lines.crs -# Convert to EPSG 4326 +# Convert object to EPSG 4326 coordinate system gpd_lines_new = gpd_lines.to_crs("EPSG:4326") gpd_lines_new -# ----------------------------------------------------------------------------- fig = pygmt.Figure() fig.coast( projection="M10c", region=[-10, 30, 35, 57], resolution="l", - land="gray99", + land="gray95", shorelines="1/0.1p,gray50", borders="1/0.1,gray30", frame=True, ) -fig.plot(data=gpd_lines_new, pen="0.5p,steelblue") +# Add rivers to map +fig.plot(data=gpd_lines_new, pen="1p,steelblue") fig.show() From d222759b4041a982e730e88ba2da2ec1b057916f Mon Sep 17 00:00:00 2001 From: Michael Grund <23025878+michaelgrund@users.noreply.github.com> Date: Thu, 26 Dec 2024 12:17:51 +0100 Subject: [PATCH 04/17] Apply suggestions from code review Co-authored-by: Dongdong Tian --- examples/gallery/lines/linestrings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/gallery/lines/linestrings.py b/examples/gallery/lines/linestrings.py index a317f61de5e..47b7a645849 100644 --- a/examples/gallery/lines/linestrings.py +++ b/examples/gallery/lines/linestrings.py @@ -1,7 +1,7 @@ # ruff: noqa: RUF003 """ Plotting lines with LineString/MultiLineString geometry -===== +======================================================= The :meth:`pygmt.Figure.plot` method allows us to plot geographical data such as lines which are stored in a :class:`geopandas.GeoDataFrame` object. Use From 47dabbc540fa009172ac92da4469b5c3b6e4d8ca Mon Sep 17 00:00:00 2001 From: Michael Grund <23025878+michaelgrund@users.noreply.github.com> Date: Thu, 26 Dec 2024 12:18:01 +0100 Subject: [PATCH 05/17] Apply suggestions from code review Co-authored-by: Dongdong Tian --- examples/gallery/lines/linestrings.py | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/gallery/lines/linestrings.py b/examples/gallery/lines/linestrings.py index 47b7a645849..07a158da7e3 100644 --- a/examples/gallery/lines/linestrings.py +++ b/examples/gallery/lines/linestrings.py @@ -1,4 +1,3 @@ -# ruff: noqa: RUF003 """ Plotting lines with LineString/MultiLineString geometry ======================================================= From 1dbebb57d5c1345369cef7fb11668edea0aa0193 Mon Sep 17 00:00:00 2001 From: Michael Grund Date: Thu, 26 Dec 2024 12:20:00 +0100 Subject: [PATCH 06/17] remove empty rows --- examples/gallery/lines/linestrings.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/examples/gallery/lines/linestrings.py b/examples/gallery/lines/linestrings.py index 07a158da7e3..ef35af746f9 100644 --- a/examples/gallery/lines/linestrings.py +++ b/examples/gallery/lines/linestrings.py @@ -1,6 +1,7 @@ +# ruff: noqa: RUF003 """ Plotting lines with LineString/MultiLineString geometry -======================================================= +===== The :meth:`pygmt.Figure.plot` method allows us to plot geographical data such as lines which are stored in a :class:`geopandas.GeoDataFrame` object. Use @@ -23,7 +24,6 @@ gpd_lines.crs # Convert object to EPSG 4326 coordinate system gpd_lines_new = gpd_lines.to_crs("EPSG:4326") -gpd_lines_new fig = pygmt.Figure() @@ -40,10 +40,4 @@ # Add rivers to map fig.plot(data=gpd_lines_new, pen="1p,steelblue") -fig.show() - - - - - - +fig.show() \ No newline at end of file From 17284c25a78f7fef8f74eb14d0c1f6057aa20370 Mon Sep 17 00:00:00 2001 From: Michael Grund Date: Thu, 26 Dec 2024 12:29:09 +0100 Subject: [PATCH 07/17] update --- examples/gallery/lines/linestrings.py | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/gallery/lines/linestrings.py b/examples/gallery/lines/linestrings.py index ef35af746f9..a378844198b 100644 --- a/examples/gallery/lines/linestrings.py +++ b/examples/gallery/lines/linestrings.py @@ -21,7 +21,6 @@ "wise_large_rivers.zip" ) -gpd_lines.crs # Convert object to EPSG 4326 coordinate system gpd_lines_new = gpd_lines.to_crs("EPSG:4326") From e4442a3f1b79a04a81296ee9134e87bcc7211fb4 Mon Sep 17 00:00:00 2001 From: Michael Grund Date: Thu, 26 Dec 2024 12:31:51 +0100 Subject: [PATCH 08/17] update --- examples/gallery/lines/linestrings.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/gallery/lines/linestrings.py b/examples/gallery/lines/linestrings.py index a378844198b..a9448e7edef 100644 --- a/examples/gallery/lines/linestrings.py +++ b/examples/gallery/lines/linestrings.py @@ -17,8 +17,7 @@ # Read shapefile data using geopandas gpd_lines = gpd.read_file( - "https://www.eea.europa.eu/data-and-maps/data/wise-large-rivers-and-large-lakes/zipped-shapefile-with-wise-large-rivers-vector-line/zipped-shapefile-with-wise-large-rivers-vector-line/at_download/file/" + \ - "wise_large_rivers.zip" + "https://www.eea.europa.eu/data-and-maps/data/wise-large-rivers-and-large-lakes/zipped-shapefile-with-wise-large-rivers-vector-line/zipped-shapefile-with-wise-large-rivers-vector-line/at_download/file/wise_large_rivers.zip" ) # Convert object to EPSG 4326 coordinate system From 97aaa81cd5b869bec3a43d5c18a8d8d273af0d46 Mon Sep 17 00:00:00 2001 From: actions-bot <58130806+actions-bot@users.noreply.github.com> Date: Thu, 26 Dec 2024 11:33:02 +0000 Subject: [PATCH 09/17] [format-command] fixes --- examples/gallery/lines/linestrings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/gallery/lines/linestrings.py b/examples/gallery/lines/linestrings.py index a9448e7edef..49ede55f49a 100644 --- a/examples/gallery/lines/linestrings.py +++ b/examples/gallery/lines/linestrings.py @@ -38,4 +38,4 @@ # Add rivers to map fig.plot(data=gpd_lines_new, pen="1p,steelblue") -fig.show() \ No newline at end of file +fig.show() From 736e519bb02c614ce76c869e39adc9444291cb2f Mon Sep 17 00:00:00 2001 From: Michael Grund Date: Thu, 26 Dec 2024 14:08:46 +0100 Subject: [PATCH 10/17] add data via geodatasets --- examples/gallery/lines/linestrings.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/examples/gallery/lines/linestrings.py b/examples/gallery/lines/linestrings.py index 49ede55f49a..2af933e5d65 100644 --- a/examples/gallery/lines/linestrings.py +++ b/examples/gallery/lines/linestrings.py @@ -1,7 +1,6 @@ -# ruff: noqa: RUF003 """ Plotting lines with LineString/MultiLineString geometry -===== +======================================================= The :meth:`pygmt.Figure.plot` method allows us to plot geographical data such as lines which are stored in a :class:`geopandas.GeoDataFrame` object. Use @@ -12,16 +11,15 @@ """ # %% +import geodatasets import geopandas as gpd import pygmt -# Read shapefile data using geopandas -gpd_lines = gpd.read_file( - "https://www.eea.europa.eu/data-and-maps/data/wise-large-rivers-and-large-lakes/zipped-shapefile-with-wise-large-rivers-vector-line/zipped-shapefile-with-wise-large-rivers-vector-line/at_download/file/wise_large_rivers.zip" -) +# Read shapefile data of large rivers in Europe using geopandas +gdf = gpd.read_file(geodatasets.get_path("eea large_rivers")) # Convert object to EPSG 4326 coordinate system -gpd_lines_new = gpd_lines.to_crs("EPSG:4326") +gpd = gpd.to_crs("EPSG:4326") fig = pygmt.Figure() @@ -36,6 +34,6 @@ ) # Add rivers to map -fig.plot(data=gpd_lines_new, pen="1p,steelblue") +fig.plot(data=gpd, pen="1p,steelblue") fig.show() From b3e0e278d1a2d614bdcdf05a33e687ec1e0374ac Mon Sep 17 00:00:00 2001 From: Michael Grund <23025878+michaelgrund@users.noreply.github.com> Date: Thu, 26 Dec 2024 17:58:25 +0100 Subject: [PATCH 11/17] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Yvonne Fröhlich <94163266+yvonnefroehlich@users.noreply.github.com> --- examples/gallery/lines/linestrings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/gallery/lines/linestrings.py b/examples/gallery/lines/linestrings.py index 2af933e5d65..ae6817c2423 100644 --- a/examples/gallery/lines/linestrings.py +++ b/examples/gallery/lines/linestrings.py @@ -19,7 +19,7 @@ gdf = gpd.read_file(geodatasets.get_path("eea large_rivers")) # Convert object to EPSG 4326 coordinate system -gpd = gpd.to_crs("EPSG:4326") +gdf = gdf.to_crs("EPSG:4326") fig = pygmt.Figure() From 223124106f54c4ed410edd8cb99f759e0abfae66 Mon Sep 17 00:00:00 2001 From: Michael Grund Date: Thu, 26 Dec 2024 18:12:41 +0100 Subject: [PATCH 12/17] fix typo --- examples/gallery/lines/linestrings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/gallery/lines/linestrings.py b/examples/gallery/lines/linestrings.py index ae6817c2423..5072a50d35f 100644 --- a/examples/gallery/lines/linestrings.py +++ b/examples/gallery/lines/linestrings.py @@ -34,6 +34,6 @@ ) # Add rivers to map -fig.plot(data=gpd, pen="1p,steelblue") +fig.plot(data=gdf, pen="1p,steelblue") fig.show() From d2dc0070d05b9b91136be8c046378f35a750d6d6 Mon Sep 17 00:00:00 2001 From: Michael Grund <23025878+michaelgrund@users.noreply.github.com> Date: Mon, 30 Dec 2024 18:23:51 +0100 Subject: [PATCH 13/17] Update linestrings.py --- examples/gallery/lines/linestrings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/gallery/lines/linestrings.py b/examples/gallery/lines/linestrings.py index 5072a50d35f..c9f2a87b202 100644 --- a/examples/gallery/lines/linestrings.py +++ b/examples/gallery/lines/linestrings.py @@ -1,6 +1,6 @@ """ -Plotting lines with LineString/MultiLineString geometry -======================================================= +GeoPandas: Plotting lines with LineString/MultiLineString geometry +================================================================== The :meth:`pygmt.Figure.plot` method allows us to plot geographical data such as lines which are stored in a :class:`geopandas.GeoDataFrame` object. Use From 8087c1c6afd30f22a2c4a1e742c81b048a476bcc Mon Sep 17 00:00:00 2001 From: Michael Grund <23025878+michaelgrund@users.noreply.github.com> Date: Mon, 30 Dec 2024 18:24:58 +0100 Subject: [PATCH 14/17] Apply suggestions from code review Co-authored-by: Dongdong Tian --- examples/gallery/lines/linestrings.py | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/gallery/lines/linestrings.py b/examples/gallery/lines/linestrings.py index c9f2a87b202..192d1c70e23 100644 --- a/examples/gallery/lines/linestrings.py +++ b/examples/gallery/lines/linestrings.py @@ -20,6 +20,7 @@ # Convert object to EPSG 4326 coordinate system gdf = gdf.to_crs("EPSG:4326") +print(gdf) fig = pygmt.Figure() From 72d2cc19c5a6318fa26a7737e13ffb5c5d363a1f Mon Sep 17 00:00:00 2001 From: Michael Grund <23025878+michaelgrund@users.noreply.github.com> Date: Mon, 30 Dec 2024 18:26:33 +0100 Subject: [PATCH 15/17] Wrap line to 88 chars --- examples/gallery/lines/linestrings.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/gallery/lines/linestrings.py b/examples/gallery/lines/linestrings.py index 192d1c70e23..087ccc206d2 100644 --- a/examples/gallery/lines/linestrings.py +++ b/examples/gallery/lines/linestrings.py @@ -2,12 +2,13 @@ GeoPandas: Plotting lines with LineString/MultiLineString geometry ================================================================== -The :meth:`pygmt.Figure.plot` method allows us to plot geographical data such -as lines which are stored in a :class:`geopandas.GeoDataFrame` object. Use -:func:`geopandas.read_file` to load data from any supported OGR format such as -a shapefile (.shp), GeoJSON (.geojson), geopackage (.gpkg), etc. Then, pass the -:class:`geopandas.GeoDataFrame` as an argument to the ``data`` parameter of -:meth:`pygmt.Figure.plot`, and style the geometry using the ``pen`` parameter. +The :meth:`pygmt.Figure.plot` method allows us to plot geographical data +such as lines which are stored in a :class:`geopandas.GeoDataFrame` object. +Use :func:`geopandas.read_file` to load data from any supported OGR format +such as a shapefile (.shp), GeoJSON (.geojson), geopackage (.gpkg), etc. +Then, pass the :class:`geopandas.GeoDataFrame` as an argument to the +``data`` parameter of :meth:`pygmt.Figure.plot`, and style the geometry +using the ``pen`` parameter. """ # %% From 573309c5e8c20d8171e2039d7e7f1431a08cc23a Mon Sep 17 00:00:00 2001 From: Michael Grund Date: Mon, 30 Dec 2024 18:38:42 +0100 Subject: [PATCH 16/17] rm trailing ws --- examples/gallery/lines/linestrings.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/gallery/lines/linestrings.py b/examples/gallery/lines/linestrings.py index 087ccc206d2..d6d0aaa0282 100644 --- a/examples/gallery/lines/linestrings.py +++ b/examples/gallery/lines/linestrings.py @@ -2,12 +2,12 @@ GeoPandas: Plotting lines with LineString/MultiLineString geometry ================================================================== -The :meth:`pygmt.Figure.plot` method allows us to plot geographical data -such as lines which are stored in a :class:`geopandas.GeoDataFrame` object. -Use :func:`geopandas.read_file` to load data from any supported OGR format -such as a shapefile (.shp), GeoJSON (.geojson), geopackage (.gpkg), etc. -Then, pass the :class:`geopandas.GeoDataFrame` as an argument to the -``data`` parameter of :meth:`pygmt.Figure.plot`, and style the geometry +The :meth:`pygmt.Figure.plot` method allows us to plot geographical data +such as lines which are stored in a :class:`geopandas.GeoDataFrame` object. +Use :func:`geopandas.read_file` to load data from any supported OGR format +such as a shapefile (.shp), GeoJSON (.geojson), geopackage (.gpkg), etc. +Then, pass the :class:`geopandas.GeoDataFrame` as an argument to the +``data`` parameter of :meth:`pygmt.Figure.plot`, and style the geometry using the ``pen`` parameter. """ From ac4b31d120b347b00ccfe51328c89b2a0511dce5 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Tue, 31 Dec 2024 23:42:15 +0800 Subject: [PATCH 17/17] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Yvonne Fröhlich <94163266+yvonnefroehlich@users.noreply.github.com> --- examples/gallery/lines/linestrings.py | 29 ++++++++++++++++----------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/examples/gallery/lines/linestrings.py b/examples/gallery/lines/linestrings.py index d6d0aaa0282..d3793645c84 100644 --- a/examples/gallery/lines/linestrings.py +++ b/examples/gallery/lines/linestrings.py @@ -1,14 +1,16 @@ """ -GeoPandas: Plotting lines with LineString/MultiLineString geometry -================================================================== - -The :meth:`pygmt.Figure.plot` method allows us to plot geographical data -such as lines which are stored in a :class:`geopandas.GeoDataFrame` object. -Use :func:`geopandas.read_file` to load data from any supported OGR format -such as a shapefile (.shp), GeoJSON (.geojson), geopackage (.gpkg), etc. -Then, pass the :class:`geopandas.GeoDataFrame` as an argument to the -``data`` parameter of :meth:`pygmt.Figure.plot`, and style the geometry -using the ``pen`` parameter. +GeoPandas: Plotting lines with LineString or MultiLineString geometry +===================================================================== + +The :meth:`pygmt.Figure.plot` method allows us to plot geographical data such as lines +with LineString or MultiLineString geometry types stored in a +:class:`geopandas.GeoDataFrame` object or any object that implements the +`__geo_interface__ `__ property. + +Use :func:`geopandas.read_file` to load data from any supported OGR format such as a +shapefile (.shp), GeoJSON (.geojson), geopackage (.gpkg), etc. Then, pass the +:class:`geopandas.GeoDataFrame` object as an argument to the ``data`` parameter of +:meth:`pygmt.Figure.plot`, and style the lines using the ``pen`` parameter. """ # %% @@ -16,13 +18,16 @@ import geopandas as gpd import pygmt -# Read shapefile data of large rivers in Europe using geopandas +# Read a sample dataset provided by the geodatasets package. +# The dataset contains large rivers in Europe, stored as LineString/MultiLineString +# geometry types. gdf = gpd.read_file(geodatasets.get_path("eea large_rivers")) # Convert object to EPSG 4326 coordinate system gdf = gdf.to_crs("EPSG:4326") -print(gdf) +print(gdf.head()) +# %% fig = pygmt.Figure() fig.coast(