Giter VIP home page Giter VIP logo

offlineviewer's Introduction

OHDM Offline Viewer

View OHDM maps offline

HOME MAP

DOWNLOAD ABOUT

Goal of this project

The goal of this repository is to render Open Street Maps, without the need of a network connection. To avoid caching dozens of different zoom layers, vector tiles are being used. This makes the navigation and zoom interaction fast.

Getting Started

Follow these instructions to build and run the OHDM Offline Viewer

  1. git clone https://github.com/OpenHistoricalDataMap/OfflineViewer.git
  2. Install Android Studio.
  3. Downlaod Open Historical Data maps
  4. Import the project. Open Android Studio, click Open an existing Android Studio project and select the project. Gradle will build the project.
  5. Connect your Android Device with your Computer.
  6. Run the app. Click Run > Run 'app'. After the project builds you'll be prompted to build or launch an emulator. You then can choose your mobile phone.
  7. Open View > Tool Windows > Device File Explorer and place your maps in your mobile phone device storage. There should be a OHDM (In the android emulator, you may have to create it: Device Explorerer > sdcard > New) directory in the internal storage.

Convert .osm to .map-files

We're using osmosis with the mapsforge-map-writer-plugin to convert .osm maps to .map.

In order to use osmosis, just execute /osm2map/osm2map.sh as sudo.

The following code-block shows a successful execution:

user@host:~$ sudo bash osm2map.sh 

Downloading osmosis to /opt/osmosis.
...

Downloading mapwriter plugin /opt/osmosis.
...

Download and build successful finished.
  
osmosis usage:
    /opt/osmosis/bin/osmosis --rx file=path-to-osm-file.osm --mw file=destination-path-map-file.map

Then you can begin to convert your own map-files with:

/opt/osmosis/bin/osmosis --rx file=path-to-osm-file.osm --mw file=destination-path-map-file.map

Use custom map-file download center

This application has an integrated download functionality for map files. This makes it possible to host various map files on a remote server. You then can easily download them using the app. The following steps will guide you through the installation and configuration:

WARNING: At this point of development, the download center is a simple FTP server that does not meet any security requirements. Using it in productivity, will make your server extremely vulnerable.

Prerequisites

We're using docker and docker-compose to run the FTP server.

Go through the official documentation in order to get both components installed.

Build

Open map-file-download-center/docker-compose.yml and change the environment variables to your needs: In this example, every file in /opt/ohdm/ will be shown in the android application. Make sure, that there are actually map-files in the directory you specified under volumes in the docker-compose.yml.

version: "3.3"
services:
  vsftpd:
    container_name: vsftpd
    image: panubo/vsftpd
    ports:
      - "21:21"
      - "4559-4564:4559-4564"
    restart: always
    environment:
      FTP_USER: ohdm
      FTP_PASSWORD: ohdm
      FTP_USERS_ROOT: 
    network_mode: "host"
    volumes:
      - /opt/ohdm:/srv/ohdm

Now you can start the container with

docker-compose up

If successful, you should see

...
vsftpd    | Received SIGINT or SIGTERM. Shutting down vsftpd
vsftpd    | Running vsftpd

at the end of the output. Great, now you can begin to adjust the source code to point the app to your ftp server

Configure

Open the file app/src/main/java/de/htwBerlin/ois/Activities/MapDownloadActivity.java:

and change the parameter with the values you just used in the docker-compose file:

...
private static final String FTP_SERVER_IP = "";
private static final Integer FTP_PORT = 21;
private static final String FTP_USER = "";
private static final String FTP_PASSWORD = "";
...

Deploy

Just install the application again on your device with Android Studio.

In order to host map-files on the FTP server, just copy the files to /opt/ohdm/

You then should see the listed files in the Maps tab.

You can start the container with docker-compose up -d in background.

Contact

Developed by: FalcoSuessgott

Project Link: Open Historical Data Map

Institution: HTW Berlin

Mail: [email protected]

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.