Skip to content

Commit caee338

Browse files
author
mgoddard
committed
Notes on the newly added table, manipulating it, and firing up Admin UI and SQL client
1 parent bafb8d8 commit caee338

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

README.md

+32-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ corresponding to the area shown in the figure below. The result of this operati
5050
was a 36 GB Bzip'd XML file (not included here). This intermediate file was then
5151
processed using [this Perl script](./osm/extract_points_from_osm_xml.pl), with the
5252
result being piped through Gzip to produce a [smaller data
53-
set](https://storage.googleapis.com/crl-goddard-gis/osm_250k.txt.gz) containing points in the areas the app focuses on.
53+
set](https://storage.googleapis.com/crl-goddard-gis/osm_475k_eu.txt.gz) containing
54+
points in the areas the app focuses on.
5455

5556
![Boundary of OSM data extract](./osm/OSM_extracted_region.jpg)
5657

@@ -74,6 +75,25 @@ CREATE INDEX ON osm USING GIN(ref_point);
7475
```
7576
**NOTE:** `./load_osm_stdin.py` creates the `osm` table and the GIN index if they don't already exist.
7677

78+
There is an additional table, `tourist_locations` (see below), which contains the set of places where
79+
our "tourist" might be situated when the page loads. This is populated by `load_osm_stdin.py`. Only
80+
locations for which `enabled` is `TRUE` will be used, so the number of possible locations can be
81+
managed by manipulating the existing rows in this table, or by adding new ones, so long as the new
82+
points lie within the area shown in the rectangular area on the above map.
83+
84+
```
85+
defaultdb=# show columns from tourist_locations;
86+
column_name | data_type | is_nullable | column_default | generation_expression | indices | is_hidden
87+
-------------+-----------+-------------+----------------+-----------------------+-----------+-----------
88+
name | STRING | f | | | {primary} | f
89+
lat | FLOAT8 | t | | | {} | f
90+
lon | FLOAT8 | t | | | {} | f
91+
enabled | BOOL | t | true | | {} | f
92+
(4 rows)
93+
94+
Time: 34.470 ms
95+
```
96+
7797
[The Flask app](./map_app.py) runs one of two variations of a query, depending
7898
on whether the environment variable `USE_GEOHASH` is set and, if so, its value
7999
(`true` or `false`), as shown in the following code block (line numbers have
@@ -256,6 +276,17 @@ Events:
256276
Normal EnsuredLoadBalancer 8m1s service-controller Ensured load balancer
257277
```
258278

279+
* To view the admin UI, set up port forwarding to your CockroachDB deployment:
280+
```
281+
kubectl port-forward cockroachdb-0 8080
282+
```
283+
Once this is done, clicking [this link](http://localhost:8080/) should cause your browser to open this UI.
284+
285+
* A SQL client can be started as well:
286+
```
287+
kubectl run cockroachdb -it --image=cockroachdb/cockroach --rm --restart=Never -- sql --insecure --host=cockroachdb-public
288+
```
289+
259290
### If you need to rebuild the Docker image
260291

261292
Edit Dockerfile as necessary, and then change `./docker_include.sh` to set

0 commit comments

Comments
 (0)