leonawicz / rtrek

R package for Star Trek datasets and related R functions.
https://leonawicz.github.io/rtrek/
Other
53 stars 4 forks source link

Maps: georeferencing #2

Closed leonawicz closed 3 years ago

leonawicz commented 6 years ago

Georeference locations of interest in the Star Trek universe using high quality Star Trek background maps.

One person can't accomplish a ton of mind-numbing georeferencing so this should be handled by a group of interested volunteers.

Base maps

Any number of interesting Star Trek maps can be used to generate map tile sets that can be hosted online and accessed by rtrek as one of its map options. Making new maps is incredibly easy. The tedious part is georeferencing all the interesting locations on each map so that more can be done (e.g. in Leaflet) with map tiles than merely displaying the tiles.

New maps

Please feel free to suggest a new map to include. It doesn't have to be a map of the galaxy; it could be a planet surface, local system, a ship blueprint layout- anything Star Trek that you think might look really cool in Leaflet with georeferenced points of interest.

However, if you do suggest a new map to include, please do at least a modicum of georeferencing on it to make it a more useful addition to the package. Georeferencing is done most easily on the map tiles (see below), not the original map image. Tiles can be produced from R using the tiler package. (I can do this part if that's easiest to get the tiles online.)

Since these maps get tiled, only consider maps that are very high resolution and quality such that zooming several levels will not degrade the image. If you are not sure, it's probably not a big enough map.

Georeferencing

How to get started

Look here: There are currently two maps. See the stTiles dataset. When georeferencing, each map gets its own data frame. See rtrek::stGeo to see what is currently georeferenced for both maps. It's not much, only a paltry handful of locations. These are just for basic example illustration. But each data frame for each map has the same format, four columns: map ID id, location name loc, image pixel column number col, image pixel row number row.

Look here: The easiest way to get started is to use the preview.html file that exists alongside the tiles directory for a given map. E.g., galaxy1 and galaxy2 (both of which could use a lot more georeferenced points if you want to start there!)

Do this: The preview.html file for a map tile set can be used to interactively georeference locations. Zoom all the way in, click as close to the center of what you wish to reference, and enter the (column, row) pair in the correct columns of the data frame along with the location name and map ID. Rinse and repeat for as many locations as you can tolerate without going insane from the tedium. This is what it takes, commander. :)

Ancillary data

This makes the eventual Leaflet map far more interesting and useful! See st_tiles_data("galaxy1") and st_tiles_data("galaxy2") for examples (and notice how the same places in different maps must be georeferenced separately because each map image will have its own unique, arbitrary coordinate system based on image pixels and the artist's placement of locations).

These tables just attach additional columns containing other variables of interest, which can be linked to a unique map and location on the map by merging place name and ancillary data frames on the common id and loc columns.

Having ancillary data associated with map locations makes maps most useful and interesting. Just base map tiles is boring, you only need to see it once and there is nothing you can do with it. Adding georeferenced locations of interest makes it possible to annotate the map to highlight certain things meaningfully in space, but still doesn't get you anything more. Having interesting data associated with at least some if not all places markable on a map makes it possible to do something more interactive with the map.