0

I'm not sure how to deal with KML files. Now important particularly in reference to the Google Venice update. My site basically is a guide of many company listings (sort of Yellow Pages). I want each company listing to have a geolocation associated with it.

Which of the options I present below is the way to go?

OPTION 1: all locations in a single KML file with a reference to that KML file from a geositemap.xml

MYGEOSITEMAP.xml

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:geo="http://www.google.com/geo/schemas/sitemap/1.0"> 
<url><loc>http://www.mysite.com/locations.kml</loc> <geo:geo>    <geo:format>kml</geo:format></geo:geo></url>
</urlset> 

ALLLOCATIONS.kml

<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">    
<Document>
<name>MyCompany</name>
<atom:author>
    <atom:name>MyCompany</atom:name>
</atom:author>
<atom:link href="http://www.mysite.com/locations/3454/MyCompany" rel="related" />    
<Placemark>
<name>MyCompany, Kalverstraat 26 Amsterdam  1000AG</name>
<description><![CDATA[<address><a href="http://www.mysite.com/locations/3454/MyCompany">MyCompany</a><br />Address: Kalverstraat 26, Amsterdam  1000AG <br />Phone: 0646598787</address><p>hello there, I'm MyCompany</p>]]>
</description><Point><coordinates>5.420686499999965,51.6298808,0</coordinates>    
</Point>
</Placemark>
</Document>
</kml>

<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
    <name>MyCompany</name><atom:author><atom:name>MyCompany</atom:name></atom:author><atom:link href="http://www.mysite.com/locations/22/companyX" rel="related" /><Placemark><name>MyCompany, Rosestreet 45 Amsterdam  1001XF </name><description><![CDATA[<address><a href="http://www.mysite.com/locations/22/companyX">companyX</a><br />Address: Rosestreet 45, Amsterdam  1001XF <br />Phone: 0642195493</address><p>some text about companyX</p>]]></description><Point><coordinates>5.520686499889632,51.6197705,0</coordinates></Point></Placemark>
</Document>
</kml>

OPTION 2: a separate KML file for each location and a reference to each KML file from a geositemap.xml (kml files placed in a \kmlfiles folder)

MYGEOSITEMAP.xml

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:geo="http://www.google.com/geo/schemas/sitemap/1.0"> 
<url><loc>http://www.mysite.com/kmlfiles/3454_MyCompany.kml</loc> <geo:geo>    
<geo:format>kml</geo:format></geo:geo></url>
<url><loc>http://www.mysite.com/kmlfiles/22_companyX.kml</loc> <geo:geo>    
<geo:format>kml</geo:format></geo:geo></url>
</urlset> 

*3454_MyCompany.kml*

<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document><name>MyCompany</name><atom:author><atom:name>MyCompany</atom:name></atom:author><atom:link href="http://www.mysite.com/locations/3454/MyCompany" rel="related" /><Placemark><name>MyCompany, Kalverstraat 26 Amsterdam  1000AG</name><description><![CDATA[<address><a href="http://www.mysite.com/locations/3454/MyCompany">MyCompany</a><br />Address: Kalverstraat 26, Amsterdam  1000AG <br />Phone: 0646598787</address><p>hello there, I'm MyCompany</p>]]></description><Point><coordinates>5.420686499999965,51.6298808,0</coordinates></Point></Placemark>
</Document>    
</kml>

*22_companyX.kml*

<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document><name>companyX</name><atom:author><atom:name>companyX</atom:name></atom:author><atom:link href="http://www.mysite.com/locations/22/companyX" rel="related" /><Placemark><name>companyX, Rosestreet 45 Amsterdam  1001XF </name><description><![CDATA[<address><a href="http://www.mysite.com/locations/22/companyX">companyX</a><br />Address: Rosestreet 45, Amsterdam  1001XF <br />Phone: 0642195493</address><p>some text about companyX</p>]]></description><Point><coordinates>5.520686499889632,51.6197705,0</coordinates></Point></Placemark>
</Document>
</kml>

OPTION 3?

1

If you can create an index file similar to sitemap index files I would use that method (Option 1) this way you don't end up with thousands of individual files.

| improve this answer | |
  • What would that index file then look like? In my sitemap index file I currently simply refer to location of sitemap.xml files. In my geositemap index file I would refer to kml files? What format does Google accept for me to upload in webmaster tools? Do you perhaps have an example? (sorry this KML stuff is totally new to me) Thanks! – Joe Mar 20 '12 at 12:44
  • I was referring to your option 1 having a geositemap index file. I looked for examples of an index file but was not able to find any. You can download KML examples here developers.google.com/kml/documentation/kml_tut – Anagio Mar 20 '12 at 12:48
  • Just to verify: basically my MYGEOSITEMAP.xml will contain a single <url> node that refers to one large KML file? I can then upload the XML into Google Webmaster tools and that should be it? (BTW: my goal I forgot to mention is of course to offer localized search results in the regular google search, not Google Earth) – Joe Mar 20 '12 at 13:10
  • Once in webmaster tools you can click on the submitted site map index file and you'll see the indexed files listed. Basically you click to drill down to the individual maps – Anagio Mar 20 '12 at 13:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.