| |
- changeRoom(r_id, options={})
- Changes the basic values of a room. Returns true if successful, false if not.
Options may contain any of the keywords "r_alias", "utm_zone", "utm_easting", "utm_northing",
"r_level" and "r_defaultmap". See createRoom() for a more detailed description and restrictions.
Usage:
changeRoom(string r_id, struct options) => True
Example:
changeRoom('0013A@0510',{'r_alias':'Wartezimmer','r_level':'2','r_defaultmap':'12'}) => True
Note:
You must be authenticated to use this method.
- createRoom(r_number, r_building, r_alias, utm_zone, utm_easting, utm_northing, r_level, r_defaultmap)
- Creates a new room. Returns true if successful, false if any parameter is invalid or the
room already exists.
"r_number" is the room number. Concatenated with "@" + "r_building" this will be the new r_id for
this room, thus "@" is not allowed in both values. "r_building" must be a valid building id,
see getBuildings().
"r_alias" is an arbitrary description. "utm_zone", "utm_easting" and "utm_northing" must be
valid parts of a UTM-coordinate. "r_level" signifies the floor of the room and "r_defaultmap" is
used by getDefaultMap() to define the most usable map to display the room location. "r_defaultmap"
must be a valid map id.
Usage:
createRoom(string r_number, string r_building, string r_alias, string/int utm_zone,
string/float utm_easting, string/float utm_northing, string r_level, string/int r_defaultmap) => boolean
Example:
createRoom('0013A', '0510', 'Vorraum', '32', '691050', '5336029.5', '0', '12') => True
Notes:
You must be authenticated to use this method. See deg2utm() to get valid UTM values based on
geographical GPS coordinates.
- deg2utm(longitude, latitude)
- Convert GPS coordinates to UTM using WGS84. Reverse of utm2deg().
Usage:
deg2utm(double longitude, double latitude) => [string zone, double easting, double northing]
Example:
deg2utm(11.623819150446307, 48.137808711331623) => ("32U",695195.89057254372, 5334946.9963395325)
- degFloat2DegMinSec(degree)
- Converts one float part of a geo coordinate to a degree-minute-second representation.
Reverse method: degMinSec2DegFloat()
Usage:
degFloat2DegMinSec(double degree) => [int degrees, int minutes, double seconds]
Example:
degFloat2DegMinSec(11.623819150446307) => [11, 37, 25.748941606705529]
- degMinSec2DegFloat(degrees, minutes, seconds)
- Convert degree-minute-second to geographic float coordinates.
Reverse method: degFloat2DegMinSec()
Usage:
degMinSec2DegFloat(int/double degrees, int/double minutes, double seconds) => [double degree]
Example:
degMinSec2DegFloat(11,37,25.748941606705529) => 11.6238191504
- delRoom(r_id)
- Completely deletes a room. Warning: All associated room information and meta files are also
deleted. Returns true if successful, false if not. A Room can be created with createRoom()
and changed with changeRoom().
Usage:
delRoom(string r_id) => boolean
Example:
delRoom('4124A@0501') => true
Note:
You must be authenticated to use this method.
- delRoomInfo(r_id, a_name)
- Completely removes room info 'a_name' even if not empty. Returns true if successful,
false if not. Room information can be created with setRoomInfo() and queried with
getRoomInfo().
Usage:
delRoomInfo(string r_id, string a_name) => boolean
Example:
delRoomInfo('4124A@0501','Beamer') => true
Note:
You must be authenticated to use this method.
- delRoomMeta(meta_id)
- Deletes the meta file with id 'meta_id'. Meta files can be stored with setRoomMeta() and
listed with getRoomMetas(). A single meta file is fetched with getRoomMeta().
Usage:
delRoomMeta(string/int meta_id) => boolean
Example:
delRoomMeta(42) => True
Note:
You must be authenticated to use this method.
- existBuilding(b_id)
- Returns True if a building with id 'b_id' exists, False if not.
Usage:
existBuilding(string r_id) => Boolean
Example:
existBuilding('0501') => True
- existRoom(r_id)
- Returns True if a room with id 'r_id' exists, False if not.
Usage:
existRoom(string r_id) => Boolean
Example:
existRoom('4124A@0501') => True
- flagGeo(longitude, latitude, map_id, options={})
- Flags the given geo coordinate on map with map_id, returns the map image as base64 encoded
string and the appropriate mime-type.
Usage:
flagGeo(double longitude, double latitude, int map_id)
=>
[base64 imagedata, string mime-type]
Example:
flagGeo(11.5683212638,48.1487376031,10)
=>
['R0lGODlhlgCWAMQAAAAAAN/f4PHVEpuHC1dK...','image/gif']
- flagUtm(zone, easting, northing, map_id, options={})
- Flags the given utm coordinate on map with map_id, returns the map image as base64 encoded
string and the appropriate mime-type.
Usage:
flagUtm(string zone, int easting, int northing, int map_id)
=>
[base64 imagedata, string mime-type]
Example:
flagUtm("32",691027,5336022)
=>
['R0lGODlhlgCWAMQAAAAAAN/f4PHVEpuHC1dK...','image/gif']
- getBuildingData(b_id)
- Returns building data for exactly one building, avoiding multiple results.
Usage:
getBuildingData(string b_id) => struct
Example:
getBuildingData('0509') =>{'b_name': 'Neubau Innenhof','b_alias': 'Wienandsbau',
'b_area': 'Zentralgelände','b_id':'0509',
'utm_zone': '32','utm_easting': 690926.2977,
'utm_northing': 5336090.5824}
- getBuildingDefaultMap(b_id)
- Returns a map description of the default map of a building. Returns an array like one of
method getBuildingMaps():
Usage:
getBuildingDefaultMap(string building_id) => [string scaling, int map_id, string description, int width, int height]
Example:
getBuildingDefaultMap('0501') => [4000,12,'Stammgelände Basiskarte',501,484]
- getBuildingMap(b_id, m_id, options={'style': 'cross'})
- Returns a image with the building maped on it as a base64 encoded string. As a hint to
create the image client side, the appropriate mime-type is provided.
Usage:
getBuildingMap(string building_id, int map_id) => [base64 imagedata, string mime-type]
Example:
getBuildingMap('0506',12) => ['R0lGODlhlgCWAMQAAAAAAN/f4PHVEpuHC1dK...','image/gif']
Note:
A simple approach to get a building on a map is getBuildingDefaultMap(). Please don´t forget to
decode the result[0] part to get a raw byte sequence for sending/creating the image.
- getBuildingMaps(b_id)
- Get a description of all Maps for a building, ordered by map scaling. See getBuildingDefaultMap() to get
the default map to locate a building.
Usage:
getBuildingMaps(string b_id) => [[string scaling, int map_id, string description, int width, int height],...]
Example:
getBuildingMaps('1601@0506') => ['4700' , 10, 'Lageplan TUM', 657, 951],
['5300' , 12, 'Stammgelände Basiskarte', 501, 484],
- getBuildingPlacemark(b_id, options={})
- Returns a Google Earth Placemark of the building similar to getRoomPlacemark().
Options may be 'map' and 'transparency'. If option 'map' has a valid map id, an Google
Earth map overlay will be generated in addition to the room placemark. Option 'transparency' may
be a value between 0 (not visible) and 1 (complete opaque) and controls the map overlays
tranparency. If omitted, the default for a map overlay is '0.87' which is somewhat transparent.
Usage:
getBuildingPlacemark(string building_id, struct options) => [base64 filedata, string mime-type, string filename]
Example 1: Get a simple building placemark for Goolge Earth:
getBuildingPlacemark('0506') => ['R0lGODlhl...','application/vnd.google-earth.kmz','RoomFinder.kmz']
Example 2: Get a building placemark for Goolge Earth, combined with a map overlay on map with id 81:
getBuildingPlacemark('0506',{'map':'81','transparency':'0.8'}) => ['R0lGODlhl...','application/vnd.google-earth.kmz','RoomFinder.kmz']
- getBuildings(site_id='')
- Get a list of current buildings. If site_id is omitted, a complete list will be returned.
Usage:
getBuildings(string site_id) => struct
Example, get all buildings in site area '05' which correlates with TUM Central Area.
getBuildings('05')
=>
{'b_alias': '', 'b_area': 'Zentralgelände', 'b_id': '0501', 'b_name': 'Institutsbau', 'b_roomCount':29},
{'b_alias': '', 'b_area': 'Zentralgelände', 'b_id': '0502', 'b_name': 'Bestelmeyer Süd', 'b_roomCount':5},
{'b_alias': '', 'b_area': 'Zentralgelände', 'b_id': '0507', 'b_name': 'Bestelmeyer Nord', 'b_roomCount':9},
{'b_alias': '', 'b_area': 'Zentralgelände', 'b_id': '0503', 'b_name': 'Thierschbau', 'b_roomCount':222},
{'b_alias': '', 'b_area': 'Zentralgelände', 'b_id': '0506', 'b_name': 'Theresianum', 'b_roomCount':13},
{'b_alias': '', 'b_area': 'Zentralgelände', 'b_id': '0504', 'b_name': 'Landwirtschaftsbau', 'b_roomCount':4},
{'b_alias': '', 'b_area': 'Zentralgelände', 'b_id': '0505', 'b_name': 'Maschinenwesen', 'b_roomCount':0},
{'b_alias': 'Wienandsbau', 'b_area': 'Zentralgelände', 'b_id': '0509', 'b_name': 'Neubau Innenhof', 'b_roomCount':377},
{'b_alias': '', 'b_area': 'Zentralgelände', 'b_id': '0510', 'b_name': 'Verwaltungsbau', 'b_roomCount':143},
{'b_alias': '', 'b_area': 'Zentralgelände', 'b_id': '0511', 'b_name': 'El.Wst./Lösm.-Bunker', 'b_roomCount':0},
- getDefaultMap(r_id)
- Returns a map description of the default map of the room. Returns an array like one of
method getRoomMaps():
Usage:
getDefaultMap(string room_id) => [string scaling, int map_id, string description, int width, int height]
Example:
getDefaultMap('2100@0501') => [4000,12,'Stammgelände Basiskarte',501,484]
- getGeoMaps(longitude, latitude)
- Get a list of maps within the given geo coordinate is located, ordered by mapscale. Works like
getUtmMaps() but uses geographical coordinates.
Usage:
getGeoMaps(double/int longitude, double/int latitude)
=>
[[string scaling, int map_id, string description, int width, int height],...]
Example:
getGeoMaps(11.563,48.147) => [['4700' , 10, 'Lageplan TUM', 657, 951],
['5300' , 12, 'Stammgelände Basiskarte', 501, 484],
['100000000', 9, 'Weltkarte Norden', 1619, 396]]
- getMapImage(m_id)
- Returns the chosen Map as array, containing the Image as base64 encoded string and
the mime-type of the image.
Usage:
getMapImage(int map_id) => [base64 imagedata, string mime-type]
Example:
getMapImage(12) => ['R0lGODlhlgCWAMQAAAAAAN/f4PHVEpuHC1dK...','image/gif']
Note:
Please don´t forget to decode the result[0] part to get a raw byte sequence for
sending/creating the image.
RoomFinder supports getMapImage() 'directly' via HTTP GET as of version 0.6.1.0. This is
used by getRoomPlacemark() and getBuildingPlacemark() to deliver map images directly to
a GoogleEarth client. The placemark contains only a link to this server instead of a
zipped map.
- getMaps()
- Get a list of all available maps. See also getGeoMaps() and getUtmMaps().
Usage:
getMaps() =>[[string scaling, int map_id, string description, int width, int height],...]
Example:
getMaps() => [['4700' , 10, 'Lageplan TUM', 657, 951],
['5300' , 12, 'Stammgelände Basiskarte', 501, 484],
['100000000', 9, 'Weltkarte Norden', 1619, 396]]
- getRoomData(r_id)
- Returns room data for exactly one room, avoiding multiple results. The returned struct is the same
as one of the structs provided by searchRoom() plus utm-coordinates. Use this method if details
of one distinct room are needed.
Usage:
getRoomData(string r_id) => struct
Example:
getRoomData('4124A@0501') =>{'b_name': 'Institutsbau', 'b_area': 'Zentralgelände', 'b_alias': '',
'b_id':'0501', 'r_level': '4', 'r_number': '4124A', 'r_alias': 'SEMINARRAUM',
'r_id': '4124A@0501','utm_zone': '32','utm_easting': 691005.0243,
'utm_northing': 5336051.8819}
- getRoomInfo(r_id, a_name=None)
- Return additional room information as dictionary. If a_name is given, only a room info
of that name is returned. Room information can be created with setRoomInfo() and deleted
with delRoomInfo().
Usage:
getRoomInfo(string r_id, string a_name=None) => struct
Example 1:
getRoomInfo('4124A@0501')
=>
{'Nutzung': 'Hörsaal', 'Größe': '66qm²', 'Beamer': '1600 Ansi Lumen', 'Mietbar': 'Ja'}
Example 2:
getRoomInfo('4124A@0501','Beamer') => {'Beamer': '1600 Ansi Lumen'}
- getRoomMap(r_id, m_id, options={})
- Returns a image with the room maped on it as a base64 encoded string. As a hint to
create the image client side, the appropriate mime-type is provided.
Usage:
getRoomMap(string room_id, int map_id) => [base64 imagedata, string mime-type]
Example:
getRoomMap('1601@0506',12) => ['R0lGODlhlgCWAMQAAAAAAN/f4PHVEpuHC1dK...','image/gif']
Note:
A simple approach to get a room on a map is getDefaultMap(). Please don´t forget to
decode the result[0] part to get a raw byte sequence for sending/creating the image.
- getRoomMaps(r_id)
- Get a description of all Maps for a room, ordered by map scaling. See getDefaultMap() to get
the default map for a room.
Usage:
getRoomMaps(string room_id) => [[string scaling, int map_id, string description, int width, int height],...]
Example:
getRoomMaps('1601@0506') => [['3100' , 5, 'SGK Ausschnitt ungedreht', 864, 523],
['4700' , 10, 'Lageplan TUM', 657, 951],
['5300' , 12, 'Stammgelände Basiskarte', 501, 484],
['100000000', 9, 'Weltkarte Norden', 1619, 396]]
- getRoomMeta(meta_id)
- Gets one meta file for a room. Returns a struct with meta_id, mime-type, description, the size in bytes and
the base64 encoded data. Get a complete list for a single room with getRoomMetas(). Metafiles can
be created with setRoomMeta() and deleted with delRoomMeta().
Please note, that RoomFinder supports getRoomMeta() 'directly' via HTTP GET as of version 0.5.3.0. So the
alternate approach to send attached files to the user is to provide a link to this server. Encoding and
decoding large files is not neccessary this way. The following xml-rpc example file could also be sent
to the user by using the link http://this.servers.url/getRoomMeta?meta_id=42
Usage:
getRoomMeta(string/int meta_id)
=>
{'meta_id': int id, 'm_type':string mime-type,'m_desc':string description,'m_size':int size,'m_data':base64 data,'m_name':string name}
Example:
getRoomMeta(42)
=>
{'meta_id':42,'m_type':'video/quicktime','m_desc':'A movie of this room.','m_size':14256585,'m_data':'AAAKKW1vb3YAA...','m_name':'nice.mov'}
Note:
RoomFinder supports getRoomMeta() 'directly' via HTTP GET as of version 0.5.3.0. So the
alternate approach to send attached files to the user is to provide a direct link to this
server. Encoding and decoding large files (which leads to problems in some environments) is
not neccessary this way. The example file above could also be obtained by using the link
'http://this.servers.url/getRoomMeta?meta_id=42'. See getRoomMetas() for finding out the
meta_ids of a room to setup your links.
- getRoomMetas(r_id, m_type='')
- Returns a list of metafiles associated with the room 'r_id'. The argument 'm_type' limits
the list to a certain mime-type, for example 'image' or 'video/quicktime'.
Usage:
getRoomMetas(string r_id)
=>
[{'meta_id': int meta_id, 'm_size': int size, 'm_type': string mime-type, 'm_desc': string description, 'm_name': string filename},...]
Example 1:
getRoomMetas('0815@4711')
=>
[{'meta_id': 38, 'm_size': 150, 'm_type': 'text/plain', 'm_desc': 'Detailed room description.', 'm_name': 'desc.txt'},
{'meta_id': 43, 'm_size': 554337, 'm_type': 'video/quicktime', 'm_desc': 'A 3D-pano inside this room.', 'm_name': 'room.mov'},
{'meta_id': 44, 'm_size': 6877, 'm_type': 'image/jpeg', 'm_desc': 'View out of a window of this room.', 'm_name': 'picture.jpg'},
{'meta_id': 45, 'm_size': 5214, 'm_type': 'image/dxf', 'm_desc': 'Floorplan as DXF', 'm_name': '0815.dxf'}]
Example 2:
getRoomMetas('0815@4711','image')
=>
[{'meta_id': 44, 'm_size': 6877, 'm_type': 'image/jpeg', 'm_desc': 'View out of a window of this room.'},
{'meta_id': 45, 'm_size': 5214, 'm_type': 'image/dxf', 'm_desc': 'Floorplan as DXF'}]
Example 3:
getRoomMetas('0815@4711','image/jpeg')
=>
[{'meta_id': 44, 'm_size': 6877, 'm_type': 'image/jpeg', 'm_desc': 'View out of a window of this room.'}]
- getRoomPlacemark(r_id, options={})
- Returns a Google Earth Placemark of the Room. It´s a zipped '*.kmz' file containing
the Keyhole Markup Language XML used by Google Earth.
Options may be 'map', 'elevate' and 'transparency'. If option 'map' has a valid map id, an Google
Earth map overlay will be generated in addition to the room placemark. Option 'transparency' may
be a value between 0 (not visible) and 1 (complete opaque) and controls the map overlays
tranparency. If omitted, the default for a map overlay is '0.87' which is somewhat transparent.
The elevation of a room may be displayed with the option keyword 'elevate' set to any other
value than '0'. In this case, the room point will be raised above the ground depending on the rooms
floor. For example, a room in floor 3 will be raised 3*3m (9m) above the ground. The 3 Meters
are aproximately because RoomFinder regulary has no z-coordinates available. Thus calling this
method wil generate some sort of inaccurate display.
Usage:
getRoomPlacemark(string room_id, struct options) => [base64 filedata, string mime-type, string filename]
Example 1, get a simple room placemark for Goolge Earth:
getRoomPlacemark('1601@0506') => ['R0lGODlhl...','application/vnd.google-earth.kmz','RoomFinder.kmz']
Example 2, get an elevated room placemark for Goolge Earth, combined with a map overlay of the building:
getRoomPlacemark('1601@0506',{'map':'81','transparency':'0.8','elevate':'1'}) => ['R0lGODlhl...','application/vnd.google-earth.kmz','RoomFinder.kmz']
Note:
See http://earth.google.com/ for more information and the Google Earth Client. Google Earth´s mapping
accuracy is not as high as you may expect. This server tries to compensate a little bit by using
a correction offset.
- getUtmMaps(zone, easting, northing)
- Get a list of maps within the given utm coordinate is located, ordered by mapscale. Works like
getGeoMaps() but uses utm coordinates.
Usage:
getUtmMaps(string zone, double/int easting, double/int northing)
=>
[[string scaling, int map_id, string description, int width, int height],...]
Example:
getUtmMaps('32',691008.7,5336096) => [['4700' , 10, 'Lageplan TUM', 657, 951],
['5300' , 12, 'Stammgelände Basiskarte', 501, 484],
['100000000', 9, 'Weltkarte Norden', 1619, 396]]
- searchRoom(searchstring, info={})
- Search a room by number, alias and/or room information. Returns an array with structs for every result.
If info (which must be a struct) is provided, the search will be refined to only those rooms
which have the appropriate room information. Fixed and special info keys are "r_level" and
"r_bulding", the level and building of the room. These keys are always available for a room by
default. Other info keys may or may not exist and can be set with setRoomInfo(). You can search
for rooms having a certain info key (see setRoomInfo()), regardless of the corresponding value by
using a null string as value (see Example 4).
Usage:
searchRoom(string searchstring, struct info) => [{struct result1},{struct result2},...{struct result_n})
Example 1, simple search:
searchRoom('124')
=>
[{'b_name': 'Institutsbau', 'b_area': 'Zentralgelände', 'b_alias': '', 'b_id':'0501', 'r_level': '4',
'r_number': '4124A', 'r_alias': 'SEMINARRAUM', 'r_id': '4124A@0501'},
{'b_name': 'N1', 'b_area': 'Nordgelände', 'b_alias': 'U-Trakt', 'b_id':'0101', 'r_level': '1',
'r_number': '1124', 'r_alias': 'Seminarraum', 'r_id': '1124@0101'}]
Example 2, advanced search using a special info key to search only in building with id "0501":
searchRoom('124', {'r_building':'0501'})
=>
[{'b_name': 'Institutsbau', 'b_area': 'Zentralgelände', 'b_alias': '', 'b_id':'0501', 'r_level': '4',
'r_number': '4124A', 'r_alias': 'SEMINARRAUM', 'r_id': '4124A@0501'}]
Example 3, advanced search using arbitrary info keys:
searchRoom('', {'Beamer':'1','Waschbecken':'2','Leinwand':'1'})
=>
[{'b_name': 'Institutsbau', 'b_area': 'Zentralgelände', 'b_alias': '', 'b_id':'0501', 'r_level': '4',
'r_number': '4124A', 'r_alias': 'SEMINARRAUM', 'r_id': '4124A@0501'}]
Example 4, advanced search using arbitrary info keys. All rooms which have 'Beamer' and 'WLAN' as
a key will be returned. The value of those keys does not matter due to using a null string as value:
searchRoom('', {'Beamer':'','WLAN':''})
=>
[{'b_name': 'Institutsbau', 'b_area': 'Zentralgelände', 'b_alias': '', 'b_id':'0501', 'r_level': '4',
'r_number': '4124A', 'r_alias': 'SEMINARRAUM', 'r_id': '4124A@0501'}]
Note:
To get a distinct result for exactly one certain room use getRoomData() instead.
- setRoomInfo(r_id, a_name, a_value)
- Sets or updates room information. If a_name exists, the value will be overwritten. Returns
true if successful, false if not. Room information can be queried with getRoomInfo() and
deleted with delRoomInfo(). See searchRoom() for methods to find rooms depending on their
info name and/or value.
Usage:
setRoomInfo(string r_id, string a_name, string a_value) => boolean
Example:
setRoomInfo('4124A@0501','Fassungsvermögen','86')
Note:
You must be authenticated to use this method.
- setRoomMeta(r_id, m_data, f_name, m_desc='', m_type='')
- Creates a new meta file for the room 'r_id'. Returns True if successful, False if not. 'r_id'
must be a valid room id.
Either 'm_type' of 'f_name' has to be used. 'm_type' is the mime-type which will be stored
without validation. If you do not know your mimetype (because the file was uploaded for example),
you can set 'f_name' to the original name of the file. RoomFinder will guess the appropriate
mime-type by means of the file extension.
Usage:
setRoomMeta(string r_id, base64 filedata, string description, string mime-type, string filename) => boolean
Example 1:
setRoomMeta('0815@4711','AAAKKW1vb3YAA...','A movie about this room.','video/quicktime','') => 42
Example 2:
setRoomMeta('0815@4711','AAAKKW1vb3YAA...','Some uploaded picture.','','greatimage.jpg') => 42
Note:
You must be authenticated to use this method.
- system.listMethods()
- system.listMethods() => ['add', 'subtract', 'multiple']
Returns a list of the methods supported by the server.
- system.methodHelp(method_name)
- system.methodHelp('add') => "Adds two integers together"
Returns a string containing documentation for the specified method.
- system.methodSignature(method_name)
- system.methodSignature('add') => [double, int, int]
Returns a list describing the signature of the method. In the
above example, the add method takes two integers as arguments
and returns a double result.
This server does NOT support system.methodSignature.
- utm2deg(zone, easting, northing)
- Convert UTM coordinates to GPS using WGS84. Reverse of deg2utm().
Usage:
utm2deg(string/int zone, int/double easting, int/double northing) => [double longitude, double latitude]
Example:
utm2deg("32U",695196,5334947) => [11.623819150446307, 48.137808711331623]
Note:
You may use degFloat2DegMinSec() to convert this result into
a Degrees Minute Seconds representation of the coordinate. See
degFloat2DegMinSec()
|