Skip to content

Feature: Add FMI Open Data WFS station metadata parser#52

Open
lkananen wants to merge 7 commits intopnuu:mainfrom
lkananen:feature-station-metadata
Open

Feature: Add FMI Open Data WFS station metadata parser#52
lkananen wants to merge 7 commits intopnuu:mainfrom
lkananen:feature-station-metadata

Conversation

@lkananen
Copy link
Copy Markdown

I have added the support for station metadata API endpoint (fmi::ef::stations) and functionality to download_and_parse that data.

Changes:

  • station.py file added. Implements download_and_parse for the stations.
  • test_station.py file added. Test the station.py implementation.
  • wfs.py updated to included necessary XML Elements used by station.py.
  • README.MD section added for stations. Examples included there.

@lkananen
Copy link
Copy Markdown
Author

lkananen commented Dec 16, 2025

AI generated detailed description of the full list of changes below:

Core Implementation (station.py):

  • Implement Station class to parse EnvironmentalMonitoringFacility XML
  • Extract station metadata: FMISID, name, coordinates, region, country
  • Support multiple network types per station (station_type as list)
  • Add INSPIRE ID fields (local_id, namespace)
  • Include measurement regime and mobile_status fields
  • Provide helper methods for filtering stations by:
    • ID, name, type, region, and country

Test Suite (test_station.py):

  • Add 30+ comprehensive test cases achieving 90%+ code coverage
  • Three test classes: TestStationParser, TestStationValues, TestStationErrorCases
  • Cover parsing, data validation, helper methods, and error handling
  • Validate field formats (coordinates, WMO IDs, INSPIRE IDs, timestamps)
  • Test multiple station types and data consistency

Infrastructure Updates:

  • Update wfs.py with station-related XML tag constants:
    • EF_* constants for Environmental Monitoring Facilities
    • INS_BASE_* constants for INSPIRE identifiers
    • XLINK_TITLE for network type extraction
  • Add station query handler to download_stored_query()

Documentation (README.md):

  • Add comprehensive station metadata section with examples
  • Document data structure with all 16 fields
  • Provide usage examples for all helper methods
  • Explain multiple network types support

Follows INSPIRE EF 4.0 schema for environmental monitoring facilities.

@lkananen
Copy link
Copy Markdown
Author

Related stored query:
wfs.py: Environmental Monitoring Stations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant