2525import java .util .regex .Matcher ;
2626
2727import static com .mapcode .CheckArgs .checkNonnull ;
28- import static com .mapcode .CheckArgs .checkRange ;
2928
3029/**
3130 * ----------------------------------------------------------------------------------------------
@@ -86,8 +85,8 @@ public static List<Mapcode> encode(@Nonnull final Point point) throws IllegalArg
8685 * that the first result is the shortest mapcode. If you want to use the shortest mapcode, use
8786 * {@link #encodeToShortest(double, double, Territory)}.
8887 *
89- * @param latDeg Latitude, accepted range: -90..90.
90- * @param lonDeg Longitude, accepted range: -180..180.
88+ * @param latDeg Latitude, accepted range: -90..90 (limited to this range if outside) .
89+ * @param lonDeg Longitude, accepted range: -180..180 (wrapped to this range if outside) .
9190 * @param restrictToTerritory Try to encode only within this territory, see {@link Territory}. May be null.
9291 * @return List of mapcode information records, see {@link Mapcode}. This list is empty if no
9392 * Mapcode can be generated for this territory matching the lat/lon.
@@ -96,9 +95,6 @@ public static List<Mapcode> encode(@Nonnull final Point point) throws IllegalArg
9695 @ Nonnull
9796 public static List <Mapcode > encode (final double latDeg , final double lonDeg ,
9897 @ Nullable final Territory restrictToTerritory ) throws IllegalArgumentException {
99- checkRange ("latDeg" , latDeg , Point .LAT_DEG_MIN , Point .LAT_DEG_MAX );
100- checkRange ("lonDeg" , lonDeg , Point .LON_DEG_MIN , Point .LON_DEG_MAX );
101-
10298 // Call Mapcode encoder.
10399 final List <Mapcode > results = Encoder .encode (latDeg , lonDeg , restrictToTerritory , false , false , (restrictToTerritory == null ));
104100 assert results != null ;
@@ -149,9 +145,6 @@ public static Mapcode encodeToShortest(@Nonnull final Point point) throws Illega
149145 @ Nonnull
150146 public static Mapcode encodeToShortest (final double latDeg , final double lonDeg ,
151147 @ Nullable final Territory restrictToTerritory ) throws IllegalArgumentException , UnknownMapcodeException {
152- checkRange ("latDeg" , latDeg , Point .LAT_DEG_MIN , Point .LAT_DEG_MAX );
153- checkRange ("lonDeg" , lonDeg , Point .LON_DEG_MIN , Point .LON_DEG_MAX );
154-
155148 // Call mapcode encoder.
156149 @ Nonnull final List <Mapcode > results =
157150 Encoder .encode (latDeg , lonDeg , restrictToTerritory , false , true , (restrictToTerritory == null ));
@@ -181,8 +174,6 @@ public static Mapcode encodeToShortest(@Nonnull final Point point,
181174 */
182175 @ Nonnull
183176 public static Mapcode encodeToInternational (final double latDeg , final double lonDeg ) throws IllegalArgumentException {
184- checkRange ("latDeg" , latDeg , Point .LAT_DEG_MIN , Point .LAT_DEG_MAX );
185- checkRange ("lonDeg" , lonDeg , Point .LON_DEG_MIN , Point .LON_DEG_MAX );
186177
187178 // Call mapcode encoder.
188179 @ Nonnull final List <Mapcode > results = encode (latDeg , lonDeg , Territory .AAA );
@@ -280,8 +271,6 @@ public static Point decode(
280271 throw new UnknownMapcodeException ("Unknown Mapcode: " + mapcodeClean +
281272 ", territoryContext=" + defaultTerritoryContext );
282273 }
283- assert (Point .LAT_DEG_MIN <= point .getLatDeg ()) && (point .getLatDeg () <= Point .LAT_DEG_MAX ) : point .getLatDeg ();
284- assert (Point .LON_DEG_MIN <= point .getLonDeg ()) && (point .getLonDeg () <= Point .LON_DEG_MAX ) : point .getLonDeg ();
285274 return point ;
286275 }
287276}
0 commit comments