Coder Social home page Coder Social logo

mapsona's Introduction

This is mapsona, the code that runs Maps on a Stick. It's a purely client-side mapping tool aimed at carrying around tilesets and mashing up information with minimal internet connectivity.

Installation

Basic Installation

  • Download the mapsona code either with git or as a zip or tgz file from GitHub.
  • This code doesn't include any map tiles because of their size: you'll need to download them seperately. Here are two tilesets that are freely downloadable: the world up to zoom level 8 and the world up to zoom level 9. Download one of these (if you aren't sure, up to zoom 8 will be much faster to transfer).
  • Download and decompress the tileset: the examples produce a folder called world-dark.
  • Move the tileset to the tiles/1.0.0/ directory of the mapsona code. So its path should now be tiles/1.0.0/world-dark/.
  • Open start.html in a browser.

Full documentation is located in the start.html file, which is browsable once the package is downloaded.

Code that Mapsona uses

Imaging Drives

Flash drives are fast for many things - flash memory, especially when it's used in SSDs, has gotten a good reputation for being fast. However, flash, like many types of storage, has some problems dealing with lots of small files, so it's impractical to simply copy map tilesets from your computer to a USB drive. We're working on a better solution which consists of making an disk image, like an ISO, of the data you want to put on a drive, and then writing that image, complete with a filesystem, to the drive.

Requirements

  • This process will require familiarity with some low-level POSIX utilities, especially dd. This is not a guide you can run through by copying commands - it will require, at the very least, careful editing of the sample commands.
  • This is written for Apple Macintosh computers. POSIX equivalents to Mac helper applications like hdiutil certainly exist and a guide for doing this with Linux, etc., is certainly possible.

Create an Image from Folder

sudo hdiutil create -verbose -fs MS-DOS -fsargs "-F 32 -c 16" -volname "Maps on a Stick" -srcfolder your_map_application your_map_application.dmg

This command creates an Apple Disk Image from a folder on your computer. Notably, the image will have a FAT32 filesystem - the -F 32 argument specifies that this will be the case, rather than FAT16, which is limited to a 2 gigabyte partition.

Attach the Image as a Device

hdiutil attach -nomount your_map_application.dmg

Note the output of this command: if it succeeds, it will report something like /dev/disk3.

Attach USB Drive

Put the USB flash device in your computer's USB port, and then run df in the console and note the output. The leftmost column shows what the device of the USB flash drive is, and the rightmost will show the mount point. Remember the left column (which will be something like /dev/disk1s2) and then run

umount /Volumes/USBDrive

To unmount the drive

Image the drive

Make absolutely sure that the if and of parameters of the following command are accurate; the dd utility is able to write over essential data if you accidentally put the device of another drive in the of parameter.

sudo dd if=/dev/FROM_DISKIMAGE of=/dev/TO_USBDRIVE bs=32k

You can tune the last parameter, bs, which specifies the block size of the transfer operation.

Checking progress

The dd operation that is now running can take a while, and it doesn't provide any status information. However, it can.

Open a new terminal and run

~$ ps aux | grep "dd" tmcw 1797 0.3 0.0 2425520 176 s001 R+ 12:30PM 0:00.01 grep dd root 1698 0.1 0.0 2434768 252 s000 U+ 12:18PM 0:01.67 dd if=/dev/disk2 of=/dev/disk1s2 bs=32k root 58 0.0 0.0 2436444 852 ?? Ss 10:16AM 0:00.04 /usr/libexec/hidd

Note the process id: the first number in the row of your dd process. In the above output, it is 1698. Use this id in the following command.

~$ sudo kill -s INFO PROCESS_ID

Going back to the terminal which is running dd will show a count of how many bytes have been transferred. To get a figure in megabytes, you can use the units utility.

~$ units "70000 bytes" "megabytes" * 0.066757202 / 14.979657

So, 70000 bytes is 0.06 megabytes.

When dd completes, it will output a summary of how much information was transferred and in what timeframe.

mapsona's People

Contributors

ajashton avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.