Skip to content

Commit aa126fc

Browse files
authored
[geojson] remove min/max latitude/longitude range annotations and javadoc (#1168)
1 parent 5e1cba7 commit aa126fc

1 file changed

Lines changed: 21 additions & 41 deletions

File tree

  • services-geojson/src/main/java/com/mapbox/geojson

services-geojson/src/main/java/com/mapbox/geojson/Point.java

Lines changed: 21 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
package com.mapbox.geojson;
22

3-
import static com.mapbox.geojson.constants.GeoJsonConstants.MAX_LATITUDE;
4-
import static com.mapbox.geojson.constants.GeoJsonConstants.MAX_LONGITUDE;
5-
import static com.mapbox.geojson.constants.GeoJsonConstants.MIN_LATITUDE;
6-
import static com.mapbox.geojson.constants.GeoJsonConstants.MIN_LONGITUDE;
7-
8-
import androidx.annotation.FloatRange;
93
import androidx.annotation.Keep;
104
import androidx.annotation.NonNull;
115
import androidx.annotation.Nullable;
@@ -68,8 +62,7 @@ public final class Point implements CoordinateContainer<List<Double>> {
6862
/**
6963
* Create a new instance of this class by passing in a formatted valid JSON String. If you are
7064
* creating a Point object from scratch it is better to use one of the other provided static
71-
* factory methods such as {@link #fromLngLat(double, double)}. Longitude values should not exceed
72-
* the spec defined -180 to 180 range and latitude's limit of -90 to 90. While no limit is placed
65+
* factory methods such as {@link #fromLngLat(double, double)}. While no limit is placed
7366
* on decimal precision, for performance reasons when serializing and deserializing it is
7467
* suggested to limit decimal precision to within 6 decimal places.
7568
*
@@ -86,20 +79,17 @@ public static Point fromJson(@NonNull String json) {
8679

8780
/**
8881
* Create a new instance of this class defining a longitude and latitude value in that respective
89-
* order. Longitude values are limited to a -180 to 180 range and latitude's limited to -90 to 90
90-
* as the spec defines. While no limit is placed on decimal precision, for performance reasons
82+
* order. While no limit is placed on decimal precision, for performance reasons
9183
* when serializing and deserializing it is suggested to limit decimal precision to within 6
9284
* decimal places.
9385
*
94-
* @param longitude a double value between -180 to 180 representing the x position of this point
95-
* @param latitude a double value between -90 to 90 representing the y position of this point
86+
* @param longitude a double value representing the x position of this point
87+
* @param latitude a double value representing the y position of this point
9688
* @return a new instance of this class defined by the values passed inside this static factory
9789
* method
9890
* @since 3.0.0
9991
*/
100-
public static Point fromLngLat(
101-
@FloatRange(from = MIN_LONGITUDE, to = MAX_LONGITUDE) double longitude,
102-
@FloatRange(from = MIN_LATITUDE, to = MAX_LATITUDE) double latitude) {
92+
public static Point fromLngLat(double longitude, double latitude) {
10393

10494
List<Double> coordinates =
10595
CoordinateShifterManager.getCoordinateShifter().shiftLonLat(longitude, latitude);
@@ -108,22 +98,19 @@ public static Point fromLngLat(
10898

10999
/**
110100
* Create a new instance of this class defining a longitude and latitude value in that respective
111-
* order. Longitude values are limited to a -180 to 180 range and latitude's limited to -90 to 90
112-
* as the spec defines. While no limit is placed on decimal precision, for performance reasons
101+
* order. While no limit is placed on decimal precision, for performance reasons
113102
* when serializing and deserializing it is suggested to limit decimal precision to within 6
114103
* decimal places. An optional altitude value can be passed in and can vary between negative
115104
* infinity and positive infinity.
116105
*
117-
* @param longitude a double value between -180 to 180 representing the x position of this point
118-
* @param latitude a double value between -90 to 90 representing the y position of this point
106+
* @param longitude a double value representing the x position of this point
107+
* @param latitude a double value representing the y position of this point
119108
* @param bbox optionally include a bbox definition as a double array
120109
* @return a new instance of this class defined by the values passed inside this static factory
121110
* method
122111
* @since 3.0.0
123112
*/
124-
public static Point fromLngLat(
125-
@FloatRange(from = MIN_LONGITUDE, to = MAX_LONGITUDE) double longitude,
126-
@FloatRange(from = MIN_LATITUDE, to = MAX_LATITUDE) double latitude,
113+
public static Point fromLngLat(double longitude, double latitude,
127114
@Nullable BoundingBox bbox) {
128115

129116
List<Double> coordinates =
@@ -133,24 +120,20 @@ public static Point fromLngLat(
133120

134121
/**
135122
* Create a new instance of this class defining a longitude and latitude value in that respective
136-
* order. Longitude values are limited to a -180 to 180 range and latitude's limited to -90 to 90
137-
* as the spec defines. While no limit is placed on decimal precision, for performance reasons
123+
* order. While no limit is placed on decimal precision, for performance reasons
138124
* when serializing and deserializing it is suggested to limit decimal precision to within 6
139125
* decimal places. An optional altitude value can be passed in and can vary between negative
140126
* infinity and positive infinity.
141127
*
142-
* @param longitude a double value between -180 to 180 representing the x position of this point
143-
* @param latitude a double value between -90 to 90 representing the y position of this point
128+
* @param longitude a double value representing the x position of this point
129+
* @param latitude a double value representing the y position of this point
144130
* @param altitude a double value which can be negative or positive infinity representing either
145131
* elevation or altitude
146132
* @return a new instance of this class defined by the values passed inside this static factory
147133
* method
148134
* @since 3.0.0
149135
*/
150-
public static Point fromLngLat(
151-
@FloatRange(from = MIN_LONGITUDE, to = MAX_LONGITUDE) double longitude,
152-
@FloatRange(from = MIN_LATITUDE, to = MAX_LATITUDE) double latitude,
153-
double altitude) {
136+
public static Point fromLngLat(double longitude, double latitude, double altitude) {
154137

155138
List<Double> coordinates =
156139
CoordinateShifterManager.getCoordinateShifter().shiftLonLatAlt(longitude, latitude, altitude);
@@ -160,24 +143,21 @@ public static Point fromLngLat(
160143

161144
/**
162145
* Create a new instance of this class defining a longitude and latitude value in that respective
163-
* order. Longitude values are limited to a -180 to 180 range and latitude's limited to -90 to 90
164-
* as the spec defines. While no limit is placed on decimal precision, for performance reasons
146+
* order. While no limit is placed on decimal precision, for performance reasons
165147
* when serializing and deserializing it is suggested to limit decimal precision to within 6
166148
* decimal places. An optional altitude value can be passed in and can vary between negative
167149
* infinity and positive infinity.
168150
*
169-
* @param longitude a double value between -180 to 180 representing the x position of this point
170-
* @param latitude a double value between -90 to 90 representing the y position of this point
151+
* @param longitude a double value representing the x position of this point
152+
* @param latitude a double value representing the y position of this point
171153
* @param altitude a double value which can be negative or positive infinity representing either
172154
* elevation or altitude
173155
* @param bbox optionally include a bbox definition as a double array
174156
* @return a new instance of this class defined by the values passed inside this static factory
175157
* method
176158
* @since 3.0.0
177159
*/
178-
public static Point fromLngLat(
179-
@FloatRange(from = MIN_LONGITUDE, to = MAX_LONGITUDE) double longitude,
180-
@FloatRange(from = MIN_LATITUDE, to = MAX_LATITUDE) double latitude,
160+
public static Point fromLngLat(double longitude, double latitude,
181161
double altitude, @Nullable BoundingBox bbox) {
182162

183163
List<Double> coordinates =
@@ -208,11 +188,11 @@ static Point fromLngLat(@NonNull double[] coords) {
208188
}
209189

210190
/**
211-
* This returns a double value ranging from -180 to 180 representing the x or easting position of
191+
* This returns a double value representing the x or easting position of
212192
* this point. ideally, this value would be restricted to 6 decimal places to correctly follow the
213193
* GeoJson spec.
214194
*
215-
* @return a double value ranging from -180 to 180 representing the x or easting position of this
195+
* @return a double value representing the x or easting position of this
216196
* point
217197
* @since 3.0.0
218198
*/
@@ -221,11 +201,11 @@ public double longitude() {
221201
}
222202

223203
/**
224-
* This returns a double value ranging from -90 to 90 representing the y or northing position of
204+
* This returns a double value representing the y or northing position of
225205
* this point. ideally, this value would be restricted to 6 decimal places to correctly follow the
226206
* GeoJson spec.
227207
*
228-
* @return a double value ranging from -90 to 90 representing the y or northing position of this
208+
* @return a double value representing the y or northing position of this
229209
* point
230210
* @since 3.0.0
231211
*/

0 commit comments

Comments
 (0)