I am currently working on an air pollution routing project which uses Graphhopper library.
I had created an additional decimal encoded value “smokeEnc” to hold expected AQI value of each edge in graphhopper. My objective is to use this smokeEnc value for greener routings. For this, I must assign this AQI value to all edges. This is how I had done it:
Create smokeEnc Decimal Encoded value(1):
Assign AQI value to all edges(2):
Create custom Greenest Weighting(3):
However on querying, something strange happens. While doing (2) all the edges(301586 edges) in the graph are filled with their expected (and always NON-ZERO) AQI values but on debugging the calcEdgeWeight function of Greenest Weighting at routing query time, I get to know only 983 edges have non-zero values of “smokeEnc” and all others have 0 instead . Moreover, the route I get from Greenest routing actually has a very poor AQI score, poor even in comparison to FasterWeighting or ShortestWeighting etc. I find myself really lost. What mistake am I doing and what things have I misconsidered while working on this?