{"repo":"cockroachlabs-field/crdb-geo-tourist","free":true,"listed":false,"github":"https://github.com/cockroachlabs-field/crdb-geo-tourist","clone":"git clone https://github.com/cockroachlabs-field/crdb-geo-tourist.git","description":"GIS demo: find pubs, restaurants, cafes, etc. using the spatial features of CockroachDB","language":"Python","stars":18,"topics":["database","k8s","kubernetes","cockroachdb","spatial","gis","leafletjs","mapbox","openstreetmap","travel"],"license":"Apache-2.0","category":"deployment-docker-iac","readme_excerpt":"CockroachDB Geo Tourist Use the spatial features in CockroachDB to find pubs, restaurants, cafes, etc. (App shown running on a laptop) This is a simple Python Flask and Javascript app which illustrates some of the new spatial capabilities in CockroachDB 20.2. The scenario is this: in the Web app, an icon represents the user, and this user is situated at a location randomly chosen from a set of destinations, each time the page is refreshed. Then, an HTTP POST is made from the Javascript front end, including the user's location and the type of amenity to search for. Within the Python Flask app, those values are featured in a SQL query against a CockroachDB instance loaded with spatial data. This query uses the following spatial data types, operators, and indexes to find and return a set of the nearest amenities, sorted by distance: 1. GEOGRAPHY : the data type to represent each of the POINT data elements associated with the amenity 1. ST Distance : used to calculate the distance from the user to each of these locations 1. ST Y and ST X : are used to retrieve the longitude and latitude of each of these points, for plotting onto the map 1. ST DWithin : used in the WHERE clause of the SQL query to constrain the results to points within 5km of the user's location 1. ST MakePoint : converts the longitude and latitude representing the user's location into a POINT 1. A GIN index on the ref point column in the osm table speeds up the calculation done by ST DWithin 1. ST GeoHash : to cr","default_branch":null,"files":null,"tree":[],"storefront":"/r/cockroachlabs-field","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/cockroachlabs-field/crdb-geo-tourist/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}