Also, add JSON import/export buttons on the createmap page. There are still quite a lot of TODOs I added and haven't done yet, but the delete functionality and changes to createmap should be fully operational. Please let me know how this looks so far.
This branch is not compatible with existing badgerdb's - it creates indexes for stored objects and relies on them for deletion (and for showing all maps on the resume page). Existing games might sort of work but the /maps/all endpoint won't know about them. Might be good to add some kind of versioning and version check (maybe even a migration script) but I'm lazy.
Resolves #65
John LaRocque (eafc30cd) at 16 Apr 20:41
Show Map delete button if remote deletion enabled
John LaRocque (6fc3ded7) at 16 Apr 19:42
Update package, package-lock.json
John LaRocque (0092f01f) at 16 Apr 19:31
Hide map delete button unless hostname is local
John LaRocque (55f49f76) at 16 Apr 19:08
Restrict map deletion to local clients, optionally
... and 1 more commit
I'm working on Map deletion on features/map-editing if you want to test it out. WARNING: not compatible with existing databases, so you should put it in a separate directory (or delete your badgerdb folder if you're okay with losing your Maps etc.)
Also includes a way to import Maps from JSON (so you can share them between servers) and the next step will be to add a way to copy and "edit" an existing Map. I'm not planning on adding direct editing of existing Maps because I'm not sure how to handle in-progress Challenges/Games if their underlying Map gets edited. Open to discussion on that though.
John LaRocque (0cd01ea3) at 15 Apr 00:04
Implement map deletion on backend
John LaRocque (3a9dd729) at 02 Jan 23:53
Benchmark RandPointsInMap, move some files around
John LaRocque (3a36beb8) at 28 Dec 19:29
Add generation of random points in geojson poly
John LaRocque (7937a15e) at 29 Jan 21:41
Improve constrainedLatLng performance
The README currently says:
In all cases, command line arguments override environment variables, which override
.tomlvalues. All configuration options are strings.
This is a lie. The port flag is only read if no value was read from environment variables and config.toml.
We could resolve this by doing one of:
main.go to always check for the port flag.main.go and the README). It's currently the only flag we're using, and I don't imagine it gets a lot of use, so I favor this option.I think this was resolved in the summer refactor and can be closed.
main.go reads config values and flags before doing anything else, and throws a fatal log if any errors are returned.
I think this can be closed - everything has either been given its own Issue or addressed. The config.toml was added in the summer refactor (70849fda I think). Let me know if I've missed anything though.
Replaces the NASA population density GeoTIFF with a higher detail version from the GHSL. This source generally provides much more granular data, though there are still some patchy areas in Africa and central Asia.
ghsl_pop5.tif is a down-res'ed version of the 2015 GHS-POP dataset (WGS84 projection at 9 arcsecond resolution). The original data gives approximate populations under each pixel, but I didn't try to retain this property while reducing the file size. I used GDAL to, in order:
Command: gdal_translate fullpop.tif ghsl_pop5.tif -outsize 25% 0 -exponent 0.5 -scale 0 3000 0 255 -ot Byte -co "COMPRESS=PACKBITS"
The resulting file is 3.8MB (58.4MB decompressed), which I think is acceptable-ish. The problem is, it takes quite a while for the JS GeoTIFF library to decompress this (~30 seconds on my machine), which is less acceptable.
To keep from having to decompress the TIFF every time getLocationPopulation is called, this also makes some modifications to get_places.js. Performance is good once the initial decompression is done, but the script is still a bit messy.
The payoff of these changes is that the resulting location selection is quite good in the testing I've done.
TODO:
John LaRocque (eac5a14a) at 26 Jan 01:46
WIP: Increase population filter detail
This is probably a duplicate of #39. I'm going to spend some time tinkering with the pop density logic, as it seems to be causing lots of issue reports. (Branch will be fixes/popdensity.)
(Also, hello again! Work has chilled out somewhat so I'm working on Earthwalker a bit.)
John LaRocque (a945047e) at 19 Aug 21:07
John LaRocque (16ec2d16) at 17 Aug 19:00
WIP: convert to TypeScript
I've noticed (while browsing r/geoguessr) that there are quite a few other GeoGuessr alternatives out there, some of which are open source.
Here's a list of the ones I'm aware of:
| Name | Link | Tech | Open Source? |
|---|---|---|---|
| EarthWalker | https://gitlab.com/glatteis/earthwalker | Svelte, Go | Yes |
| LocationEstimatr | https://github.com/ruurdbijlsma/locationestimatr2 | Vue, Firebase | Yes |
| 80 Clicks | https://www.eighty-clicks.com/ | MS Stack? | No |
| Geoguess Master | https://github.com/spider-hand/Geoguess-Master-Web | Vue, Firebase | Yes |
| SpotPlot (name may change) | https://spea.cc/spotplot/ | PHP? | No |
There's definitely a lot of work being duplicated here, and each implementation also has its own unique set of features/improvements.
So, my proposal is to reach out to the developers of these and invite them to work together and build one GeoGuessr alternative to rule them all (which may be this or one of the other existing projects, or may be new from-scratch).
Do you think this is viable? Would you want to contribute to such a project?