chihacknight / decarbonize-my-state

What does it take to decarbonize your state?
https://decarbmystate.com/
MIT License
13 stars 1 forks source link

Add Satellite Imagery of All Fossil Power Plants #203

Closed vkoves closed 11 months ago

vkoves commented 1 year ago

Overview

Adds satellite images to all power plants do you can see how large a plant is and understand it's environment.

Closes #xxx

Demo

Optional. Screenshots, curl examples, etc.

Notes

Optional. Ancillary topics, caveats, alternative strategies that didn't work out, anything else.

Testing Instructions

netlify[bot] commented 1 year ago

Deploy Preview for decarb-my-state ready!

Name Link
Latest commit cb8308632e40be27ab655591c80a59e80f656bae
Latest deploy log https://app.netlify.com/sites/decarb-my-state/deploys/64b759d2b9c00a000837974f
Deploy Preview https://deploy-preview-203--decarb-my-state.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

vkoves commented 1 year ago

Demo with my API key:

Screenshot from 2023-05-02 21-18-42

vkoves commented 1 year ago

@derekeder - we discussed you making a python script so we can now have power plant pages at say /power-plant-maps/{state-slug}-{plant-slug}.png or something like that. We don't know that plant names are unique so I think keeping the plant slug in there would be helpful.

derekeder commented 1 year ago

@JoseMRodriguezO looks like we're missing your script and the images. Looks like you reverted a commit that had the script in this commit 9c1166456200da22ade27441e35cab1906eb57cd. Can you add it back, as well as the 3,500 images?

JoseMRodriguezO commented 1 year ago

commit updated

JoseMRodriguezO commented 1 year ago

Overview

This pull request adds functionality to fetch power plant data from a JSON file and save map images for each power plant using the Google Static Maps API.

Closes #203

Demo

image

Notes

Added code to read power plant data from a JSON file.

Testing Instructions

Ensure the necessary dependencies, such as requests and slugify, are installed.

derekeder commented 1 year ago

@JoseMRodriguezO cool - looks like the images are here! nice!

@vkoves the images are in the data folder. do you want to update this PR and move them to the static directory and link to them on the power plant detail page?

derekeder commented 1 year ago

@JoseMRodriguezO cool - looks like the images are here! nice!

@vkoves the images are in the data folder. do you want to update this PR and move them to the static directory and link to them on the power plant detail page?

vkoves commented 1 year ago

Want to note that this is on my radar and I know I need to get back to this 😆

vkoves commented 1 year ago

@derekeder and @JoseMRodriguezO - I've integrated the power plant imagery onto the power plant details page, but there's a few things I noticed. First, here's what I have right now:

Screenshot from 2023-06-18 14-30-39

So what I noticed:

  1. We have images for power plants we don't show - maybe we pulled in all power plants and not just gas, coal, and oil? You can technically access these pages though, like ABC Coke in Alabama which must have a data entry issue:

Screenshot from 2023-06-18 14-32-32

  1. The images are huge, totallying 1.5 GB. We should move to a modern format like .webp or even just a more compressed .jpg, because this amount of files will make the repo harder to use but also risks eating up our bandwidth.
JoseMRodriguezO commented 1 year ago

ok, I will work on it

vkoves commented 1 year ago

@JoseMRodriguezO - we can talk about it on Tuesday, I think we need to use a tool like ImageMagick to locally compress all the images, but not sure about reducing which power plants we have. If you do want to take a crack at it, this is what I found:

https://unix.stackexchange.com/questions/516435/imagemagick-convert-compress-all-files-in-the-directory

My internal target is < 200 KB per image, but if we could get 100 KB that'd be great. https://squoosh.app/ seems to be able to do that without it looking terrible

JoseMRodriguezO commented 1 year ago

Hi, Viktor I just finished with imageMagic. I just resize the images to low 200kb at 600x600 I just need to commit now, also separated the plants by category as requested. I just didnt update my commit before pushing. please verify and let me know. Thank you,

vkoves commented 1 year ago

@JoseMRodriguezO - can you post a before after image with one of your images before and after compression? What does the total directory size come out to?

JoseMRodriguezO commented 1 year ago

Update branch

vkoves commented 1 year ago

@JoseMRodriguezO - that sounds awesome! Can you push up the new images?

vkoves commented 1 year ago

Sorry I've dropped the ball on this, I need to get the styling fixed up and then get someone to review this! It's on my list 😆

vkoves commented 11 months ago

@derekeder - this is still waiting on you, it's ready for review