Homepage

ServiceMap API: Service Search

RETURN to main page of SERVICEMAP API

GET: Sii-Mobility Km4City: Smart City API, version 1 smart city API

 

--- the rest has been deprecated ---

http://servicemap.disit.org/WebAppGrafo/api/v1?selection =sel&categories=[listOfCategories]&maxResults=nResults&maxDists=dists[&text=...txt...][&lang=it|en]&format=[json|html]

This API provides results about a selection of categories of services chosen in a municipality or from a starting point (giving geolat position). It is possible to choose the number of results required, the radius of search, if the selection is a couple of latitude and longitude, and the format result.
This case could be useful, as json results could be parsed in order to obtain single Service Uris to reuse as in case 1, calling the API servicemap.disit.org/api?serviceUri=[serviceUri]. Real time pins could be actualized simply calling this uri, and showing them on the map taking the geo-located coordinates.

In this scenario, user can save a bunch of pins, making a query on the Service Map.
This case could be useful, as json results could be parsed in order to obtain single Service Uris to reuse as in case 1, calling the API http://servicemap.disit.org/WebAppGrafo/api/v1?serviceUri=[serviceUri]. Real time pins could be actualized simply calling this uri, and showing them on the map taking the geo-located coordinates
  • selection: the start point of the query:
  • Could be a Lat;Long coordinates (43.77078623698416; 11.256734415727848),
  • Municipality (COMUNE di FIRENZE)
  • a serviceUri (http://www.disit.org/km4city/resource/4573d318065f48a2214066f7b32d94c4)
  • categories: the list of categories of services that user is interested in, they can be categories or subcategories separated with ';'. If a category is specified all the subcategories are automatically considered, the Service top category matches all services. Some of the possible categories and subcategories are (for a complete list see http://servicemap.disit.org):
    • Service
      • Accommodation
        • boarding_house; agritourism;hotel; bed_and_breakfast; camping; rest_home; 
        • religiuos_guest_house; summer_residence; day_care_center; hostel; vacation_resort;
        • farm_house; historic_residence; mountain_dew; beach_resort; holiday_village;
      • WineAndFood;
        • highway_stop; pastry_shop;  small_shop; catering; wine_shop_and_wine_bar;
        • bakery; ice_cream_parlour; dining_hall; sandwich_shop_pub; pizzeria;
        • restaurant; grill; sushi_bar;trattoria
      • ...
    • Sensor
    • BusStop
  • maxResults: in the range of 100, 200, 500, or 0 for no limits. At most three values separated with ';' can be specified for the number of results: one for the service results, one for sensors and one for bus stops. If one value is missing it is assumed equal to the previous, so if one value is specified all the three values are considered equal, if  the default value is set to 100.
  • maxDists: is active when the selection is a point on the map or a service. Indicates the maximum distance in km from the point (or service) specified as selection. Like for the number of results, at most three parameters can to be specified, one for services, one for sensors and one for bus stops. If one is missing it is assumed equal to the previous one, so if one is specified all the three values are considered equal. If omitted it is assumed equal to 0.1km. This parameter is ignored for searches in a municipality (COMUNE di..).
  • text: (optional) is a sequence of keywords separated by spaces to be present in any field of the service.
  • lang: (optional) it can be 'it' or 'en' (the default is en) the language to be used to return the typeLabel attribute

In the example below, services in the category of Accommodation and Bus Stops have been searched around a point, giving the coordinates Latitude and Longitude, within 200m for services and 100m for bus stops.
In the example below, services in the category of Accommodation and Bus Stops have been searched around a point, in correspondence of Museo di Palazzo Vecchio in Florence.

The link of this search is:
http://servicemap.disit.org/WebAppGrafo/api/v1?selection=43.769346%3B11.25524
&categories=Accommodation%3BBusStops&maxResults=100
&maxDists=0.2%3B0.1%3B0.1&lang=it&format=json


JSON Results are:
{  
  "BusStops":{  
    "type":"FeatureCollection",
    "features":[  
      {  
        "geometry":{  
          "type":"Point",
          "coordinates":[ 11.2555, 43.7702 ]
        },
        "type":"Feature",
        "properties":{  
          "name":"CONDOTTA",
          "typeLabel":"Fermata",
          "serviceType":"TransferServiceAndRenting_BusStop",
          "serviceUri":"http://www.disit.org/km4city/resource/FM5132"
        },
        "id":1
      }
    ]
  },
  "Services":{  
    "type":"FeatureCollection",
    "features":[  
      {  
        "geometry":{  
          "type":"Point",
          "coordinates":[ 11.2552, 43.7694 ]
        },
        "type":"Feature",
        "properties":{  
          "name":"SOGGIORNO_ANTICA_TORRE",
          "typeLabel":"Affittacamere",
          "serviceType":"Accommodation_boarding_house",
          "serviceUri":"http://www.disit.org/km4city/resource/2a97797accf3ed11b7a2eefb635b666c",
        },
        "id":1
      },
      {  
        "geometry":{  
          "type":"Point",
          "coordinates":[ 11.2552, 43.7694 ]
        },
        "type":"Feature",
        "properties":{  
          "name":"SOGGIORNO_ANTICA_TORRE",
          "typeLabel":"Affittacamere",
          "serviceType":"Accommodation_boarding_house",
          "serviceUri":"http://www.disit.org/km4city/resource/36780267be3f4ac30027489d347f2fc5",
        },
        "id":2
      }
      ....
    ]
  }
}
(These results have been truncated.)

 
If HTML format is chosen, the result is as in figure 4.
 
Figure 4: results of query of Services Accommodation and Bus Stops around Museo di Palazzo Vecchio.
 
If the starting point is a municipality, the link is a little bit different, as for example:
http://servicemap.disit.org/WebAppGrafo/api?selection=COMUNE%20di%20FIRENZE
&categories=Accommodation%3BWineAndFood&
maxResults=100&format=json

 
In this example, the search in made in the municipality of Florence, so that radius parameter is not needed.
Json and html results are in the same format, as seen before.

In figure 5 HTML results of this request are shown.

Figure 5: Accommodation and wine and food results in Florence

If an user chooses a Service as a starting point, the link is:

http://servicemap.disit.org/WebAppGrafo/api/v1?selection=http://www.disit.org/km4city/resource/2e77b45fffee032f93369b4864912192
&categories=Accommodation%3BWineAndFood%3B&maxResults=100&maxDists=0.5
&format=json

 
It provides the results corresponding to categories Accomodation and WindAndFood, in the radius of 500m close to the service http://www.disit.org/km4city/resource/2e77b45fffee032f93369b4864912192 (Chiesa di Santa Maria Novella)

The results can be filtered also using text keywords (e.g. casa), as in:

http://servicemap.disit.org/WebAppGrafo/api/v1?selection=COMUNE%20di%20FIRENZE
&categories=Accommodation%3BWineAndFood&maxResults=50&format=json&text=casa


It provides the list of Accommodation and WineAndFood services in the municipality of Florence matching the keyword 'casa' (at most 50 results are provided)
0
Il tuo voto: Nessuno


Warning: Table '.\drupal\sessions' is marked as crashed and should be repaired query: UPDATE sessions SET uid = 0, cache = 0, hostname = '192.168.0.44', session = 'hidePDA|s:1:\"0\";', timestamp = 1711669638 WHERE sid = '35d2921f14a695b56dc6f6547ff5463a' in C:\Programmi\Apache Software Foundation\Apache2.2\htdocs\drupal\includes\database.mysqli.inc on line 128