Configuring a Populatuion Distribution Map

This article aims to show you how to configure and create your own standalone population distribution map.

Population Distribution Maps show the location of every event in your database laid out onto a functional Google Map and then overlayed with a density heatmap. In wide view, event locations are grouped together, but as you zoom in, more and more detail is revealed. Clicking on marked locations shows an information window listing the location, its coordinates and the names of the individuals found there.
Genalogy Map
Genalogy Map
Genalogy Map (zoomed)
Genalogy Map (zoomed)

Running Gigatrees

Building a population distribution map is as easy as running the following command. Unfortunately, Google only supports viewing their maps when viewed from a valid URL online, so you must configure your map for a database. The configuration files listed in the command can be found described below. You can simply copy and paste those configurations into similarily named text files and place them in the same folder as the application.

gigatrees5.exe -c config.xml -c db.xml

Distribution Map Configuration

In order to configure a distribution map, the first thing you will need to do is load the gigatrees and googlemaps plugins and the default theme and then enable copying of the plugin files to your output folder. Next, in the default theme, $HOME_LINK$ is setup to link to the home page. However, when building standalone reports, the home page is not created, so you will need to override that placeholder as shown. Next, you will need to setup the website metadata. You should, of course, add your website's title and any other items that you wish to include, such as the site owner's name, the site description, banner and favicon. For a cleaner look, you can hide the sidebar menu by including the hide.sidebar.css stylesheet (found in the gigatrees plugin folder). Next, you will need to enter your GEDCOM filename and, if needed, change the output folder. You will also need to enable just the <Pages> you want to create. Since this demonstration is for a single distribution map, that is the only one enabled below. Since profile pages are disabled, each individual's record id number will be shown preceding their name. You can also hide this under the miscellaneous option, for a cleaner look. You may also want to rename the all-too-snarky page title, by translating it. The last step is to configure the <Locations> settings. If you have not already followed the instructions on that page to obtain the nescesary API keys, you will need to do that now (they are free). Since my genealogy database does not include any coordinates, I loaded my geodata database file to access these coordinates. I then added the API keys for the supported geocoding services. Finally, I added my API key. An important caveat. The geocoding services are limited to using the location descriptions found in your GEDCOM file. When they are unable to find the location, Gigatrees will strip off the most detailed portion of your description and try again. It will rinse and repeat until all that is left is the country name, which should resolve, however, it is important that your descriptions are valid. Archaic descriptions should be avoided when possible (especially country names). The geocoding services are also not perfect. I've found on rare occaions that I needed to use the <Location> setting to override these. In the configuration below, I've set the accept language to English. Theoretically this should work for other languages as well, however, I have not tested this. The default location file located in the distribution includes (I think) all modern/valid country names, including some international spellings I've run across in my travels (in Wikipedia). If you are an international user, you may find it necessary to update the default location file's alternate country names. I've found the DB Browser for SQLite to be a useful Windows utility for such endeavors.

config.xml

<Gigatrees>
  <Plugins>
    <Plugin> plugins\gigatrees </Plugin>
    <Plugin> plugins\googlemaps </Plugin>
    <Plugin> plugins\theme.a   </Plugin>
	
    <CopyPlugins> true </CopyPlugins>
  </Plugins>
	
  <Placeholders>
    <Placeholder> <Name> $HOME_LINK$ </Name> <Content> <![CDATA[ %RootPath%/map ]]> </Content> </Placeholder>  
  </Placeholders>

  <Setup>
    <SiteTitle>       Genealogy Maps </SiteTitle>
    <SiteOwner>       ...            </SiteOwner>
    <SiteDescription> ...            </SiteDescription>
    <SiteBanner>      ...            </SiteBanner>
	
    <Favicon>         %PluginsURL%gigatrees/imgs/favicon.png </Favicon>
	
    <DropHeader><![CDATA[ <link href="%PluginsURL%gigatrees/hide.sidebar.css" rel="stylesheet" /> ]]></DropHeader>
  </Setup>
 
  <Main>
    <GedcomFile> family.ged </GedcomFile>
    <OutputPath> web        </OutputPath>
  </Main>  
  
  <Pages>
    <Tree>         false </Tree>
    <Names>        false </Names>
    <Profiles>     false </Profiles>
    <Sources>      false </Sources>
    <Blog>         false </Blog>
    <Places>       false </Places>
    <Map>           true </Map>
    <Timelines>    false </Timelines>
    <OriginMaps>   false </OriginMaps>
	<AncestorMaps> false </AncestorMaps>
    <Ancestors>    false </Ancestors>
    <DNAAncestors> false </DNAAncestors>
    <DNARelatives> false </DNARelatives>
    <Kinships>     false </Kinships>
    <Census>       false </Census>
    <Descendants>  false </Descendants>
    <Collections>  false </Collections>
    <Immigrants>   false </Immigrants>
    <Nobility>     false </Nobility>
    <Photos>       false </Photos>
    <Gallery>      false </Gallery>
    <Validation>   false </Validation>
    <Updates>      false </Updates>
  </Pages>

  <Misc>
    <HideRecordIds> true </HideRecordIds>    
  </Misc>

  <Translations>
    <Translate> <English> Population Distribution Map </English> <Display> Where They Lived </Display> </Translate>
  </Translations> 
  
  <Locations>
    <LocationFile>           config\geodata.sqlite    </LocationFile>
    <AcceptLang>             en                       </AcceptLang>
    <MapQuestGeocodingKey>   [Super-Secret-API-Key-1] </MapQuestGeocodingKey>
    <LocationIQGeocodingKey> [Super-Secret-API-Key-2] </LocationIQGeocodingKey>
    <GoogleMapsApiKey>       [Super-Secret-API-Key-3] </GoogleMapsApiKey>
  </Locations>    
</Gigatrees>

Database

To create the database requires a few additional steps. If you already have plugins installed on your server, you may want set the <CopyPlugins> option to false. I install all my plugins at the root level, so that I do not need to have multiple sets for each demo. Next, define some placeholders to simplify the setup. You will need to set your /super/secret/server/path to match that provided to you by your hosting service and fill in your domain, database-name and your database extension (i.e. db, sqlite, etc.). The domain name must always point to the root domain. Next, the setup assumes you are going to install your map into a subfolder of your root domain that has the same name as your database. You can change the folder name here if you like, or remove the <RootPath> if installing at the root domain. This setup also assumes that your plugins are installed at the root level (like mine). If you are putting them into your subfolder, don't disable copying of plugins, and clear the <PluginsURL> option to use the default setting. The next step is to enable the database. You should not need to make any changes here as it uses the placeholders you setup prior. Lastly, anytime you are publishing your website online, you should enable the privatization <Security> setting and hide living individuals. This will obsfucate their names and strip sensitive data as well as other information you may have flagged as private.

db.xml

<Gigatrees>
  <Plugins>
    <CopyPlugins> false </CopyPlugins>
  </Plugins>  
  
  <Placeholders>
    <Placeholder> <Name> $SERVER$    </Name> <Content> /super/secret/server/path </Content> </Placeholder>
    <Placeholder> <Name> $DOMAIN$    </Name> <Content> https://domain.com        </Content> </Placeholder>
    <Placeholder> <Name> $SITE$      </Name> <Content> database-name             </Content> </Placeholder>
    <Placeholder> <Name> $DATABASE$  </Name> <Content> $SITE$.ext                </Content> </Placeholder>
  </Placeholders>
 
  <Setup>
    <Domain>      $DOMAIN$  </Domain>
    <RootPath>    /$SITE$   </RootPath>
    <PluginsURL> 	/plugins/ </PluginsURL>
  </Setup>	
  
  <Database>
    <EnableServerDatabase> true          </EnableServerDatabase>
    <LocalDatabasePath>    %OutputPath%  </LocalDatabasePath>
    <ServerDatabasePath>   $SERVER$      </ServerDatabasePath> 
    <ServerDatabaseName>   $DATABASE$    </ServerDatabaseName>
  </Database>  
  
  <Security>
    <Privatize>  true </Privatize>
    <HideLiving> true </HideLiving>
  </Security>  
</Gigatrees>

So there you have it, easy-peasy-ish. When building a database for deployment, you will need to deploy it. See the Quick Start Guide for simple instructions on doing so. These instructions should get you started building a Population Distribution Map that your friends will be envious of.

Comments