Thursday, January 22, 2015

Processing commands for WiFi maps

In the previous post I have started a story about built-in processing commands for WiFi maps. But the story came out too long for a single post, so I have only managed to cover the starting phase: how to open the command line and how does it look like. Today I'll describe the commands themselves. You can enter several commands in a row delimiting them by spaces. The commands will be executed in the same order as they occur in the editbox.

  • clear:name - clears names of all points
  • clear:neighbors - clears all neighbors (links between points); can be useful after attempt to generate neighbors with inappropriate neighborhood radius
  • clear:signals - clears detailed WiFi measurements (scans) stored in points, but leaves information about detected hotspots and their average signal levels in each point - this may help to shrink map size but prevents probabilistic location algorithm from functioning
  • lineup:IDs-IDe - aligns a series of successive points with identificators IDs-IDe to the starting point IDs; IDs can be larger than IDe or vice versa; alignment is performed in direction with longest distance between points IDs and IDe, for example, if delta in X coordinate is 1000 and delta in Y coordinate is 100 the points will be aligned in a horizontal line with Y equal to Y of the starting point IDs and preserved X coordinates
  • stretch:IDs-IDe-PERCENTS - expands or squeezes a series of points in direction from IDs to IDe; again IDs can be larger than IDe or vice versa; the PERCENTS is the added fraction of initial distance between the starting point and every other point till the point IDe; for example, if PERCENTS is 10, all points will be moved by 1/10 part of their corresponent distances from IDs; both X and Y directions will be affected
  • shift:IDs-IDe-DX-DY - shifts the points from IDs to IDe by the specified number of image logical pixels in X and Y axes correspondingly
Here is the example of processing command executed on the Kaleidoscope map:

clear:name lineup:1-116 lineup:117-221 lineup:478-462 lineup:435-461 lineup:479-499 lineup:412-434 lineup:385-411 lineup:355-384 stretch:479-499-12 shift:550-575-5-0

The same commands can be executed automatically during XML-map loading. For this purpose a new XML-tag was added to the map specification: preprocess. The tag is optional. The map header example:

<place xmlns="http://weborienteer.com/wifiline">
  <desc>
    <header>
      <id>RU.MM.SZAO.KA</id>
      <name>Kaleidoscope Shopping Center</name>
      <date>2015-01-10 10:10:10</date>
      <coordinates longitude="37.4446" latitude="55.850567" />
      <format>1.2</format>
      <images default="1" scale="85">
        <image floor="1" svgfile="k1.svg" azimuth="155.0"></image>
      </images>
      <preprocess>clear:name lineup:1-116 lineup:117-221 lineup:478-462 lineup:435-461 lineup:479-499 lineup:412-434 lineup:385-411 lineup:355-384 stretch:479-499-12 shift:550-575-5-0</preprocess>
    </header>
  </desc>
  ...
This new feature will hopefully help to refine WiFiLine maps and make them good looking.

No comments:

Post a Comment