Adding places from KML [Keyhole Markup Language] files

I would like to learn how to create KML files that are acceptable to Gramps on the Geography view, when I right-click on the map and select “Add place from KML”. I have tried creating polygons in Google Maps and Google Earth, and saving them as KML files, but nothing happens when I add them. The example in the wiki looks like it has a shaded polygon. Does anyone have any samples that work? Thanks.

Wow, that does look like a nice feature. Maybe we can get the 3 KML (Keyhole Markup Language) files mentioned for the illustration in the wiki. We could link them as examples there.

I wonder if the KML file had to be added to the Media (is that the same as Gallery?) tab at the Person, Event or Place object level to be properly layered into that Geography view?

  • The farm for the birth of this person.
  • The path used to go to school (school event).
  • The limits of the parish or municipality (baptism event).

I haven’t done anything with KML since doing some ‘station boundaries’ overlays for the local Fire Department Union. It was quick & easy to learn.

  • The farm for the person
    The kml file is added to the Birth event gallery
  • The path used to go to school
    The kml file is added to one Education event gallery
  • The limits of the parish …
    I added the kml file for the place in the place gallery.

If you have some problems, you can file a bug and provide your kml file.
I don’t use all kml possibilities…

4 Likes

Is this wiki section revision accurate then? (I made up a viable reason to apply the KML outline to an Event rather than a Place. The reasoning implies extended use of the feature to reflect property boundary changes over a lifetime.)


If KML files are added as Media objects in the Gallery tab for the various records, this Geography view will show one path or one surface for each KML file.

In the following example, you see 3 layered KML files rendered from different Gallery tabs referenced by this Person:

  • a farm limits outline KML in the Birth Event.
  • a path KML used to go to school in the Education Event.
  • a parish (or municipality) limits outline KML in the Place Gallery tab for the Baptism Event.

In the case of the Farm limits outline, the KML was added to the Gallery tab of the Birth Event (rather than being applied to that of the re-useable ‘Farm’ type Place) because acreage was bought and sold over the years. This outline represented the Farm size at the date of birth.

Thanks Serge, I got it to work, it was my mistake. I had connected it to an event, but I had not connected the event to a person.

You can do what you want.

The kml files was added in gramps 4.2.0
This was just to have the possibility to show places, areas or paths. I never thought we could have places history. I think the best way to do that would be to have multiple places.

1 Like

Since a media object can have a date, why not allow multiple kml files to record boundary changes over time?

1 Like

Why not, the problem will be now: how we can show the evolution on the map?

1 Like

It certainly opens up possibilities of a nice animation. :slight_smile:

2 Likes

One of the target for 5.2 is to add the bits missing from the example.gramps that are needed to recreate illustrations & examples in the wiki.

The KML samples are missing. We need examples of Place Gallery objects for a path & region (maybe a set of pins?) to recreate the example in the wiki. Failing that, new examples so that the wiki section can be rewritten.

And as stated in bug 10487, the documentation is sketchy. @GeorgeWilmes your posting said you figured out how to use this feature. Do you have sample KMLs we could use? And could you suggest clarifications for the wiki article? (Since bug 11954 reports large KML file failures, samples should be minimized. And Enhancement Request 8428 may be fodder for improving the wiki content.)

Also note that the Example.gramps is extremely deficient in Place GPS coordinates needed to fully illustrate the Geography view modes. But changes that pervasive might invalidate some of the Bug Reports that use the example Gramps file. Perhaps we could illustrate doing en masse Place record quality cleanup? (via script or the ImportText add-on?) That would service multiple tutorial targets at once.

Also note that the SVG files used for the Geography map pins seem to be placeholder files. (2 are rudimentary 2D push pins that clash with the 3D-ish Tango look&feel of Gramps. The other 3 are horizontally flipped Tango ‘Zoom’ control icons. Those clash contextually.)

I think you must be referring to this posting? I haven’t tried any others in Gramps. Here are the contents of that KML file:

\<?xml version="1.0" encoding="UTF-8"?>
\<kml xmlns="http://www.opengis.net/kml/2.2">
  \<Document>
    \<name>farm\</name>
    \<Placemark>
      \<name>farm\</name>
      \<description>Brady farm\</description>
      \<Polygon>
        \<outerBoundaryIs>
          \<LinearRing>
            \<coordinates>
              -78.727697,44.299047,0
              -78.711711,44.302832,0
	      -78.709429,44.297504,0
	      -78.725496,44.293817,0
              -78.727697,44.299047,0
            \</coordinates>
          \</LinearRing>
        \</outerBoundaryIs>
      \</Polygon>
    \</Placemark>
  \</Document>
</kml>

I will have a look.

@PLegoux has created a Gramps KML tutorial (in French & English) and has sample KML data for it.

It is referenced in this thread about collating updated material for the 5.2 example.gramps