I want to calculate index of the h3 cells between (-39.08, -57.01) and (-38.05, -58.16) but it throws LineUndefinedException.
In the documentation it says
This function may fail to find the line between two indexes, for example if they are very far apart. It may also fail when finding distances for indexes on opposite sides of a pentagon.
I think that it throws the exception because of the latter case. Is there workaround to calculate those cell indexes?
Code:
public static void main(String[] args) {
try {
H3Core h3Core = H3Core.newInstance();
long p1 = h3Core.geoToH3(-39.08, -57.01, 8);
long p2 = h3Core.geoToH3(-38.05, -58.16, 8);
List<Long> line = h3Core.h3Line(p1, p2);
} catch (Exception e) {
e.printStackTrace();
}
}
Exception:
com.uber.h3core.exceptions.LineUndefinedException: Could not compute line size between cells
at com.uber.h3core.H3Core.h3Line(H3Core.java:630)