Re: Writ 2 KML [message #77964] |
Fri, 14 October 2011 05:06 |
d.poreh
Messages: 406 Registered: October 2007
|
Senior Member |
|
|
On Oct 12, 11:14 am, Dave Poreh <d.po...@gmail.com> wrote:
> On Oct 11, 9:46 pm, Paulo Penteado <pp.pente...@gmail.com> wrote:
>
>> I put your data into a text file, and, adapting from the example in
>> the help, did
>
>> a=(read_ascii('testkml.txt')).(0)
>> p=plot([0,0],/
>> nodata,xrange=[-180,180],yrange=[-90,90],map_projection='equ irectangular')
>> poly=polyline(a[0:1,*], /data, color='red', name='testkml.txt',
>> thick=2.)
>> p.save,'test.kml'
>
>> And got a file that seems to work in Google Earth. But I do not know
>> how to do it with variable colors (do not even know if Google Earth
>> supports it in a line).
>
> Thanks Paulo,
> i think it works just in 8.1 and i am using 8.0. do you have any other
> suggestion to do with 8.0?
> Cheers,
> Dave
Actually i can write my data to kml (http://imageshack.us/photo/my-
images/26/999ke.jpg/), but i need to color my data too.
Cheers,
Dave
|
|
|
Re: Writ 2 KML [message #77985 is a reply to message #77964] |
Wed, 12 October 2011 02:14  |
d.poreh
Messages: 406 Registered: October 2007
|
Senior Member |
|
|
On Oct 11, 9:46 pm, Paulo Penteado <pp.pente...@gmail.com> wrote:
> I put your data into a text file, and, adapting from the example in
> the help, did
>
> a=(read_ascii('testkml.txt')).(0)
> p=plot([0,0],/
> nodata,xrange=[-180,180],yrange=[-90,90],map_projection='equ irectangular')
> poly=polyline(a[0:1,*], /data, color='red', name='testkml.txt',
> thick=2.)
> p.save,'test.kml'
>
> And got a file that seems to work in Google Earth. But I do not know
> how to do it with variable colors (do not even know if Google Earth
> supports it in a line).
Thanks Paulo,
i think it works just in 8.1 and i am using 8.0. do you have any other
suggestion to do with 8.0?
Cheers,
Dave
|
|
|
Re: Writ 2 KML [message #77991 is a reply to message #77985] |
Tue, 11 October 2011 12:46  |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
I put your data into a text file, and, adapting from the example in
the help, did
a=(read_ascii('testkml.txt')).(0)
p=plot([0,0],/
nodata,xrange=[-180,180],yrange=[-90,90],map_projection='equ irectangular')
poly=polyline(a[0:1,*], /data, color='red', name='testkml.txt',
thick=2.)
p.save,'test.kml'
And got a file that seems to work in Google Earth. But I do not know
how to do it with variable colors (do not even know if Google Earth
supports it in a line).
|
|
|
Re: Writ 2 KML [message #77993 is a reply to message #77991] |
Tue, 11 October 2011 10:39  |
Juggernaut
Messages: 83 Registered: June 2008
|
Member |
|
|
On Oct 11, 8:22 am, Dave Poreh <d.po...@gmail.com> wrote:
> Folks
> I have some lat-lon data:
> 32.8750 81.1250 0.605627
> 33.1250 81.1250 0.399374
> 33.3750 81.1250 0.0303652
> 33.6250 81.1250 0.316388
> 33.8750 81.1250 0.890325
> 34.1250 81.1250 0.655311
> 34.3750 81.1250 0.206403
> 34.6250 81.1250 0.763451
> 34.8750 81.1250 0.348398
> 18.1250 80.8750 0.675116
> 27.1250 80.8750 0.964568
> 27.3750 80.8750 0.778064
> 27.6250 80.8750 0.955975
> 27.8750 80.8750 0.133582
> 28.1250 80.8750 0.404562
> 28.3750 80.8750 0.433196
> 28.6250 80.8750 0.0806251
> 28.8750 80.8750 0.542687
> 29.1250 80.8750 0.652463
> 29.3750 80.8750 0.770775
> 29.6250 80.8750 0.111308
> 29.8750 80.8750 0.655011
> 30.1250 80.8750 0.500324
> 30.3750 80.8750 0.0229989
> 30.6250 80.8750 0.731347
> 30.8750 80.8750 0.473572
> 31.1250 80.8750 0.952659
> and i want to show these data lat-lon on google earth (3rd column is
> intensity) with different colors. is there any IDL way that i could do
> this?
> Cheers,
> Dave
You'll need to simply make a basic kml document with a bunch of
placemarks representing each point. For each placemark translate your
intensity into a color value of your choosing represented by the
<color> tag in kml. You'll need to have a intensity to color
transformation and just for loop your way through writing out each
Placemark tag...basic construct..
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://
www.google.com/kml/ext/2.2">
<Document>
<name>Test Multi-Color</name>
<Folder>
<Placemark>
<Style>
<IconStyle>
<color>ffff0000</color>
<colorMode>normal</colorMode>
</IconStyle>
</Style>
<Point>
<coordinates>-90.86948943473118,48.25450093195546,0</coordinates >
</Point>
</Placemark>
<Placemark>
<Style>
<IconStyle>
<color>ff00ff00</color>
<colorMode>normal</colorMode>
</IconStyle>
</Style>
<Point>
<coordinates>-91.86948943473118,48.25450093195546,0</coordinates >
</Point>
</Placemark>
<Placemark>
<Style>
<IconStyle>
<color>ff0000ff</color>
<colorMode>normal</colorMode>
</IconStyle>
</Style>
<Point>
<coordinates>-92.86948943473118,48.25450093195546,0</coordinates >
</Point>
</Placemark>
</Folder>
</Document>
</kml>
|
|
|
Re: Writ 2 KML [message #84632 is a reply to message #77985] |
Fri, 14 October 2011 05:04  |
d.poreh
Messages: 406 Registered: October 2007
|
Senior Member |
|
|
On Oct 12, 11:14 am, Dave Poreh <d.po...@gmail.com> wrote:
> On Oct 11, 9:46 pm, Paulo Penteado <pp.pente...@gmail.com> wrote:
>
>> I put your data into a text file, and, adapting from the example in
>> the help, did
>
>> a=(read_ascii('testkml.txt')).(0)
>> p=plot([0,0],/
>> nodata,xrange=[-180,180],yrange=[-90,90],map_projection='equ irectangular')
>> poly=polyline(a[0:1,*], /data, color='red', name='testkml.txt',
>> thick=2.)
>> p.save,'test.kml'
>
>> And got a file that seems to work in Google Earth. But I do not know
>> how to do it with variable colors (do not even know if Google Earth
>> supports it in a line).
>
> Thanks Paulo,
> i think it works just in 8.1 and i am using 8.0. do you have any other
> suggestion to do with 8.0?
> Cheers,
> Dave
Actually i can write my data to kml file (http://imageshack.us/photo/
my-images/26/999ke.jpg/). but i need to color them too with different
color.
Cheers,
Dave
|
|
|