locked
KML Web Service RRS feed

  • Question

  • User-140636753 posted

    Hi Guys,

    I need to create web service which provide information in KML format.

    It is for iPhone - google map - application.

    http://code.google.com/apis/kml/documentation/kml_tut.html

    I can create KML - XML file based on our DB data, but how to wrap it into web service I have no Idea.

    If any body have an experience, please give me a hand.

    Need example... 

    Monday, February 1, 2010 11:45 PM

Answers

  • User-140636753 posted

    All sorted,

     

    It is easy,

    I have just created [WebMethod] which returns XMLDocument, and it all looks exactly right 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 3, 2010 5:10 PM

All replies

  • User-140636753 posted

    I have done a bit of research.

    Looks like it is "normal" web service.

    It should return XML, something like this:

     

    <?xml version="1.0" encoding="UTF-8"?>
    <kml xmlns="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
    
      <Document id="test">
        
    <name>Branch Locations</name>
       
     <atom:author>             
          
    <atom:name>Test Autor</atom:name>         
        
    </atom:author>         
        
    <atom:link href="http://pib.com/" />
        
    <TimeStamp>
          
    <when>2010-02-01T10:30:15+10:00</when>
        
    </TimeStamp>
        
        
    <AddressDetails AddressType="Business" xmlns="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0">
      
        <Country>
       
         <CountryName>China</CountryName>
      
        </Country>
    </AddressDetails>
     <Folder id="NFW">
    <name>Test</name>
    <open>0</open>
          
    <description>
      
     </description>
     
         <AddressDetails AddressType="Business" xmlns="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0">
           
     <Country>
              <CountryName>Australia</CountryName>
         
         <Locality>
                <LocalityName>TEST</LocalityName>
       
           </Locality>
            </Country>
          </AddressDetails>
          
       
       <Folder id="CH">
            <name>Hospitals</name>
     </Folder>
     <Folder>
    </Document>
     

     

    It is return basically class Document.How to write this class in C#?

    That after serialization it looks like in example above?

     

    My questins now are:

    1) How to add attribute into header?: xmlns:atom="http://www.w3.org/2005/Atom

    2)I have to send class Document, how to add attribute id to this class?

    3)How to add Attribute / Tag case? <atom:author>

     

    How my C# class Document should looks like to provide these attributes?

     

    Cheers,

    Wednesday, February 3, 2010 12:07 AM
  • User-140636753 posted

    All sorted,

     

    It is easy,

    I have just created [WebMethod] which returns XMLDocument, and it all looks exactly right 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 3, 2010 5:10 PM
  • User-1635587313 posted

    Hello,

                   Is it possible to "export to kml"  like "export to excel" or 'export to csv'  from a datagrid

    in c# or vb.net please help..

     

     

    Thanks

    Praveen Singh Bisen

    praveen.mca21@gmail.com

    Thursday, March 11, 2010 11:04 AM
  • User104780883 posted

    Hey...I just came across your post on creating an KML File from an XML...Can you provide me that webservice which u have created...I would like to give a try to that...

    Thursday, October 31, 2013 2:34 AM