Skip to content

Commit 54dc5d3

Browse files
committed
Added new C library version dd 2014-08-30
1 parent e1907bb commit 54dc5d3

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

mapcoder/mapcode_library.doc

0 Bytes
Binary file not shown.

mapcoder/mapcoder.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ long x_divider( long miny, long maxy )
296296
int isInRange(long x,long minx,long maxx) // returns nonzero if x in the range minx...maxx
297297
{
298298
if ( minx<=x && x<maxx ) return 1;
299-
if (x<180000000) x+=360000000; else x-=360000000;
299+
if (x<minx) x+=360000000; else x-=360000000; // 1.32 fix FIJI edge case
300300
if ( minx<=x && x<maxx ) return 1;
301301
return 0;
302302
}
@@ -580,6 +580,10 @@ void encode_grid( char* result, long x,long y, int m, int codex, long minx, long
580580
{
581581
relx+=360000000; x+=360000000;
582582
}
583+
else if ( relx>=360000000 ) // 1.32 fix FIJI edge case
584+
{
585+
relx-=360000000; x-=360000000;
586+
}
583587

584588
rely /= ygridsize;
585589
relx /= xgridsize;

mapcoder/readme.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,5 @@ version history
2222
1.28 bug fix for the needless generation of 7-letter alternatives to short mapcodes in large states in India
2323
1.29 also generate country-wide alternative mapcodes for states
2424
1.30 updated the documentation and extended it with examples and suggestions
25-
1.31 added lookslikemapcode() and coord2mc1()
26-
1.32 fixes 1.29 so no country-wide alternative is produced in the edge case where there simply is no country code
27-
28-
25+
1.31 added lookslikemapcode();
26+
1.32 added coord2mc1(); fixed 1.29 so no country-wide alternative is produced in edge cases; prevent FIJI failing to decode at exactly 180 degrees;

0 commit comments

Comments
 (0)