Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support latitude and longitude as inputs #4

Open
fershad opened this issue Nov 30, 2024 · 1 comment
Open

Support latitude and longitude as inputs #4

fershad opened this issue Nov 30, 2024 · 1 comment

Comments

@fershad
Copy link
Contributor

fershad commented Nov 30, 2024

The Electricity Maps API allows us to pass either a zone or lat and lon values when querying for power breakdown or grid intensity. Currently the gridAwarePower and gridAwareCO2e functions only use the zone (Alpha 2 ISO country code).

Desired state

It should be possible to pass in either the zone or lat and lon values into either of the functions.

The likeliest easy solution would be to accept these values in an options object passed into each function. An alternate approach would be to have a config step where the user defines which location type (zone/lat + lon) they want to use.

@fershad fershad changed the title How to support latitude and longitude as inputs Support latitude and longitude as inputs Nov 30, 2024
@fershad
Copy link
Contributor Author

fershad commented Dec 1, 2024

One way this might work is if the zone could be either a string or an object.

In the case it is an object, we could then check for the lat and lon keys inside.
In the case it is a string, the current functionality would prevail.

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

No branches or pull requests

1 participant