Mapdex Webservice Guide
The Webservice allows you to search the Mapdex database for
webservice url: http://www.mapdex.org/search/MapdexToolbar/mapdexsearch.cfm
Search parameters
| Name | Description |
| servers | A string containing one or more keywords for server search optionally seperated by boolean operators 'and' or 'or'. For example, 'kgs and drysdale' |
| service | A string containing one or more keywords for service search optionally seperated by boolean operators 'and' or 'or'. For example, 'water or aquifers' |
| layer | A string containing one or more keywords for layer search optionally seperated by boolean operators 'and' or 'or'. For example: 'acre and plss' |
| column | A string containing one or more keywords for column search optionally seperated by boolean operators 'and' or 'or'. In this case, the webservice will return the number of columns in each layer that matched the given keywords instead of returning the matched column names. Also, column search takes more time than other queries. For example, 'roads' |
| envelope | A latitude-longitude envelope in the format 'minx:maxx:miny:maxy'. For example, '-95.334059:-95.176821:38.913468:39.033364'. If you have a lat-long point instead of the envelope, make maxx = minx and maxy = miny or just leave 'maxx' and 'maxy' values blank. Envelope queries have to and can only be accompanied with layer keywords(provided through the 'layer' parameter). |
| operator | For combinational queries where you search for a combination of servers, services, layers and/or columns, specify how to combine the results. Expected values are 'and', 'or'. OPTIONAL. Default: and |
| sort | Specifies the record field based on which the results will be sorted(sorting is case-sensitive). Possible values are 'svr'(sort on server names), 'svc'(sort on service names), 'lyr'(sort on layer names) and 'prj'(sort on the type of projection set). OPTIONAL |
| order | The Order of sort. Possible values are 'ASC'(ascending order), 'DESC'(descending order). OPTIONAL. Default: ASC |
| alpha | An alphanumeric character(a,b,c...z or 0,1,2...9). To get only those records in the search results for which the searched criteria starts with the given alphanumeric character. That is, the character will be matched against server names(for server queries and combinational queries), service names(for service queries) and layer names(for layer, column and envelope queries). OPTIONAL |
| start | Index of the first desired result. OPTIONAL. Default: 1 |
| numresults | Number of results desired per query. OPTIONAL. Default: 20 |
| needurl | Specifies whether or not you need the server info and service info urls in the response. Give '1' if you want the urls or '0' if you don't. OPTIONAL. Default: 0 |
Example
servers=usgs or noaa
service=
layer=road or street
column=address or label or name
operator=and
translates to...
search all layers with,
(server name containing usgs or noaa) and
(layer name containing road or street) and
(column name containing address or label or name)
Limitations
The response for the queries is in XML format. The name of the root node in the XML data is 'mapdex'. The result node is 'response' and the error node is 'error'.
Response for a successful query:
<?xml version="1.0" encoding="UTF-8"?> <mapdex servers="" service="" layer="" column="" envelope="" operator="" type="" srt="" odr="" alpha=""> <header requested="" returned="" from="" to="" total="" hasmore=""/> <response attr1="val1" attr2="val2"... /> ... ... <response attr1="val1" attr2="val2"... /> </mapdex>
Response for a failed query:
<?xml version="1.0" encoding="UTF-8"?> <mapdex> <error> <type>...</type> <message>...</message> <detail>...</detail> <database> <sql>...</sql> <query>...</query> </database> </error> </mapdex>
<mapdex> attributes
The <mapdex> element restates the search query.
<header> attributes
<response> attributes
Each <response> node corresponds to a record in the database that matched the query.
Simple method
A url is called with the required parameters submitted through either GET or POST. The base url is:
http://www.mapdex.org/search/MapdexToolbar/mapdexsearch.cfm
Sample query string to be used for GET method is:
?servers=usgs+or+noaa&service=&layer=road+or+street&column=address+or+label+or+name&operator=and
Notice that 'usgs or noaa' is represented as usgs+or+noaa i.e '+' is substitued for space.
The querystring is appended to the base url to obtain the complete url for query.
| Request | Response |
| http://www.mapdex.org/search/MapdexToolbar/mapdexsearch.cfm?servers=drysdale | xml |
| http://www.mapdex.org/search/MapdexToolbar/mapdexsearch.cfm?service=geology&layer=plss | xml |
| http://www.mapdex.org/search/MapdexToolbar/mapdexsearch.cfm?layer=water&start=10 | xml |
| http://www.mapdex.org/search/MapdexToolbar/mapdexsearch.cfm?layer=aquifers&numresults=35 | xml |
| http://www.mapdex.org/search/MapdexToolbar/mapdexsearch.cfm?layer=aquifers&service=water&operator=OR | xml |
| http://www.mapdex.org/search/MapdexToolbar/mapdexsearch.cfm?envelope=-95.334059:-95.176821:38.913468:39.033364&layer=photo+OR+aerial | xml |
| http://www.mapdex.org/search/MapdexToolbar/mapdexsearch.cfm?layer=infrared&numresults=40&sort=svr | xml |
| http://www.mapdex.org/search/MapdexToolbar/mapdexsearch.cfm?layer=infrared&numresults=40&sort=svc | xml |
| http://www.mapdex.org/search/MapdexToolbar/mapdexsearch.cfm?layer=infrared&numresults=40&sort=lyr | xml |
| http://www.mapdex.org/search/MapdexToolbar/mapdexsearch.cfm?layer=infrared&numresults=40&sort=prj | xml |
| http://www.mapdex.org/search/MapdexToolbar/mapdexsearch.cfm?service=plss&layer=plss&servers=kgs.ku.edu | xml |
| http://www.mapdex.org/search/MapdexToolbar/mapdexsearch.cfm?service=plss&layer=plss&servers=kgs.ku.edu&needurl=1 | xml |
| http://www.mapdex.org/search/MapdexToolbar/mapdexsearch.cfm?service=plss&layer=plss&servers=kgs.ku.edu&sort=lyr&order=desc | xml |
| http://www.mapdex.org/search/MapdexToolbar/mapdexsearch.cfm?layer=water&alpha=j | xml |
| http://www.mapdex.org/search/MapdexToolbar/mapdexsearch.cfm?column=weight&sort=svr | xml |
| http://www.mapdex.org/search/MapdexToolbar/mapdexsearch.cfm | xml |
| http://www.mapdex.org/search/MapdexToolbar/mapdexsearch.cfm?servers=wioretio | xml |
| http://www.mapdex.org/search/MapdexToolbar/mapdexsearch.cfm?envelope=-95.334059:-95.176821:38.913468:39.033364&servers=drysdale | xml |