Skip to content

Commit

Permalink
add README for geo-picking tools
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Mar 14, 2019
1 parent e8f7519 commit 53f2fe2
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
27 changes: 27 additions & 0 deletions threejs/lessons/tools/geo-picking/README.md
@@ -0,0 +1,27 @@
# Geo Picking Data

These tools were used to generate data for both
[the article on aligning HTML elements to 3D](https://threejsfundamentals.org/threejs/lessons/threejs-align-html-elements-to-3d.html)
and [the article on using indexed textures for picking and color](https://threejsfundamentals.org/threejs/lessons/threejs-indexed-textures.html)

I'm not going to go into details on how they work but you can look inside
and see them draw the images and extract the data. Maybe you can use them
to make or extract similar maps from other data.

The one I actually used is `make-geo-picking-texture.html`. To run it you need
to download the data from [here](http://thematicmapping.org/downloads/world_borders.php)
then unzip it and put it in this folder.

Then run a simple server. If you don't already know how to do that [here's a simple one](https://greggman.github.io/servez/)
that will take just a few clicks to use. Run it, point it at this folder, then load `make-geo-picking-texture.html`
in your browser.

There's also another one called `make-geo-picking-texture-ogc.html`. It works with data from
[here](https://gadm.org/download_world.html). To use that one download the database then use
a tool like [https://sqlitebrowser.org/](https://sqlitebrowser.org/). Open the database and
export the table called `level1` to a json file called `level1.json`

Then run a simple server like above and open `make-geo-picking-texture-ogc.html` in your browser.



Expand Up @@ -107,8 +107,7 @@

const colors = {};

//const req = await fetch('level1.json');
const req = await fetch('foo.json');
const req = await fetch('level1.json');
const areas = await req.json();
let min = [Number.MAX_VALUE, Number.MAX_VALUE];
let max = [Number.MIN_VALUE, Number.MIN_VALUE];
Expand Down
File renamed without changes.

0 comments on commit 53f2fe2

Please sign in to comment.