Large sample database with latitudes and longitudes

I am looking for a large dataset (preferably in csv format) that has lat/lng coordinates.

PostgreSQL, PostGIS

+4
source share
4 answers

Following my comment, you can use this html page to create as many points as possible.

 <!DOCTYPE html> <html lang="en-au"> <head> <meta charset="utf-8"> <meta http-equiv="pragma" content="no-cache" /> </head> <body> <script type="text/javascript"> function generatePoints(){ var pointsToGenerate = document.getElementById('pointsToGenerate').value; var output = ''; for (i=0;i<pointsToGenerate;i++) { var multiplier = 10000; var latitude=(Math.random()*(90*multiplier))/multiplier; var longitude=(Math.random()*(180*multiplier))/multiplier; latitude *=(Math.floor(Math.random()*2) == 1)?1:-1; longitude *=(Math.floor(Math.random()*2) == 1)?1:-1; output = output + latitude + ',' + longitude + '\n'; } document.getElementById('output').innerHTML = output; } </script> <input type="text" id="pointsToGenerate" value="1000" /> <input type="button" onclick="generatePoints()" value="Generate Points" /> <div><textarea cols=40 rows=10 id="output"></textarea></div> </body> </html> 
+1
source

One liner will generate data in sql:

 test=# select POINT(random()*180-90, random()*90-45)from generate_series(1,5); point -------------------------------------- (79.7833853960037,27.2689918940887) (27.6489242445678,-9.43540174048394) (-51.9591500423849,19.2025181371719) (83.5859301500022,31.8948447704315) (-56.1149036698043,42.5037826504558) (5 rows) 

You can easily add this query to the insert statement and add the desired Postgis function for the geometry, if necessary. The last number "5", of course, controls how many lines will be created.

+6
source

Modeling database activity based on random data is usually not realistic, so be careful with any load or testing queries you make with it. If you really want examples of real coordinates, the datasets available from OpenStreetMap are certainly great. Importing TIGER / Line Shapefiles is one of the best stand-alone example datasets like this, and it is probably easier to handle what was converted to OSM formats.

+2
source

This CSV file contains 228500 lats / long pairs representing interesting points of interest (tourist attractions, etc.) in all countries:

http://datahub.io/dataset/wikivoyage-listings-as-csv

License CC-BY-SA.

0
source

Source: https://habr.com/ru/post/1340248/


All Articles