cyang-kth/fmm

The wkt polygon format in h3mm is not correct

cyang-kth opened this issue · 1 comments

std::string hex2wkt(const HexIndex &index, int precision=12){
std::ostringstream oss;
GeoBoundary boundary;
oss << "POLYGON(";
h3ToGeoBoundary(index, &boundary);
for (int v = 0; v < boundary.numVerts; v++) {
oss << std::setprecision(precision) << radsToDegs(boundary.verts[v].lon)
<< " " << radsToDegs(boundary.verts[v].lat) << ",";
}
oss << std::setprecision(precision) << radsToDegs(boundary.verts[0].lon)
<< " " << radsToDegs(boundary.verts[0].lat);
oss << ")";
return oss.str();
};

According to wikipedia, the wkt polygon format should be

POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))

Feature already implemented. It will be pushed after our next paper is published.