Addresses?

May 27, 2009 at 8:01 PM

Any chance of incorporating addresses?  I come from a blended family and it would be nice to see people grouped together by households or even cities/states/countries.  Great work on the relationships and displays!

Randy

Coordinator
May 27, 2009 at 8:02 PM

Hi there, I'm out of the office for a couple of days. I'll be checking email but responses may be delayed slightly.

Best wishes,

Tim Sneath
Director | Client Platform Evangelism | Microsoft Corp.

May 28, 2009 at 2:48 AM

I like the idea.  Would a cloud list for countries and or cities be better though as a list view?  Family.Show is really missing more tree and report views.

Jun 22, 2009 at 12:21 PM

would be more nice if you could see the family locattion on "Virtual Earth" as PushPins... :0) or say export as KML file..

Developer
Jun 22, 2009 at 5:13 PM
Edited Jun 22, 2009 at 5:13 PM

I like this idea too and sort of implemented it in the source I've been using.  Next to place fields and the birth place text next to the thumbnail, I added a little magnifying glass icon which when you clicked, loaded an image of the location in Bing maps (the new name for Live Maps)

Such a button needs to read the place field text and load it in a browser on click:

 

private void SearchMapBirthPlace(object sender, RoutedEventArgs e)
        {
            try
            {
            if (this.family.Current.BirthPlace.ToString() != null && this.family.Current.BirthPlace.ToString().Length > 0)
            {
                string searchText = this.family.Current.BirthPlace.ToString();
                System.Diagnostics.Process.Start("http://www.bing.com/maps/default.aspx?&v=&where1=" + searchText);
            }
            else
                System.Diagnostics.Process.Start("http://www.bing.com/maps/");
           
            }
            catch
            {
                System.Diagnostics.Process.Start("http://www.bing.com/maps/");
            }
        }

It certainly would be interesting is to loop the program over all place tags in the tree and export to KML as cometomama suggested, just to see the distribution of the PushPins.
I'd have to read up on KML format but sounds like an interesting idea :)
Developer
Jun 22, 2009 at 11:02 PM
Edited Jun 22, 2009 at 11:15 PM

I had a think about a method for exporting places to KML file for loading in Google Earth or similar.

The standard used by Google Earth is Keyhole Markup Language.  My method basically takes a familyx file, loops over all birth places and all death places and creates a KML file which is organised in to two folders, Births and Deaths.

I added the following to people.cs and a menu item in the main window to execute it.  It returns a string summary of what it has exported for display in a message window.

 

public string ExportPlaces() {

//where to save the file

string places = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), App.ApplicationFolderName);

//file name take the familyx file name and append "-places.kml"

string PlacesFileName = Path.GetFileNameWithoutExtension(this.FullyQualifiedFilename) + " - places.kml";      
            places = places + @"\";

//delete file if exists... could append (1), (2) etc or allow user to specify at but for testing just overwrite


if (File.Exists(Path.Combine(places, PlacesFileName)))
File.Delete(Path.Combine(places, PlacesFileName));

TextWriter tw = new StreamWriter(Path.Combine(places, PlacesFileName));

       tw.WriteLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
                         "<kml xmlns=\"http://www.opengis.net/kml/2.2\" xmlns:gx=\"http://www.google.com/kml/ext/2.2\" xmlns:kml=\"http://www.opengis.net/kml/2.2\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n" +
                         "<Document>\n" +
                         "<name>"+PlacesFileName+"</name>\n" +
//start the first folder
                         "<Folder>\n" +
                         "<name>Birth Places</name>\n" +
                         "<open>0</open>");  //0 means collapsed

//counter for the entries 
int i = 0;
  
//loop for births
            foreach (Person p in this.PeopleCollection)
            {
                if (p.BirthPlace != null && p.BirthPlace.Length != 0)
                {
                    tw.WriteLine("<Placemark>\n" +
                                "	<name>" + p.FullName + "</name>\n" +
                                "	<address>" + p.BirthPlace + "</address>\n" +
                                "	<description>" +p.BirthPlace + "</description>\n" +
                                "</Placemark>");
                    i++;

                }

            }
 
//Close the prvious folder and start the next one
           tw.WriteLine("</Folder><Folder>\n" +
                          "<name>Death Places</name>\n" +
                          "<open>0</open>");

//loop for deaths
            foreach (Person p in this.PeopleCollection)
            {

                if (p.DeathPlace != null && p.DeathPlace.Length != 0)
                {
                    tw.WriteLine("<Placemark>\n" +
                                "	<name>" + p.FullName + "</name>\n" +
                                "	<address>" + p.DeathPlace + "</address>\n" +
                                "	<description>" + p.DeathPlace + "</description>\n" +
                                "</Placemark>");
                    i++;

                }
            }
//write the end of the file
            tw.WriteLine("	</Folder>\n" +
                          "</Document>\n" +
                          "</kml>");

            tw.Close();
            string summary = i.ToString()+ " places exported.";

//delete if nothing exported!
            if (i == 0)
            {
                File.Delete(Path.Combine(places, PlacesFileName));
                summary = "No places to export.";
            }

            return summary;
        }

For anyone who fancies trying it, have fun. Remember that Google Earth and similar use position tags with coordinated. I exported position as a place name so Google Earth has to search and convert to coordinates on opening the file so it takes a few minutes for all the pins to show up.


elyoh