Am Trying to Generate Random Coordinates for a Country
I used this library Faker
def geo_point():
"""make random cordinates"""
faker = factory.Faker('local_latlng', country_code = 'IN')
coords = faker.generate()
return (coords[1], coords[0])
But the problem in this is, it has a very limited set of coordinates around 30-40 we require at least 10,000 for testing.
I tried a simple approach
def random_geo_cordinate():
"""make random geocordinates"""
x, y = uniform(-180,180), uniform(-90, 90)
return (y, x)
But then only 10-20 coordinates for Specific Country Comes.
There were a lot of references I found that through shape_files we can generate but in all of them only geom parameters are only available.
I found a method through which I can check that these coordinates lie in that country or not via the Geom column.
But am still missing something in generating random coordinates for a country.
Is there any simple and direct approach.
Am using
POST GIS Database
GeoDjango Server
Note:
- I used GDAL for getting shapefiles for a country