Hikar

From OpenStreetMap Wiki
Jump to: navigation, search

Hikar see github repository is an augmented reality app for Android (4.0+) which overlays OpenStreetMap ways on the device's camera feed. Its aim is to help navigation for walkers/hikers (hence the name)and other outdoor users. The colour scheme used is (referring to the highway tag):

  • green = footway
  • brown = bridleway or anything with designation=public_bridleway
  • red = byway
  • orange = track
  • blue = cycleway
  • white = road, or anything else

Demo

See the videos here, here and here. These were taken early September just before SOTM; further work has been done since so it may not look exactly like this.

How it works (briefly)

Hikar uses the Android location and sensor APIs to obtain the location and orientation of the device, then loads OSM data (as GeoJSON, produced from a PostGIS database) and height data (either SRTM or Ordnance Survey LandForm PANORAMA) from the Freemap server. The data is then cached on the device to avoid network access next time you're in that area. The height data is used to position the OSM data in 3D, e.g. overlay a footpath on the slope of a hill so that it appears correctly. The sensor API is used to obtain an orientation matrix which is then used with OpenGL to display the OSM data overlaid on the device's camera feed.

Current status

Hikar basically "works, but with issues" at the moment, with acceptable performance on a Samsung Galaxy SIII, though is not optimised for densely-mapped urban areas and may well crash (it is stable in Southampton but crashed in Birmingham, for instance). Seeing as it is geared at countryside users I do not consider this a massive problem. The main issues at the moment are

  • GPS inaccuracy leading to the OSM way being offset from its true position
  • Difficulty in aligning OSM data with the camera feed when climbing hills due to the difficulty of holding the device steady
  • Occasional compass inaccuracies. I think this is probably a bug which is on the TODO list
  • Rendering needs improvement and some debugging; some odd artefacts overlaying the OSM data on the (near-transparent) height data, particularly noticeable when SRTM data is used rather than OS LandForm PANORAMA.
  • Possible out-of-memory issues when parsing the GeoJSON on low memory devices or when data is dense. In tests, JSON has so far given significantly faster loading/parsing times than either XML or a spatialite database, though if anyone does know of optimisation tricks for the latter, please let me know!

along with some other minor issues.

Obtaining hikar

Please note that Hikar is "researchware" and intended for people who want to play around with the technology, including developers, rather than casual end-users. It was originally part of OpenTrail but has been split off into its own project. Consequently the most up-to-date version is only available as source code. However an apk is occasionally produced, see here. Please prepare for the possibility of the app crashing if you use the APK!

Coverage

As the data is obtained from the Freemap server, coverage of Hikar as it stands is restricted to the areas covered by the Freemap server, namely England and Wales. However it is theoretically possible (but untested) to setup a server which works with Hikar anywhere in the world, see below.

Setting up hikar for your own country

If you are interested in getting Hikar to work in your own country, you will need to setup your own Freemap server: a tile- or bbox-based server of OSM data from a PostGIS database as GeoJSON. You will also need appropriate NASA SRTM height files on your server.

Installing a Freemap server

See Freemap#Setting_up_your_own_Freemap_Server. Ensure you include the SRTM steps.

Setting the hikar preferences to point to your server

In hikar itself, there are three preferences to set so that it talks to your server, not mine:

  • LandForm PANORAMA directory URL (location of LandForm PANORAMA files, irrelevant if you're not in the UK)
  • SRTM web service directory URL (location of the PHP script which generates SRTM tiles covering areas less than one square degree. Location in the repository is Freemap/ws/srtm2.php)
  • OSM GeoJSON web service directory URL (location of the web service generating OSM GeoJSON data; in the repository it is Freemap/0.6/ws/bsvr.php)

Changing the display projection

The display projection is by default 27700 (OSGB projection). However it can be changed to 3857 (Google Spherical Mercator) or theoretically, any projection supported by the Java version of proj.4. So theoretically it should support other countries' national projections. This is untested, however. Projections should be metres-based (eastings and northings measured in metres) as equal x, y and z dimensions are assumed by the OpenGL renderer and heights are in metres. So Google Spherical Mercator, while supported, will actually be a little inaccurate, away from the equator at least, as Google eastings are measured in metres at the equator.

More details

See the Hikar page on the Freemap server.

Author Nick Whitelegg (nickw), last update 13/10/13