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 8498155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:19:29+00:00 2026-06-11T00:19:29+00:00

i got this KML from a location weeb service and i need to parse

  • 0

i got this KML from a location weeb service and i need to parse it. i need to get all the PLACEMARK tags read i need just the name latitude and longitude from them. Thx for any help.

<?xml version="1.0" encoding="UTF-8" ?> 
 <kml xmlns="http://www.opengis.net/kml/2.2">
 <Document>
  <name>Lociraj.net (C) 2010</name> 
 <StyleMap id="highlighting">
 <Pair>
  <key>normal</key> 
  <styleUrl>#normalState</styleUrl> 
  </Pair>
 <Pair>
  <key>highlight</key> 
  <styleUrl>#highlightedState</styleUrl> 
  </Pair>
  </StyleMap>
 <Style id="highlightedState">
 <IconStyle>
  <scale>1.1</scale> 
 <Icon>
  <href>http://maps.google.com/mapfiles/kml/pal3/icon55.png</href> 
  </Icon>
  </IconStyle>
 <LabelStyle>
  <scale>1.1</scale> 
  </LabelStyle>
  </Style>
 <Style id="normalState">
 <IconStyle>
 <Icon>
  <href>http://maps.google.com/mapfiles/kml/pal3/icon63.png</href> 
  </Icon>
  </IconStyle>
  </Style>
 <Placemark>
  <name>Vaša lokacija</name> 
  <description /> 
 <LookAt>
  <longitude>15.976903</longitude> 
  <latitude>45.813182</latitude> 
  <altitude>0</altitude> 
  <range>500</range> 
  </LookAt>
 <Style>
 <IconStyle>
 <Icon>
  <href>http://lociraj.net/img/icon_map_your_location.png</href> 
  </Icon>
  </IconStyle>
  </Style>
 <Point>
  <coordinates>15.976903,45.813182,0</coordinates> 
  </Point>
  </Placemark>
 <Folder>
  <name>Bankomati</name> 
 <Placemark>
  <name>Raiffeisen</name> 
 <description>
 <![CDATA[ Ilica 1a, Zagreb<br><br>Raiffeisenbank<br>
<b>Udaljenost:</b> 65m<br>

  ]]> 
  </description>
 <LookAt>
  <longitude>15.9761</longitude> 
  <latitude>45.813</latitude> 
  <altitude>0</altitude> 
  <range>500</range> 
  </LookAt>
 <Style>
 <IconStyle>
 <Icon>
  <href>http://lociraj.net/img/icon_map_atm.png</href> 
  </Icon>
  </IconStyle>
  </Style>
 <ExtendedData xmlns:l="http://lociraj.net">
  <l:categoryID>1</l:categoryID> 
  <l:entryID>1782</l:entryID> 
  </ExtendedData>
 <Point>
  <coordinates>15.9761,45.813,0</coordinates> 
  </Point>
  </Placemark>
 <Placemark>
  <name>PBZ</name> 
 <description>
 <![CDATA[ Trg bana J. Jelačića 7, Zagreb<br><br><br>
<b>Udaljenost:</b> 66m<br>

  ]]> 
  </description>
 <LookAt>
  <longitude>15.9777218535</longitude> 
  <latitude>45.8133623448</latitude> 
  <altitude>0</altitude> 
  <range>500</range> 
  </LookAt>
 <Style>
 <IconStyle>
 <Icon>
  <href>http://lociraj.net/img/icon_map_atm.png</href> 
  </Icon>
  </IconStyle>
  </Style>
 <ExtendedData xmlns:l="http://lociraj.net">
  <l:categoryID>1</l:categoryID> 
  <l:entryID>921</l:entryID> 
  </ExtendedData>
 <Point>
  <coordinates>15.9777218535,45.8133623448,0</coordinates> 
  </Point>
  </Placemark>
 <Placemark>
  <name>Erste</name> 
 <description>
 <![CDATA[ Ilica bb, Zagreb<br><br>ZET okretište - Črnomerec<br>
<b>Udaljenost:</b> 68m<br>

  ]]> 
  </description>
 <LookAt>
 <longitude>15.976051</longitude> 
  <latitude>45.81303</latitude> 
  <altitude>0</altitude> 
  <range>500</range> 
  </LookAt>
 <Style>
 <IconStyle>
 <Icon>
  <href>http://lociraj.net/img/icon_map_atm.png</href> 
  </Icon>
  </IconStyle>
  </Style>
 <ExtendedData xmlns:l="http://lociraj.net">
  <l:categoryID>1</l:categoryID> 
  <l:entryID>309</l:entryID> 
  </ExtendedData>
 <Point>
  <coordinates>15.976051,45.81303,0</coordinates> 
  </Point>
  </Placemark>
 <Placemark>
  <name>Erste</name> 
 <description>
 <![CDATA[ Ilica 1, Zagreb<br><br>Prolaz - Neboder<br>
<b>Udaljenost:</b> 68m<br>

  ]]> 
  </description>
 <LookAt>
  <longitude>15.976051</longitude> 
  <latitude>45.81303</latitude> 
  <altitude>0</altitude> 
  <range>500</range> 
  </LookAt>
 <Style>
<IconStyle>
 <Icon>
  <href>http://lociraj.net/img/icon_map_atm.png</href> 
  </Icon>
  </IconStyle>
  </Style>
 <ExtendedData xmlns:l="http://lociraj.net">
  <l:categoryID>1</l:categoryID> 
  <l:entryID>300</l:entryID> 
  </ExtendedData>
 <Point>
  <coordinates>15.976051,45.81303,0</coordinates> 
  </Point>
  </Placemark>
 <Placemark>
  <name>ZaBa</name> 
 <description>
<![CDATA[ Ilica bb, Zagreb<br><br>ZET okretište - Črnomerec<br>
<b>Udaljenost:</b> 68m<br>

  ]]> 
  </description>
 <LookAt>
  <longitude>15.976051</longitude> 
  <latitude>45.81303</latitude> 
  <altitude>0</altitude> 
  <range>500</range> 
  </LookAt>
 <Style>
 <IconStyle>
 <Icon>
  <href>http://lociraj.net/img/icon_map_atm.png</href> 
  </Icon>
  </IconStyle>
  </Style>
 <ExtendedData xmlns:l="http://lociraj.net">
  <l:categoryID>1</l:categoryID> 
  <l:entryID>1519</l:entryID> 
  </ExtendedData>
 <Point>
  <coordinates>15.976051,45.81303,0</coordinates> 
  </Point>
  </Placemark>
  </Folder>
  </Document>
  <kml>

Can you help me parse this

  • 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-11T00:19:30+00:00Added an answer on June 11, 2026 at 12:19 am
    XDocument xDoc = XDocument.Load(....);
    XNamespace ns = "http://www.opengis.net/kml/2.2";
    
    var placemarks = xDoc
                .Descendants(ns + "Placemark")
                .Select(p => new
                {
                    Name = p.Element(ns+"name").Value,
                    Longitude = p.Element(ns+"LookAt").Element(ns+"longitude").Value,
                    Latitude = p.Element(ns+"LookAt").Element(ns+"latitude").Value,
                })
                .ToArray();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Got this regex string from JavaScript: the good parts (pp. 66). Can't get it
Got this code for a viewscroller from the apple developers site. @synthesize scrollView1, scrollView2;
I got this code from our frontend guy for headings: <h2 class=headline><span>Foobar</span></h2> The span
got this code from a website that helped me in creating buttons and stuff.
I got this: SELECT deals.* FROM deals JOIN deals_bookings ON (deals_bookings.deal_id = deals.ID) WHERE
I got this example from one StackOverflow question that was asked but I couldn't
I got this piece of code from Mysql 4th edition to check table existence
Got this error while trying to get the variables out of a class. Using
Got this as an interview question from Amazon to test basic SQL skills and
I got this compile time string comparison from another thread using constexpr and C++11

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.