@Coordinates()
New in 2.0Generate random coordinates (format: longitude,latitude)
GeographicSince 2.0.0
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| minLng | Double | — | -180 | Min longitude (-180) |
| maxLng | Double | — | 180 | Max longitude (+180) |
| minLat | Double | — | -90 | Min latitude (-90) |
| maxLat | Double | — | 90 | Max latitude (+90) |
| scale | Integer | — | 6 | Decimal precision |
| nullSampler | String | — | — | The null ratio, such as "1:2", indicates that generating a random value 3 times with an average of 1 time is null |
Usage
@Coordinates(nullWeight)Generate coordinates with default bounds and nullWeight (e.g. 2:8)
Example:
@Coordinates(2:8)
Output:
20.336546,90.232121null@Coordinates()Generate random coordinates
Example:
@Coordinates()
Output:
20.336546,90.232121@Coordinates(minLng,maxLng,minLat,maxLat,scale,nullWeight)Generate coordinates with specified parameters
Example:
@Coordinates(30,60,100,160,5,1:2)
Output:
40.336546,110.232121