From cf72653785aa9370b9132a235b1315cd685f354c Mon Sep 17 00:00:00 2001 From: thisisaaronland Date: Fri, 4 Dec 2020 16:48:10 -0500 Subject: [PATCH] update docs --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4cb31887..572cd979 100644 --- a/README.md +++ b/README.md @@ -68,13 +68,15 @@ $> bin/server -h The URL path for the interactive debug endpoint. (default "/debug") ``` -For example: +#### Example: + +First get some data: ``` $> git clone https://github.com/whosonfirst-data/whosonfirst-data-admin-cn.git /usr/local/data/whosonfirst-data-admin-cn ``` -And then: +Then index it, and make it available via the HTTP `server` tool on port 8080: ``` $> go run -mod vendor cmd/server/main.go \ @@ -89,9 +91,9 @@ $> go run -mod vendor cmd/server/main.go \ 13:58:12.670963 [main] STATUS finished indexing in 1h17m0.812868967s ``` -See the way it took an hour and seventeen minutes to index 680, 000 records? That's not great, it just _is_ right now. +See the way it took an hour and seventeen minutes to index 680, 000 records? That's not great, it just _is_ right now. The default spatial index (database) is an in-memory RTree that needs to be populated at start up so the amount of time that takes will depend on the amount of data you have and the constraints of the machine you're working. There is ongoing work to use precompiled (SQLite) spatial indexes but that work isn't complete yet. -And then: +Finally, start querying the data: ``` $> curl 'http://localhost:8080/api/point-in-polygon?latitude=39.509167&longitude=116.410556'