public List <ObjectData> FilterToDistance(List <ObjectData> list, List <POICoordinatesObject> poilist) { Debug.Log("Size of POILIST:" + poilist.Count); List <ObjectData> filterdList = new List <ObjectData>(); double lat; double lon; double dis; foreach (var VARIABLE in list) { lat = MetadataUtils.GetLatitude(VARIABLE.Metadata); lon = MetadataUtils.GetLongitude(VARIABLE.Metadata); foreach (var poi in poilist) { dis = MapMenuView.calculateRadius(lat, lon, poi.getCoordinates().getLat(), poi.getCoordinates().getLon()) * 1000; if ((dis) <= distance_value) { filterdList.Add(VARIABLE); Debug.Log("ADDED Distance to Picture: " + dis + " " + lat + " " + lon + " MY LOC: " + currentlat + " " + currentlon + " " + distance_value); } } } return(filterdList); }
private List <LocationObject> Convert(List <ObjectData> input) { if (input == null) { logger.Warn("Convert - Cannot convert a null-list"); return(null); } List <LocationObject> output = new List <LocationObject>(); logger.Debug("Convert - Input: " + input != null ? "" + input.Count : "NULL"); int count = 0; foreach (ObjectData mmo in input) { if (mmo == null) { logger.Debug("Convert - Skipping a null-mmo"); } else { var lat = MetadataUtils.GetLatitude(mmo.Metadata); var lon = MetadataUtils.GetLongitude(mmo.Metadata); output.Add(new LocationObject(mmo.Id, lat, lon)); count++; } } logger.Debug("Convert - Converted " + count + " mmos to locobjs"); return(output); }
private void Display3D(ObjectData mmo) { logger.Debug("Displaying AR style! " + mmo.Id); var scrn = Instantiate(ScreenPrefab); var mmoContainer = scrn.AddComponent <MMOContainer>(); var textured = scrn.GetComponentInChildren <WebTextured>(); if (textured == null) { textured = scrn.AddComponent <WebTextured>(); } textured.url = TemporaryCompatUtils.GetImageUrl(mmo); // Too high res? //textured.url = CineastUtils.GetThumbnailUrl(mmo); textured.LoadImageFromWeb(); mmoContainer.MultimediaObject = mmo; var geoposed = scrn.AddComponent <GeoPositioned>(); var lat = MetadataUtils.GetLatitude(mmo.Metadata); var lon = MetadataUtils.GetLongitude(mmo.Metadata); var bearing = MetadataUtils.GetBearing(mmo.Metadata); geoposed.GeoCoordinates = new GeoArithmetic.GeoCoordinates(lat, lon); geoposed.Bearing = (float)bearing; arMapper.AddGeoPositioned(geoposed); ActiveScreens.Add(scrn); }
private void AddObjectToScroll(ObjectData mmo) { Debug.Log(":AddObjectToScroll " + (mmo != null ? JsonUtility.ToJson(mmo) : "null")); GameObject panel = Instantiate(prefab); Debug.Log("panel: " + (panel == null ? "null" : "found")); panel.transform.SetParent(scrollContent, false); var ctrl = panel.GetComponent <DisplayController>(); Debug.Log("ctrl " + (ctrl == null ? "Null" : "received")); ctrl.SetTitle(string.Format("Result: {0}", mmo.Id)); Debug.Log("initalGeoLoc: " + (initialGeoLocation == null ? "null" : "present")); var lat = MetadataUtils.GetLatitude(mmo.Metadata); var lon = MetadataUtils.GetLongitude(mmo.Metadata); double dist = Utilities.HaversineDistance(lat, lon, initialGeoLocation.latitude, initialGeoLocation.longitude); string footerText = string.Format("Distance: {0}m\nDate: {1}", Round(dist), FormatDate(mmo)); ctrl.SetFooter(footerText); ctrl.LoadImageFromWeb(TemporaryCompatUtils.GetThumbnailUrl(mmo)); ctrl.Mmo = mmo; ctrl.UiManager = this; ctrl.Controller = controller; }
private void DisplayInfo(ObjectData mmo) { var lat = MetadataUtils.GetLatitude(mmo.Metadata); var lon = MetadataUtils.GetLongitude(mmo.Metadata); string dist = uiManager.GetRoundedDist(new GeoLocation(lat, lon), controller.GetLastKnownLocation()); infoLabel.text = string.Format("Dist: {0}m\nDate: {1}", dist, UIManager.FormatDate(mmo)); }
private string[] CreateMarkers() { List <string> markers = new List <string>(); foreach (ObjectData mmo in mmoList) { var lat = MetadataUtils.GetLatitude(mmo.Metadata); var lon = MetadataUtils.GetLongitude(mmo.Metadata); markers.Add(string.Format("color:red%7Clabel:R%7C{0},{1}", lat, lon)); } return(markers.ToArray()); }
public List <ObjectData> GetInRange(ObjectData mmo, double dist = 75 /*m*/) { List <ObjectData> ret = new List <ObjectData>(); var lat = MetadataUtils.GetLatitude(mmo.Metadata); var lon = MetadataUtils.GetLongitude(mmo.Metadata); if (!double.IsNaN(lat)) { foreach (ObjectData mo in activeMmos) { var _lat = MetadataUtils.GetLatitude(mo.Metadata); var _lon = MetadataUtils.GetLongitude(mo.Metadata); double d = Utilities.HaversineDistance(lat, lon, _lat, _lon); if (d <= dist) { ret.Add(mo); } } } return(ret); }
public void parseToPictureData(List <ObjectData> list, List <POICoordinatesObject> poilist) { List <ObjectData> newList = list; if (poilist.Count != 0) { newList = FilterToDistance(list, poilist); } pictureDataList = new List <PictureData>(); int id = 0; string url; string time; double lat = 0; double lon = 0; float hea; foreach (var VARIABLE in newList) { url = CineastWrapper.GetMediaUrlOf(VARIABLE); time = MetadataUtils.GetDateTime(VARIABLE.Metadata); lat = MetadataUtils.GetLatitude(VARIABLE.Metadata); lon = MetadataUtils.GetLongitude(VARIABLE.Metadata); hea = Convert.ToSingle(MetadataUtils.GetBearing(VARIABLE.Metadata)); hea = 0; Debug.Log("GET URLS " + url); Debug.Log("THESE ARE TIME: " + time); if (url == "http://10.34.58.145/objects/Ans_05459-007-AL-FL.jpg") { hea = 160; } if (url == "http://10.34.58.145/objects/barfuesserplatz-parkplatz-lohnhof.png") { hea = 90; } if (url == "http://10.34.58.145/objects/barfuesserplatz-kohlenberg.png") { hea = 90; } if (url == "http://10.34.58.145/objects/Fel_008898-RE.jpg.png") { hea = 90; } if (url == "http://10.34.58.145/objects/Com_M06-0079-0004.jpg") { hea = 270; } if (url == "http://10.34.58.145/objects/barfuesserplatz-lohnhof-schnee.png") { hea = 90; } if (url == "http://10.34.58.145/objects/Ans_05395-02-001.jpg") { hea = 270; } if (url == "http://10.34.58.145/objects/Ans_05395-01-016.jpg") { hea = 0; } if (url == "http://10.34.58.145/objects/Barfuesserirche_ganz.jpg") { hea = 180; } if (url == "http://10.34.58.145/objects/Dia_287-01946.jpg") { hea = 300; } if (url == "http://10.34.58.145/objects/Ans_05395-01-003.jpg") { hea = 0; } if (url == "http://10.34.58.145/objects/Basel_2012-08_Mattes_1_(206).JPG") { hea = 90; } if (url == "http://10.34.58.145/objects/Ans_02112.jpg") { hea = 240; } if (url == "http://10.34.58.145/objects/Com_M06-0079-0002.jpg") { hea = 290; } if (url == "http://10.34.58.145/objects/Ans_05395-01-001.jpg") { hea = 200; } //Temporary fix if (time != "" && activate_temp) { DateTime dateTime = DateTime.Parse(MetadataUtils.GetDateTime(VARIABLE.Metadata)); if (lowerbound < dateTime && dateTime < upperbound) { Debug.Log("TIME DEBUG: " + MetadataUtils.GetDateTime(VARIABLE.Metadata) + " CURRENT: LOWER " + lowerbound + " UP " + upperbound); pictureDataList.Add(new PictureData(id, url, lat, lon, hea, time)); FetchedList.Add(new PictureData(id, url, lat, lon, hea, time)); } else { continue; } } else { pictureDataList.Add(new PictureData(id, url, lat, lon, hea, time)); FetchedList.Add(new PictureData(id, url, lat, lon, hea, time)); } id++; backupkeys.Add(id); Debug.Log("No fetchedlid " + FetchedList.Count); } }