3  Mapfluence REST Paths

As described in Mapfluence REST Overview, all of the information needed for Mapfluence to respond to a client request is built into the path used to make that request, which means that understanding how to build the path is key to getting the server to respond with the kind of map or data you want. These paths are covered in the following sections:




3.1  About Mapfluence Pathsgo:  top

The paths that are passed to the Mapfluence server generally appear in one of two contexts:

The following examples show these two different forms of the same path, which requests a list of the datasets in the Mapfluence Data Catalog:

http://query.mapfluence.com/2.0/<apiKey>/catalog/datasets

?# Request
GET /2.0/<apiKey>/catalog/datasets HTTP/1.1
Host: query.mapfluence.com
Accept: application/json

As shown above, Mapfluence REST paths include the following parts:

While these basic path components (except version) are present in all Mapfluence REST requests, the structure of the complete path varies depending whether the request is for mapping or text data.

Note: For brevity, example paths in the remainder of this document will be expressed in the HTML link form described above. These paths may be used in the address field of a browser to see the returned map or data.




3.2  Mapping Pathsgo:  top

The following example illustrates the path structure used for a mapping request to the Mapfluence visual API, in this case for a map with a base layer and one simple layer overlay showing school district boundaries:

http://query.mapfluence.com/2.0/MFDOCS/map/from=umi.us_schl_dists.unified_geometry|mode=simple|border=black_1|colors=clear/b/?lat=37.6&lng=-122.2&width=640&height=480&zoom=10

In this mapping example, the path is composed of the following parts:




3.3  Spatial Query Pathsgo:  top

The following example illustrates the path structure used for a non-mapping request, in this case a spatial query that asks for a feature named "Alaska" from the data catalog's geometry table of U.S. states (from the U.S. Census dataset):

http://query.mapfluence.com/2.0/MFDOCS/spatialquery.json?from=umi.us_census00.state_geometry&select=name&where=name:'Alaska'&date=2010-08-01T07:00:00Z

In this query example, the path is composed of the following parts:

In spatial queries (/spatialquery, /estimate, /spatialops, and /geocoder) many different parameters may be specified using the query string (for specifics, refer to the REST reference for each type of spatial query).

Note: Query strings are case sensitive.




3.4  Data Catalog Pathsgo:  top

The path structure described in Spatial Query Paths is used not only for spatial queries but also for data catalog queries (/catalog), such as the following request for a list of datasets in the Mapfluence data catalog:

http://query.mapfluence.com/2.0/MFDOCS/catalog/datasets

In data catalog queries the query string is optional. The only currently supported query string parameter is start, which is used to specify the index of the first item when a query returns a list. In a catalog/datasets query, for example, if start=50 then the first dataset in the returned list will be the dataset at index 50 in the collection of datasets.

http://query.mapfluence.com/2.0/MFDOCS/catalog/datasets/?start=50

Top