Skip to content

Conversation

@fgravin
Copy link
Member

@fgravin fgravin commented Dec 16, 2025

Summary

This PR fixes a type inconsistency in WMS bounding box parsing where values were being stored as strings instead of numbers.

  • Issue: The BoundingBox type is defined as [number, number, number, number], but the parsing functions were returning string values from XML attributes
  • Fix: Updated three parsing functions in capabilities.ts to convert attribute/text values to numbers using parseFloat():
    • parseBBox() - for standard BoundingBox elements
    • parseExGeographicBoundingBox() - for EX_GeographicBoundingBox elements (WMS 1.3.0)
    • parseLatLonBoundingBox() - for LatLonBoundingBox elements (WMS 1.1.x)
  • Tests: Updated all test expectations in capabilities.spec.ts and endpoint.spec.ts to expect numbers instead of strings

Test plan

  • All existing WMS tests pass
  • Bounding boxes are correctly parsed as numbers from XML
  • Type consistency is maintained throughout the codebase

🤖 Generated with Claude Code

WMS bounding boxes are defined as [number, number, number, number] but
were being parsed as strings from XML attributes. Updated parsing
functions to convert values to numbers using parseFloat().

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Copy link
Member

@jahow jahow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Long overdue, thank you for fixing this!

@jahow
Copy link
Member

jahow commented Dec 17, 2025

Note that this should appear in the release notes, it's not a breaking change per se but it could still have impacts on downstream code.

@jahow jahow merged commit 53a6449 into main Dec 17, 2025
1 check passed
@jahow jahow deleted the fix-bbox branch December 17, 2025 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants