Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9182349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:32:21+00:00 2026-06-17T18:32:21+00:00

I’ve been researching days about a problem… I am new to KML and i

  • 0

I’ve been researching days about a problem… I am new to KML and i want to create one file with The folowing informations:

Email
address
postcode
country
telephone
fax
internet
name
image
license
Call number
lat
lng

The csv file is maintained. If there is a tool I would be very happy. Otherwise, I would write it manually, if I know the syntax.

I am using a mac so windows KML creators not come into question… I have tried many tools and none was what I wanted.

The best tool I’ve found was http://batchgeo.com/de/ but there is no KML file anymore.

[EDIT]

Is there a good way to solve this in a python script? i already have a .csv!

Best regards Curtis

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T18:32:22+00:00Added an answer on June 17, 2026 at 6:32 pm

    For reading .csv files, you can use the csv module like this:

    reader = csv.reader(open("file.csv"))
    for row in reader:
      for value in row:
        ...  
    

    You might get in trouble when your file is UTF-8 encoded, since csv does not support that. But there is a wrapper which will take care of this.

    You can, of course, also simply read your file line by line and split it by commas: values=line.split(',').

    Being that that the kml format is not very complicated, the toughest part of creating a representation of your data is deciding what it should look like. A very simple piece of code to insert the values read from the csv file could look like this:

    # read field labels from first line in file
    header = reader.next()
    # prepare static output
    templates = [('  <Placemark>\n   <name>{}</name>\n', 'name'),
             ('   <description>\n    <![CDATA[\n     <img src="{}"/>\n', 'image'),
             ('     {}\n', 'address'),
             ('     {}\n', 'postcode'),
             ('     {}\n', 'country'),
             ('     Tel: <span class="tel">{}</span>\n', 'telephone'),
             ('     Mail: <span class="mail">{}</span>\n', 'Email'),
             ('   </description>\n   <Point>\n    <coordinates>{},', 'lat'),
             ('{}</coordinates>\n   </Point>\n  </Placemark>\n', 'lng')]
    # lookup function for field values. leading and trailing whitespace will be removed
    value = lambda field, array: array[header.index(field)].lstrip().rstrip()
    
    # start output
    print '''<?xml version="1.0" encoding="UTF-8"?>
    <kml xmlns="http://www.opengis.net/kml/2.2">
     <Document>'''
    # insert values into xml
    for row in reader:
        for t, f in templates:
            print t.format(value(f, row)),
    
    print ' </Document>\n</kml>'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want use html5's new tag to play a wav file (currently only supported
I have been unable to fix a problem with Java Unicode and encoding. The
i want to parse a xhtml file and display in UITableView. what is the
I am reading a book about Javascript and jQuery and using one of the
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
Basically, what I'm trying to create is a page of div tags, each has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.