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.
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
[-s <url>]
: Optional. SAFR CVOS server URL. If this argument isn't provided, then the default value of http://localhost:8086 is used.
[-u <userID>]
: Optional. SAFR account user ID. If this argument isn't provided, you'll be prompted to provide a user ID before the Map Command Line Tool will execute.
[-p <password>]
: Optional. SAFR account password. If this argument isn't provided, you'll be prompted to provide a password before the Map Command Line Tool will execute.
-mapID <mapID>
: Required. Map identifier.
-mapType <mapType>
: Required. The map type. This must be one of 4 values:
[-mapMeta <mapMeta.json>]
: Optional. Map descriptor file in the following JSON format:
{
"name": "string",
"leftLongitude": float,
"rightLongitude": float,
"topLatitude": float,
"bottomLatitude": float
}
-mapImage <mapImage.jpg>
: Required. Map image file. Note that the map file must be in jpg file format.
Deletes a map saved in SAFR.
python safr-map.py [-s <url>] [-u <userID>] [-p <password>] delete -mapId <mapID> [-mapType <mapType>]
where
[-s <url>]
: Optional. SAFR CVOS server URL. If this argument isn't provided, then the default value of http://localhost:8086 is used.[-u <userID>]
: Optional. SAFR account user ID. If this argument isn't provided, you'll be prompted to provide a user ID before the Map Command Line Tool will execute.[-p <password>]
: Optional. SAFR account password. If this argument isn't provided, you'll be prompted to provide a password before the Map Command Line Tool will execute.-mapID <mapID>
: Required. Map identifier of the map you want to delete.[-mapType <mapType>]
: Optional. The map type. This must be one of 4 values:
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
[-s <url>]
: Optional. SAFR CVOS server URL. If this argument isn't provided, then the default value of http://localhost:8086 is used.[-u <userID>]
: Optional. SAFR account user ID. If this argument isn't provided, you'll be prompted to provide a user ID before the Map Command Line Tool will execute.[-p <password>]
: Optional. SAFR account password. If this argument isn't provided, you'll be prompted to provide a password before the Map Command Line Tool will execute.[-mapID <mapID>]
: Optional. Map identifier.[-mapType <mapType>]
: Optional. The map type. This must be one of 4 values:
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
},
...
]
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>]
[-s <url>]
: Optional. SAFR CVOS server URL. If this argument isn't provided, then the default value of http://localhost:8086 is used.[-u <userID>]
: Optional. SAFR account user ID. If this argument isn't provided, you'll be prompted to provide a user ID before the Map Command Line Tool will execute.[-p <password>]
: Optional. SAFR account password. If this argument isn't provided, you'll be prompted to provide a password before the Map Command Line Tool will execute.[-lon1 <lon>]
: Optional. Longitude to be contained within the map area.[-lat1 <lat>]
: Optional. Latitude to be contained within the map area.[-lon2 <lon>]
: Optional. A second longitude to be contained within the map area.[-lat2 <lat>]
: Optional. A second latitude to be contained within the map area.[-mapType <mapType>]
: Optional. The map type. This must be one of 4 values:
[-max <area>]
: Optional. Maximum area (in square kilometers) the map should represent.[-min <area>]
: Optional. Minimum area (in square kilometers) the map should represent.[-c <count>]
: Optional. Maximum number of results to return.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
},
...
]