faker icon indicating copy to clipboard operation
faker copied to clipboard

Match address based data

Open Rpgilligan85 opened this issue 3 years ago • 3 comments

Clear and concise description of the problem

Add support for location data that matches the rest of the data.

Suggested solution

Faker should return location based data to match like the example below,

{
    "country": "United States",
    "countryCode": "USA",
    "lat": 38.8889,
    "long":-77.0591 
}

Right now each value is Random and I am getting something like this,

{
    "country": "United States",
    "countryCode": "CH",
    "lat": -60.419,
    "long": 50.158 
}

Alternative

I have used Mockaroo in the past and they have the functionality working, https://www.mockaroo.com/29c15a10.

Additional context

No response

Rpgilligan85 avatar Jul 05 '22 21:07 Rpgilligan85

Could faker.address.nearbyGPSCoordinate([31, 107], 1000, true) help you? start coordinates are just picked via google maps absolutely inaccurately :)

Shinigami92 avatar Jul 05 '22 21:07 Shinigami92

As for countries and country codes, you can overwrite the default provided values with custom ones, that match your requirements.

ST-DDT avatar Jul 05 '22 22:07 ST-DDT

The USA was just an example, we would be using the entire world for multiple apps. If you check out the link from mockaroo and click preview you can see it works perfectly there. Was hoping for something similar.

Also to add, we are using mockaroo to create a mock API and it uses faker under the hood to generate the data.

Rpgilligan85 avatar Jul 05 '22 22:07 Rpgilligan85