def METHOD_NAME(request):
    try:
        latitude = request.GET["lat"]  # 緯度: y
        longitude = request.GET["lng"]  # 經度: x
        radius = request.GET["range"]  # km
    except MultiValueDictKeyError:
        missing_params = [p for p in ("lat", "lng", "range") if p not in request.GET]
        missing_params = ", ".join(missing_params)
        return HttpResponse(
            f"Missing query parameter: {missing_params}.",
            status=400,
        )
    latitude, longitude = float(latitude), float(longitude)
    if not _in_taiwan(latitude, longitude):
        return HttpResponse(
            "The query position is not in the range of Taiwan."
            "Valid query parameters should be: "
            f"{settings.TAIWAN_MIN_LONGITUDE} < lng < {settings.TAIWAN_MAX_LONGITUDE}, "
            f"{settings.TAIWAN_MIN_LATITUDE} < lat < {settings.TAIWAN_MAX_LATITUDE}.",
            status=400,
        )
    radius = float(radius)
    if not _in_reasonable_radius_range(radius):
        return HttpResponse(
            f"`range` should be within 0.01 to 100 km, but got {radius}",
            status=400,
        )
    nearby_factories = _get_nearby_factories(
        latitude=latitude,
        longitude=longitude,
        radius=radius,
    )
    serializer = FactorySerializer(nearby_factories, many=True)
    return JsonResponse(serializer.data, safe=False)