prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  query params in https url is not working
  Hi 
  
  I wanted to use rasterio with a https url that has query-params, for example: https://.....?a=a&b=b
  First I wanted to see if gdal supports that kind of url and gdal does, so I looked for the code in rasterio that is responsible for cutting the url, 
  
  It can be found here:
  https://github.com/mapbox/rasterio/blob/master/rasterio/vfs.py#L32
  
  I added in my env the following code:
  ```
            if parts.query:  
               path += "?" + parts.query       
  ```
  
  and it solved the issue, 
  
  Is there a reason for cutting the querystring?
  
  
  
  Thanks, Guy
  
  query params in https url is not working
  Hi 
  
  I wanted to use rasterio with a https url that has query-params, for example: https://.....?a=a&b=b
  First I wanted to see if gdal supports that kind of url and gdal does, so I looked for the code in rasterio that is responsible for cutting the url, 
  
  It can be found here:
  https://github.com/mapbox/rasterio/blob/master/rasterio/vfs.py#L32
  
  I added in my env the following code:
  ```
            if parts.query:  
               path += "?" + parts.query       
  ```
  
  and it solved the issue, 
  
  Is there a reason for cutting the querystring?
  
  
  
  Thanks, Guy
  
  
  </issue>
  <code>
  [start of rasterio/vfs.py]
  1 """Implementation of Apache VFS schemes and URLs."""
  2 
  3 import os
  4 
  5 from rasterio.compat import urlparse
  6 
  7 
  8 # NB: As not to propagate fallacies of distributed computing, Rasterio
  9 # does not support HTTP or FTP URLs via GDAL's vsicurl handler. Only
  10 # the following local filesystem schemes are supported.
  11 SCHEMES = {
  12     'gzip': 'gzip',
  13     'gzip+file': 'gzip',
  14     'zip': 'zip',
  15     'zip+file': 'zip',
  16     'tar': 'tar',
  17     'tar+file': 'tar',
  18     'https': 'curl',
  19     'http': 'curl',
  20     's3': 's3'}
  21 
  22 FILE_SCHEMES = [
  23     '', 'file', 'gzip', 'gzip+file', 'zip', 'zip+file', 'tar', 'tar+file']
  24 
  25 
  26 def parse_path(uri, vfs=None):
  27     """Parse a URI or Apache VFS URL into its parts
  28 
  29     Returns: tuple
  30         (path, archive, scheme)
  31     """
  32     archive = scheme = None
  33     path = uri
  34     if vfs:
  35         parts = urlparse(vfs)
  36         scheme = parts.scheme
  37         archive = parts.path
  38         if parts.netloc and parts.netloc != 'localhost':  # pragma: no cover
  39             archive = parts.netloc + archive
  40     else:
  41         parts = urlparse(path)
  42         scheme = parts.scheme
  43         path = parts.path
  44         if parts.netloc and parts.netloc != 'localhost':
  45             path = parts.netloc + path
  46         # There are certain URI schemes we favor over GDAL's names.
  47         if scheme in SCHEMES:
  48             parts = path.split('!')
  49             path = parts.pop() if parts else None
  50             archive = parts.pop() if parts else None
  51         # For filesystem paths.
  52         elif scheme.lower() in FILE_SCHEMES:
  53             pass
  54         # We permit GDAL's idiosyncratic URI-like dataset paths such as
  55         # 'netcdf':... to fall right through with no parsed archive
  56         # or scheme.
  57         else:
  58             archive = scheme = None
  59             path = uri
  60 
  61     return path, archive, scheme
  62 
  63 
  64 def vsi_path(path, archive=None, scheme=None):
  65     """Convert a parsed path to a GDAL VSI path."""
  66     # If a VSF and archive file are specified, we convert the path to
  67     # a GDAL VSI path (see cpl_vsi.h).
  68     if scheme and scheme.startswith('http'):
  69         result = "/vsicurl/{0}://{1}".format(scheme, path)
  70     elif scheme and scheme == 's3':
  71         result = "/vsis3/{0}".format(path)
  72     elif scheme and scheme != 'file':
  73         if archive:
  74             result = '/vsi{0}/{1}/{2}'.format(
  75                 scheme, archive, path.lstrip('/'))
  76         else:
  77             result = '/vsi{0}/{1}'.format(scheme, path.lstrip('/'))
  78     else:
  79         result = path
  80     return result
  81
  [end of rasterio/vfs.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/rasterio/vfs.py b/rasterio/vfs.py
  --- a/rasterio/vfs.py
  +++ b/rasterio/vfs.py
  @@ -41,6 +41,8 @@
           parts = urlparse(path)
           scheme = parts.scheme
           path = parts.path
  +        if parts.query:
  +            path += "?" + parts.query
           if parts.netloc and parts.netloc != 'localhost':
               path = parts.netloc + path
           # There are certain URI schemes we favor over GDAL's names.
  
verification_info: {"golden_diff": "diff --git a/rasterio/vfs.py b/rasterio/vfs.py\n--- a/rasterio/vfs.py\n+++ b/rasterio/vfs.py\n@@ -41,6 +41,8 @@\n         parts = urlparse(path)\n         scheme = parts.scheme\n         path = parts.path\n+        if parts.query:\n+            path += \"?\" + parts.query\n         if parts.netloc and parts.netloc != 'localhost':\n             path = parts.netloc + path\n         # There are certain URI schemes we favor over GDAL's names.\n", "issue": "query params in https url is not working\nHi \r\n\r\nI wanted to use rasterio with a https url that has query-params, for example: https://.....?a=a&b=b\r\nFirst I wanted to see if gdal supports that kind of url and gdal does, so I looked for the code in rasterio that is responsible for cutting the url, \r\n\r\nIt can be found here:\r\nhttps://github.com/mapbox/rasterio/blob/master/rasterio/vfs.py#L32\r\n\r\nI added in my env the following code:\r\n```\r\n          if parts.query:  \r\n             path += \"?\" + parts.query       \r\n```\r\n\r\nand it solved the issue, \r\n\r\nIs there a reason for cutting the querystring?\r\n\r\n\r\n\r\nThanks, Guy\r\n\nquery params in https url is not working\nHi \r\n\r\nI wanted to use rasterio with a https url that has query-params, for example: https://.....?a=a&b=b\r\nFirst I wanted to see if gdal supports that kind of url and gdal does, so I looked for the code in rasterio that is responsible for cutting the url, \r\n\r\nIt can be found here:\r\nhttps://github.com/mapbox/rasterio/blob/master/rasterio/vfs.py#L32\r\n\r\nI added in my env the following code:\r\n```\r\n          if parts.query:  \r\n             path += \"?\" + parts.query       \r\n```\r\n\r\nand it solved the issue, \r\n\r\nIs there a reason for cutting the querystring?\r\n\r\n\r\n\r\nThanks, Guy\r\n\n", "before_files": [{"content": "\"\"\"Implementation of Apache VFS schemes and URLs.\"\"\"\n\nimport os\n\nfrom rasterio.compat import urlparse\n\n\n# NB: As not to propagate fallacies of distributed computing, Rasterio\n# does not support HTTP or FTP URLs via GDAL's vsicurl handler. Only\n# the following local filesystem schemes are supported.\nSCHEMES = {\n    'gzip': 'gzip',\n    'gzip+file': 'gzip',\n    'zip': 'zip',\n    'zip+file': 'zip',\n    'tar': 'tar',\n    'tar+file': 'tar',\n    'https': 'curl',\n    'http': 'curl',\n    's3': 's3'}\n\nFILE_SCHEMES = [\n    '', 'file', 'gzip', 'gzip+file', 'zip', 'zip+file', 'tar', 'tar+file']\n\n\ndef parse_path(uri, vfs=None):\n    \"\"\"Parse a URI or Apache VFS URL into its parts\n\n    Returns: tuple\n        (path, archive, scheme)\n    \"\"\"\n    archive = scheme = None\n    path = uri\n    if vfs:\n        parts = urlparse(vfs)\n        scheme = parts.scheme\n        archive = parts.path\n        if parts.netloc and parts.netloc != 'localhost':  # pragma: no cover\n            archive = parts.netloc + archive\n    else:\n        parts = urlparse(path)\n        scheme = parts.scheme\n        path = parts.path\n        if parts.netloc and parts.netloc != 'localhost':\n            path = parts.netloc + path\n        # There are certain URI schemes we favor over GDAL's names.\n        if scheme in SCHEMES:\n            parts = path.split('!')\n            path = parts.pop() if parts else None\n            archive = parts.pop() if parts else None\n        # For filesystem paths.\n        elif scheme.lower() in FILE_SCHEMES:\n            pass\n        # We permit GDAL's idiosyncratic URI-like dataset paths such as\n        # 'netcdf':... to fall right through with no parsed archive\n        # or scheme.\n        else:\n            archive = scheme = None\n            path = uri\n\n    return path, archive, scheme\n\n\ndef vsi_path(path, archive=None, scheme=None):\n    \"\"\"Convert a parsed path to a GDAL VSI path.\"\"\"\n    # If a VSF and archive file are specified, we convert the path to\n    # a GDAL VSI path (see cpl_vsi.h).\n    if scheme and scheme.startswith('http'):\n        result = \"/vsicurl/{0}://{1}\".format(scheme, path)\n    elif scheme and scheme == 's3':\n        result = \"/vsis3/{0}\".format(path)\n    elif scheme and scheme != 'file':\n        if archive:\n            result = '/vsi{0}/{1}/{2}'.format(\n                scheme, archive, path.lstrip('/'))\n        else:\n            result = '/vsi{0}/{1}'.format(scheme, path.lstrip('/'))\n    else:\n        result = path\n    return result\n", "path": "rasterio/vfs.py"}]}