prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  polygonize method no longer in use / use shapes instead?
  Hi,
  
  just going through the examples folders.
  If I ran the python interpreter on  `poligonize.py` it complains about a missing attribute:
  
  ```
  (venv)[] ~/Progetti/pyhton-usergroup/rasterio <master> ✗ python examples/polygonize.py
  sys:1: FutureWarning: read_band() is deprecated and will be removed by Rasterio 1.0. Please use read() instead.
  Traceback (most recent call last):
    File "examples/polygonize.py", line 10, in <module>
      list(ftrz.polygonize(image)))
  AttributeError: 'module' object has no attribute 'polygonize'
  ```
  
  But, going trough the commits history w/ @ligthyear it seems like instead of poligonize, one should use shapes.  
  If I ran it in fact with the new method it works smoothly
  
  ```
  pprint.pprint(
   list(ftrz.shapes(image)))
  ```
  
  Cheers
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `examples/polygonize.py`
  Content:
  ```
  1 import pprint
  2 
  3 import rasterio
  4 import rasterio._features as ftrz
  5 
  6 with rasterio.open('box.png') as src:
  7     image = src.read_band(1)
  8 
  9 pprint.pprint(
  10     list(ftrz.polygonize(image)))
  11
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/examples/polygonize.py b/examples/polygonize.py
  --- a/examples/polygonize.py
  +++ b/examples/polygonize.py
  @@ -1,10 +1,12 @@
   import pprint
   
   import rasterio
  -import rasterio._features as ftrz
  +from rasterio.features import shapes
   
  -with rasterio.open('box.png') as src:
  -    image = src.read_band(1)
  +with rasterio.open('tests/data/shade.tif') as src:
  +    image = src.read(1)
   
  +# Print the first two shapes...
   pprint.pprint(
  -    list(ftrz.polygonize(image)))
  +    list(shapes(image))[:2]
  +)
  
verification_info: {"golden_diff": "diff --git a/examples/polygonize.py b/examples/polygonize.py\n--- a/examples/polygonize.py\n+++ b/examples/polygonize.py\n@@ -1,10 +1,12 @@\n import pprint\n \n import rasterio\n-import rasterio._features as ftrz\n+from rasterio.features import shapes\n \n-with rasterio.open('box.png') as src:\n-    image = src.read_band(1)\n+with rasterio.open('tests/data/shade.tif') as src:\n+    image = src.read(1)\n \n+# Print the first two shapes...\n pprint.pprint(\n-    list(ftrz.polygonize(image)))\n+    list(shapes(image))[:2]\n+)\n", "issue": "polygonize method no longer in use / use shapes instead?\nHi,\n\njust going through the examples folders.\nIf I ran the python interpreter on  `poligonize.py` it complains about a missing attribute:\n\n```\n(venv)[] ~/Progetti/pyhton-usergroup/rasterio <master> \u2717 python examples/polygonize.py\nsys:1: FutureWarning: read_band() is deprecated and will be removed by Rasterio 1.0. Please use read() instead.\nTraceback (most recent call last):\n  File \"examples/polygonize.py\", line 10, in <module>\n    list(ftrz.polygonize(image)))\nAttributeError: 'module' object has no attribute 'polygonize'\n```\n\nBut, going trough the commits history w/ @ligthyear it seems like instead of poligonize, one should use shapes.  \nIf I ran it in fact with the new method it works smoothly\n\n```\npprint.pprint(\n list(ftrz.shapes(image)))\n```\n\nCheers\n\n", "before_files": [{"content": "import pprint\n\nimport rasterio\nimport rasterio._features as ftrz\n\nwith rasterio.open('box.png') as src:\n    image = src.read_band(1)\n\npprint.pprint(\n    list(ftrz.polygonize(image)))\n", "path": "examples/polygonize.py"}], "after_files": [{"content": "import pprint\n\nimport rasterio\nfrom rasterio.features import shapes\n\nwith rasterio.open('tests/data/shade.tif') as src:\n    image = src.read(1)\n\n# Print the first two shapes...\npprint.pprint(\n    list(shapes(image))[:2]\n)\n", "path": "examples/polygonize.py"}]}