In previous sections, we have seen how to fetch Buildings, Floors, POIs and Geofences from Situm Platform using Situm SDK. Instead of having to fetch each resource separatelly, Situm SDK also allows you to retrieve all this information with a single network call. 


The following code snippet shows how to retrieve all the information of building 8377 ( which we know from a previous example) and output its information on the application Log.  



//Fetches all the information (basic building info, floors, POIs, genfences) from building 8377
Building building = new Building.Builder().identifier("8377").build();
SitumSdk.communicationManager().fetchBuildingInfo(building.getIdentifier(), new Handler<BuildingInfo>() {

    //The onSuccess method receives the BuildingInfo data object ...
    @Override
    public void onSuccess(BuildingInfo buildingInfo) {

        //... which contains all the relevant cartography entities associated with the building
        Building buildingBasicInfo = buildingInfo.getBuilding();
        Collection<Floor> floors = buildingInfo.getFloors();
        Collection<Poi> indoorPOIs = buildingInfo.getIndoorPOIs();
        Collection<Poi> outdoorPOIs = buildingInfo.getOutdoorPOIs();
        Collection<Geofence> geofences = buildingInfo.getGeofences();

        Log.i(TAG, "BuildingBasicInfo = [" + buildingBasicInfo + "]");
        Log.i(TAG, "Floors = [" + floors + "]");
        Log.i(TAG, "IndoorPOIs = [" + indoorPOIs + "]");
        Log.i(TAG, "OutdoorPOIs = [" + outdoorPOIs + "]");
        Log.i(TAG, "Geofences = [" + geofences + "]");
    }
    
    @Override
    public void onFailure(Error error) {
Log.e(TAG, "Error " + error);
    }
});


In the previous code snippet, we are receiving a BuildingInfo data object, which contains:

  1. A Building data object with the basic building information. See this example to know how to treat this information.
  2. A Collection of Floor objects with the floor's information. See this example to know how to treat this information. 
  3. A Collection of POI objects with the indoor POI's information. See this example to know how to treat this information. 
  4. A Collection of POI objects with the outdoor POI's information. See this example to know how to treat this information. 
  5. A Collection of Geofence objects with the geofences information. See this example to know how to treat this information. 


BuildingBasicInfo = [Building{userIdentifier='-1', name='Situm HQ', address='Rúa do Restollal, nº 32 Edificio Paxonal, Planta 4, Of. 401 15702, Santiago de Compostela, A Coruña, Spain', infoHtml='<p><strong>Welcome to Situm!</strong></p><p><br></p>', center=Coordinate{latitude=42.872352, longitude=-8.563249}, rotation=Angle{radians=2.95, degrees=169.23}, dimensions=Dimensions{width=73.273936306327, height=43.9411738292689}, pictureUrl=URL{value='/uploads/building/8377/6d8423b9-61b5-4015-a0aa-0faf3c9c66cc.png', isAbsolute=false}, pictureThumbUrl=URL{value='/uploads/building/8377/6d8423b9-61b5-4015-a0aa-0faf3c9c66cc.png', isAbsolute=false}} Resource{identifier='8377', updatedAt=1617296565984, createdAt=1617268218730, customFields={external_cms_id=102301, show_in_app=true}}]


Floors = [[Floor{buildingIdentifier='8377', name='F0', floor=0, scale=17.25033570894508, altitude=0.0, mapUrl=URL{value='https://dashboard.situm.es/uploads/floor/20541/51b985cf-4c2b-4327-bbab-a53b9c50b916.png', isAbsolute=true}}, Floor{buildingIdentifier='8377', name='F1', floor=1, scale=17.25033570894508, altitude=15.0, mapUrl=URL{value='https://dashboard.situm.es/uploads/floor/20542/aa275ada-5ca2-4d51-be61-71fec14f29be.png', isAbsolute=true}}]]


IndoorPOIs = [[Poi{name='Shop', infoHtml='<p><b>Welcome to the shop!</b></p>', category=PoiCategory{code='MC', name=I18nString{values={spa=Mi categoría, eng=My Category}}, unselectedIconUrl=URL{value='/uploads/poicategory/1206/a04cf2b3-5c09-40d1-8dca-3f3d9ae3adde.png', isAbsolute=false}, selectedIconUrl=URL{value='/uploads/poicategoryselected/1206/b7bac260-f68d-4554-9054-d8a9be992618.png', isAbsolute=false}, isPublic=false} Resource{identifier='1206', updatedAt=0, createdAt=0, customFields={}}, position=Point{buildingIdentifier='8377', floorIdentifier='20541', cartesianCoordinate=CartesianCoordinate{x=71.66, y=1.71}, coordinate=Coordinate{latitude=42.872473, longitude=-8.563716}, isOutdoor=false}} Resource{identifier='64478', updatedAt=0, createdAt=0, customFields={show_in_app=true}}, Poi{name='Entrance', infoHtml='<p>Entrance</p>', category=PoiCategory{code='situm-default', name=I18nString{values={spa=Sin categoría, eng=No category}}, unselectedIconUrl=URL{value='/uploads/poicategory/148/8ac8e04f-a6a0-4da5-a08d-02ec33ffdcfb.png', isAbsolute=false}, selectedIconUrl=URL{value='/uploads/poicategoryselected/148/4c85ebd0-6ff2-4c1d-bad5-1f9f9eedc847.png', isAbsolute=false}, isPublic=true} Resource{identifier='148', updatedAt=0, createdAt=0, customFields={}}, position=Point{buildingIdentifier='8377', floorIdentifier='20541', cartesianCoordinate=CartesianCoordinate{x=2.69, y=22.18}, coordinate=Coordinate{latitude=42.872408, longitude=-8.562840}, isOutdoor=false}} Resource{identifier='64479', updatedAt=0, createdAt=0, customFields={}}]]


OutdoorPOIs = [[Poi{name='OutdoorPOI', infoHtml='', category=PoiCategory{code='situm-default', name=I18nString{values={spa=Sin categoría, eng=No category}}, unselectedIconUrl=URL{value='/uploads/poicategory/148/8ac8e04f-a6a0-4da5-a08d-02ec33ffdcfb.png', isAbsolute=false}, selectedIconUrl=URL{value='/uploads/poicategoryselected/148/4c85ebd0-6ff2-4c1d-bad5-1f9f9eedc847.png', isAbsolute=false}, isPublic=true} Resource{identifier='148', updatedAt=0, createdAt=0, customFields={}}, position=Point{buildingIdentifier='8377', floorIdentifier='-1', cartesianCoordinate=CartesianCoordinate{x=0.00, y=0.00}, coordinate=Coordinate{latitude=42.872474, longitude=-8.562138}, isOutdoor=true}} Resource{identifier='64480', updatedAt=0, createdAt=0, customFields={}}]]


Geofences = [[Geofence{name='Entrance', code='G0', infoHtml='<p><strong>Welcome!</strong></p>', floorIdentifier='20541', buildingIdentifier='8377', polygonPoints=[Point{buildingIdentifier='8377', floorIdentifier='20541', cartesianCoordinate=CartesianCoordinate{x=0.52, y=14.85}, coordinate=Coordinate{latitude=42.872476, longitude=-8.562831}, isOutdoor=false}, Point{buildingIdentifier='8377', floorIdentifier='20541', cartesianCoordinate=CartesianCoordinate{x=9.07, y=14.88}, coordinate=Coordinate{latitude=42.872462, longitude=-8.562934}, isOutdoor=false}, Point{buildingIdentifier='8377', floorIdentifier='20541', cartesianCoordinate=CartesianCoordinate{x=4.74, y=28.29}, coordinate=Coordinate{latitude=42.872350, longitude=-8.562851}, isOutdoor=false}, Point{buildingIdentifier='8377', floorIdentifier='20541', cartesianCoordinate=CartesianCoordinate{x=0.52, y=14.85}, coordinate=Coordinate{latitude=42.872476, longitude=-8.562831}, isOutdoor=false}]}]]