Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

get_collection_map does not parse the transparent query parameter

Đang mở
#2,444 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@ozenyunus35 đang làm issue này rồi.

Từ ngày 15/10/2026.

  • #2445 của @ozenyunus35 — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
api

Hướng nghiên cứu

The string transparent is copied into query_args without conversion in pygeoapi/api/maps.py near line 135, and MapScriptProvider in pygeoapi/provider/mapscript_.py around lines 185-188 tests it as a truthy value. Read both, then check how the other parsed parameters are converted. Done means the API passes a real bool and the provider's check works for 'false'. Pull request #2445 is already open against this issue, so review or coordinate with it before writing a new patch.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug

When handling an OGC API Maps request, pygeoapi does not parse the transparent query parameter into a bool, as seen in:

https://github.com/geopython/pygeoapi/blob/990e5f72ec938b3ad7aca5e493dda736806ebd6a/pygeoapi/api/maps.py#L135

As seen above, if request.params['transparent'] exists, then it is stored as is in query_args['transparent'] - i.e. as a string.

This means that map providers are left to parse this parameter, unlike all other parameters, which are parsed by pygeoapi before calling the map provider.

This is also causing a bug in the built-in MapScriptProvider. This provider does not parse the transparent parameter either. It simply tries to use it, as seen in:

https://github.com/geopython/pygeoapi/blob/990e5f72ec938b3ad7aca5e493dda736806ebd6a/pygeoapi/provider/mapscript_.py#L185-L188

In the above snippet, as explained before, it is possible that transparent is a string. When that is the case, the above if check will not work as intended (because in Python all strings are truthy, i.e. if "false" evaluates to True).

Ngôn ngữ chính
Python
Star
626
Fork
334
Merge trung bình
20 giờ 31 phút
Pull request đã merge (30 ngày)
3

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của geopython/pygeoapi

Tất cả issue của geopython/pygeoapi

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.