Repository: alltheplaces/alltheplaces

Issue:
Car charging stations
Are we interesting in collecting data on charging stations? We collect petrol stations, and I don't think it's that different, except there'll presumably me more charging stations.

I just came across [char.gy](https://char.gy/), it would be real easy to add via the [API](https://char.gy/charge_points.geojson?bounds=48,-10,60.716907,2) or a generic [Sitemap](https://char.gy/sitemap.xml)/Linkedata spider.


Discussion:
Yup, charging locations are ok. I would prefer that we pull from 1st party sources rather than aggregators, so as long as char.gy runs their charging network I'm ok with including them. I think we have Tesla, for example. 
for the US & Canada the DOE has data available via an API: https://afdc.energy.gov/fuels/electricity_locations.html#/find/nearest?fuel=ELEC
How is the DOE dataset? The UK has, National Chargepoint Registry https://www.gov.uk/guidance/find-and-use-data-on-public-electric-vehicle-chargepoints it has the usual 3rd data errors. Some providers are slow, it has a bunch of old (or not yet installed?) ones, broken ones, bad cords etc.

Char.gy is first party. I'll write a spider at some point.

> On 8 Aug 2022, at 14:21, jakewarren ***@***.***> wrote:
> 
> ﻿
> for the US & Canada the DOE has data available via an API: https://afdc.energy.gov/fuels/electricity_locations.html#/find/nearest?fuel=ELEC
> 
> —
> Reply to this email directly, view it on GitHub, or unsubscribe.
> You are receiving this because you authored the thread.

The DOE dataset is definitely an aggregation of 3rd party coords, but they seem reasonable at first glance.

|count|ev_network|
|-|-|
|1|"AddÉnergie Technologies"|
|3|"Sun Country Highway"|
|4|"EVRANGE"|
|6|"ZEFNET"|
|11|"UNIVERSAL"|
|14|"FPLEV"|
|16|"RIVIAN_ADVENTURE"|
|31|"Electrify Canada"|
|33|"EVGATEWAY"|
|48|"AMPUP"|
|50|"RIVIAN_WAYPOINTS"|
|55|"PETROCAN"|
|57|"EVCS"|
|61|"Webasto"|
|62|"eCharge Network"|
|70|"IVY"|
|78|"POWERFLEX"|
|79|"BCHYDRO"|
|86|"CHARGELAB"|
|117|"FCN"|
|132|"SWTCH"|
|167|"OpConnect"|
|188|"LIVINGSTON"|
|808|"EV Connect"|
|815|"Electrify America"|
|917|"eVgo Network"|
|1122|"Greenlots"|
|1251|"Volta"|
|1293|"Blink Network"|
|1589|"Tesla"|
|1961|"FLO"|
|1980|"Circuit électrique"|
|2178|"SemaCharge Network"|
|4906|"Tesla Destination"|
|6696|"Non-Networked"|
|7932|null|
|29686|"ChargePoint Network"|

Resolving patch:
diff --git a/locations/spiders/chargy_gb.py b/locations/spiders/chargy_gb.py
new file mode 100644
--- /dev/null
+++ b/locations/spiders/chargy_gb.py
@@ -0,0 +1,26 @@
+from scrapy import Spider
+
+from locations.items import GeojsonPointItem
+
+
+class ChargyGBSpider(Spider):
+    name = "chargy_gb"
+    item_attributes = {
+        "brand": "char.gy",
+        "brand_wikidata": "Q113465698",
+        "country": "GB",
+    }
+    start_urls = ["https://char.gy/charge_points.geojson?bounds=48,-10,60.716907,2"]
+
+    def parse(self, response):
+        for charger in response.json()["features"]:
+            item = GeojsonPointItem()
+
+            item["lon"], item["lat"] = charger["geometry"]["coordinates"]
+
+            item["ref"] = charger["properties"]["slug"]
+            item["website"] = "https://char.gy/" + charger["properties"]["slug"]
+            item["street_address"] = charger["properties"]["description"]
+            item["postcode"] = charger["properties"]["postcode"]
+
+            yield item


Test patch: