lwline = (LWLINE*)lwgeom_from_wkt("LINESTRING(23.0 23.0,23.001 23.001)", LW_PARSER_CHECK_NONE);
geohash = lwgeom_geohash((LWGEOM*)lwline,0);
//printf("geohash %s\n",geohash);
- CU_ASSERT_STRING_EQUAL(geohash, "ss06g7");
+ CU_ASSERT_STRING_EQUAL(geohash, "ss06g7h");
lwline_free(lwline);
lwfree(geohash);
{
lonmaxadjust = -1 * lonwidth / 2.0;
}
+ if ( lonminadjust || lonmaxadjust )
+ {
+ lonmin += lonminadjust;
+ lonmax += lonmaxadjust;
+ /* Each adjustment cycle corresponds to 2 bits of storage in the
+ ** geohash. */
+ precision++;
+ }
+ else
+ {
+ break;
+ }
+
if ( miny > latmin + latwidth / 2.0 )
{
latminadjust = latwidth / 2.0;
latmaxadjust = -1 * latwidth / 2.0;
}
/* Only adjust if adjustments are legal (we haven't crossed any edges). */
- if ( (lonminadjust || lonmaxadjust) && (latminadjust || latmaxadjust ) )
+ if ( latminadjust || latmaxadjust )
{
latmin += latminadjust;
- lonmin += lonminadjust;
latmax += latmaxadjust;
- lonmax += lonmaxadjust;
/* Each adjustment cycle corresponds to 2 bits of storage in the
** geohash. */
- precision += 2;
+ precision++;
}
else
{