def sobloo_opensearch_params(latitude, longitude, max_cloud_cover):
    """Build Sobloo open search query string to get the latest Sentinel-2 image
    with minimal cloud cover at the requested location

    Arguments:
        latitude {float} -- latitude of search point
        longitude {float} -- longitude of search point
        max_cloud_cover {float} -- max cloud cover percentage (0 to 1)

    Returns:
        dict -- parameters of GET request to Sobloo Opensearch endpoint
    """

    # Create a small polygon around the search point
    polygon = [
        (longitude - 0.001, latitude - 0.001),
        (longitude + 0.001, latitude - 0.001),
        (longitude + 0.001, latitude + 0.001),
        (longitude - 0.001, latitude + 0.001),
        (longitude - 0.001, latitude - 0.001)
    ]

    # To WKT
    polygon = 'POLYGON ((%s))' % ', '.join(['%s %s' % p for p in polygon])

    # Querying the latest Sentinel 2 image for our polygon
    params = {
        'f': [
            'state.services.wmts:eq:true',
            'identification.collection:eq:Sentinel-2',
            'contentDescription.cloudCoverPercentage:lt:%i' % int(
                max_cloud_cover * 100)
        ],
        'sort': '-timeStamp',
        'size': 1,
        'gintersect': polygon
    }

    return params