This is a migrated thread and some comments may be shown as answers.

how to convert the kml xy values in to latitude, longtitude

5 Answers 220 Views
Map
This is a migrated thread and some comments may be shown as answers.
Asiq Raja
Top achievements
Rank 1
Asiq Raja asked on 23 Nov 2010, 02:28 PM
Hi,

        Now i m using the telerik rad map for show the details, and want to bind the shape file, but unfortunately i m using telerik q1 version, so i can't able to directly use that shape file, so i convert that as a kml file format. Now its working but i using some sample kml data's which is provided by telerik examples. but  when i look a deep look in my converted kml file, i see the values are in X,Y Values, so that i don't know How to bind this values in to the rad map, even weather rad map ll support this values or not i don't know, So plz

Explain me how to handle this, and how to convert the XY values in to decimal  latitude & Longitude.

Are any way to bind the xy values directly in the rad map control, using kml file.

Thank you

5 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 26 Nov 2010, 12:18 PM
Hello Asiq Raja,

I'm sorry, we were not able to follow your description completely. Could you, please, clarify -- what do you mean by "X,Y Values"? The KML file stores coordinates as "longitude,latitude" pairs. Could you, please, provide your converted KML file so we could take a look inside? 

Kind regards,
Andrey Murzov
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Asiq Raja
Top achievements
Rank 1
answered on 26 Nov 2010, 04:48 PM
Hi ,

    Here is the kml sample data.

<?xml version="1.0" encoding="UTF-8"?>
<Document>
<name><![CDATA[streets]]></name><visibility>1</visibility>
<Style id="waypoint"></Style>
<Style id="route">
<Icon><href>root://icons/bitmap-4.png?x=160&amp;y=0&amp;w=32&amp;h=32</href></Icon></Style><LookAt><longitude>0</longitude><latitude>0</latitude><range>4.0075E+07</range></LookAt><Folder><name>Tracklogs</name><visibility>1</visibility>
<Placemark><name>TRK83753</name>
<Style>
<LineStyle><color>FF000000</color><width>1</width></LineStyle></Style>
<LineString><coordinates>.317445888219629,.598315093610355,0 .317412042271531,.59822180316705,0 .317408394191247,.598183669826059,0 .317432217786041,.598100296119765,0 .317516754709756,.598015274770052,0 .317633480923585,.597930268757648,0 .31781460288254,.597808838415296,0 .31799170499583,.597679304999414,0 .318277493626602,.597448559358635,0 .318498892213202,.59724208629254,0 .318543209605699,.597120590608637,0 .318583505224036,.596995042441709,0 .318599647433061,.596893786131543,0 .318636035329409,.596521151941777,0 .318599926873262,.596298353986359,0 .318547756013237,.596006688898927,0 .318547797789188,.5959175766087,0 .318551868917167,.595816314553633,0 .318555949526956,.595694799704465,0 .318543931677432,.595581378330429,0 .318519867493439,.595415293967327,0 .318511896042684,.595253267806251,0 .318507931168419,.595127698582715,0 .318508014587928,.59494947400754,0 .318487930395233,.594876554413764,0 .318419547092484,.594836016394026,0 .318310913909491,.59482381320404,0 .318190164259801,.594908817669204,0 .318145850900605,.595022212281785,0 .318041089667503,.595334055538826,0 .318016942009368,.595346195750019,0 .317988783971512,.595329980153078,0 .317976730063449,.595293519412519,0 .317992915753066,.595099100324985,0 .318065542594865,.594669775641645,0 .318049483955124,.594592807427803,0 .318029394072525,.5945320395365,0 .318005274844087,.594483421410617,0 .317993245537654,.594394303439249,0 .317993272054504,.594337595643752,0 .318017485976576,.594183685921228,0 .318090023549085,.593944737359011,0 .318186703035517,.593705800193614,0 .318267280269116,.593483057605106,0 .318307596282125,.593312953209973,0 .318311665307584,.593215741723455,0 .318295638699241,.593069914030217,0 .318251459677538,.592895719124529,0 .318219323286131,.592782288298374,0 .318151011714632,.592587829221742,0 .318110820431672,.592490596840608,0 </coordinates></LineString></Placemark></coordinates></Document>

this are the values they bind for write the lines in the shape file,,
but when i try to bind with the map control so could you plz help to fix this issue.

Thank you
0
Andrey
Telerik team
answered on 30 Nov 2010, 02:31 PM
Hello Asiq Raja,

I have attached a sample solution which reads the kml-file to the information layer. It uses the MapShapeReader class to read shapes from the kml.

I hope it helps.

Regards,
Andrey Murzov
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Asiq Raja
Top achievements
Rank 1
answered on 01 Dec 2010, 03:26 PM
Thanks,  for the help, Its working fine, And now i would like to ask u, if can i use the same method to read the shapefile,and dbf file, or how to handle could u plz give me a sample example.


Thanks & regards
   M.Asiq Raja
0
Andrey
Telerik team
answered on 06 Dec 2010, 09:58 AM
Hello Asiq Raja,

You can use MapShapeReader to read ESRI shape files as well. Simple pass URI of the shape file instead of name of the KML file.

Best wishes,
Andrey Murzov
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
Tags
Map
Asked by
Asiq Raja
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Asiq Raja
Top achievements
Rank 1
Share this question
or