Air pollution emissions in Helsinki: Difference between revisions

From Opasnet
Jump to navigation Jump to search
(→‎Answer: POST with plotly json works!)
Line 22: Line 22:
library(jsonlite)
library(jsonlite)


objects.latest("Op_en6007", code_name="hnh3035") # [[OpasnetUtils/Drafts]] combineLines, pushIndicatorGraph
objects.latest("Op_en7923", code_name="emission") # [[Air pollution emissions in Helsinki]] emission
objects.latest("Op_en7923", code_name="emission") # [[Air pollution emissions in Helsinki]] emission


Line 48: Line 49:
# https://plot.ly/ggplot2/user-guide/#interactively-view-the-json-object
# https://plot.ly/ggplot2/user-guide/#interactively-view-the-json-object


tst <- ggplot(data.frame(A=c("a","b","c"),B=1:3), aes(x=A, weight=B, fill=A))+geom_bar()
  pushIndicatorGraph(gpcar, "https://hnhteamy.fi/v1/indicator/8/")
 
POST(
  "http://httpbin.org/anything",
  body = plotly_json(tst),
  encode = "json"
)
 
POST(
  "https://httpbin.org/post",
  body = list(x = "A simple text string"),
  encode = "json"
)
 
  emissionsplotly <- ggplotly(gp)
  caremissionsplotly <- ggplotly(gpcar)
    
    
  objects.store(emissionsplotly, caremissionsplotly)
   cat("Plotly graphs on vehile fleet and km POSTed to HNH server.\n")
   cat("Plotly graphs emissionsplotly, caremissionsplotly stored.\n")
}
}
</rcode>
</rcode>

Revision as of 17:38, 17 December 2018



Air pollution emissions in Helsinki estimate direct air pollution emissions (including CO2eq) from the Helsinki area.

Question

What are the amounts of air pollution (notably CO2eq and PM2.5) emitted from the Helsinki area (Helsinki specifically but also other municipalities of the Helsinki Metropolitan Area)?

Answer

  • Model run 12.12.2018 [1]

+ Show code

Rationale

Dependencies

Calculations

The answer metadata can be obtained by using link: http://cl1.opasnet.org/opasnet_base_2/index.php?ident=op_en7923.answer&act=0

The actual data: (key is unique to every download instance and is generated when the above link is opened) - http://cl1.opasnet.org/opasnet_base_2/index.php?key=8dYqLbtppz4HM7sYaAyj4t6S49jQNRWJ

+ Show code

+ Show code

+ Show code

+ Show code

See also

Keywords

References