Map Command Line Tool

The SAFR Map Command Line Tool, safr-map.py, facilitates the easy addition, removal, and enumeration (listing) of maps available in SAFR. It's located in the SAFR/bin folder, so if you installed SAFR in the default location, the Map Command Line Tool is located at C:\Program Files\RealNetworks\SAFR\bin\safr-map.py.

Note: In order to use safr-map.py, ensure that you have Python installed.

Add Maps

Uploads a map to SAFR.

python safr-map.py [-s <url>] [-u <userID>] [-p <password>] add [-mapId <mapID>] -mapType <mapType> [-mapMeta <mapMeta.json>] -mapImage <mapImage.jpg>

where

Delete Maps

Deletes a map saved in SAFR.

python safr-map.py [-s <url>] [-u <userID>] [-p <password>] delete -mapId <mapID> [-mapType <mapType>]

where

List Maps

Returns the map metadata for the maps saved in SAFR that match the specified map type(s) and/or mapID(s).

python safr-map.py [-s <url>] [-u <userID>] [-p <password>] list [-mapId <mapID>] [-mapType <mapType>]

where

The server will return JSON descriptions of the relevant saved map(s):

"maps": [
    {
        "id": "string",
        "name": "string",
        "type": "string",
        "leftLongitude": float,
        "rightLongitude": float,
        "topLatitude": float,
        "bottomLatitude": float,
        "area": float
    },
    ...
]

Find Maps

Returns the map metadata for the maps saved in SAFR that match the specified geolocational parameters (i.e. latitude, longitude, etc.).

python safr-map.py [-s <url>] [-u <userID>] [-p <password>] find [-lon1 <lon> -lat1 <lat>] [-lon2 <lon> -lat2 <lat>] [-mapType <mapType>] [-max <area>] [-min <area>] [-c <count>]

The server will return JSON descriptions of the saved map(s) that meet the search criteria:

"maps": [
    {
        "id": "string",
        "name": "string",
        "type": "string",
        "leftLongitude": float,
        "rightLongitude": float,
        "topLatitude": float,
        "bottomLatitude": float,
        "area": float
    },
    ...
]

See Also