a placemark only visible at close distance

707 views
Skip to first unread message

Marcus

unread,
Apr 19, 2008, 6:35:16 AM4/19/08
to KML Developer Support - Getting Started with KML
There is a way to set a placemark to appear only if the viewer is
between two specific altitudes.

I have been told to use the 'regions' kml feature to accomplish this.
However in order to use it, I would need to edit the kml outside of
Google Earth using a text editor.

I have tried that..but it dosent work.

(when I edit the kml file in notebook I dont know where to save it
again)

Can anyone help me ?

I need a simple placemark only to be visible at a very close
distance......fx 200 m .....


If it is possible i want it close - not only close in height also
close to the sides - if you know what I mean...you have to zoom close
to it before it get visible

Can that be done ?

mwill

unread,
Apr 19, 2008, 1:20:29 PM4/19/08
to KML Developer Support - Getting Started with KML

Marcus,
First things first... editing the KML outside of Google Earth. Yes,
that is completely possible, and people do it all the time. I'm not
sure what notebook is (do you mean notepad?), but if it is a regular
text editor, not a "full featured" word processor there shouldn't be a
problem. After you edit it, save it anywhere you want to, then go
back into GE, find the file and re-open it (File->Open in Windows).

Second, regions... what you want to do is possible. Have you had a
chance to look at:

http://code.google.com/apis/kml/documentation/kml_tags_beta1.html#region
?

If not, check that out, and if you have any more questions, we're here
to help

mwill


Marcus

unread,
Apr 19, 2008, 3:54:49 PM4/19/08
to KML Developer Support - Getting Started with KML
Thank you for your reply.......im a newbee at this..........if I just
could get just one example file of a simple placemark that only become
visible within 200 meter around I would be very happy.......

I have placed a single placemark...it generates this code:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
<Document>
<name>KmlFile</name>
<Style id="sh_ylw-pushpin">
<IconStyle>
<scale>1.3</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</
href>
</Icon>
<hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>
</IconStyle>
</Style>
<StyleMap id="msn_ylw-pushpin">
<Pair>
<key>normal</key>
<styleUrl>#sn_ylw-pushpin</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#sh_ylw-pushpin</styleUrl>
</Pair>
</StyleMap>
<Style id="sn_ylw-pushpin">
<IconStyle>
<scale>1.1</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</
href>
</Icon>
<hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>
</IconStyle>
</Style>
<Placemark>
<name>ITS</name>
<LookAt>
<longitude>66.46137378742228</longitude>
<latitude>40.37270407045041</latitude>
<altitude>0</altitude>
<range>66075.5686329598</range>
<tilt>85.08889962001605</tilt>
<heading>93.677212843942</heading>
<altitudeMode>relativeToGround</altitudeMode>
</LookAt>
<styleUrl>#msn_ylw-pushpin</styleUrl>
<Point>
<coordinates>65.79889965656227,40.38988543595632,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>


But how does I combine it to the regions code:

<Region id="ID">
<LatLonAltBox>
<north></north> <!-- required;
kml:angle90 -->
<south></south> <!-- required;
kml:angle90 -->
<east></east> <!-- required;
kml:angle180 -->
<west></west> <!-- required;
kml:angle180 -->
<minAltitude>0</minAltitude> <!-- float -->
<maxAltitude>0</maxAltitude> <!-- float -->
<altitudeMode>clampToGround</altitudeMode>
<!-- kml:altitudeModeEnum: clampToGround, relativeToGround, or
absolute -->
</LatLonAltBox>
<Lod>
<minLodPixels>0</minLodPixels> <!-- float -->
<maxLodPixels>-1</maxLodPixels> <!-- float -->
<minFadeExtent>0</minFadeExtent> <!-- float -->
<maxFadeExtent>0</maxFadeExtent> <!-- float -->
</Lod>
</Region>


If you could try to make just one working kml/kmz file with this, I
think I can figure it out and make some more placemarks by my own,,,

please help...

barryhunter [KML Guru]

unread,
Apr 19, 2008, 7:48:33 PM4/19/08
to KML Developer Support - Getting Started with KML
'Regions' work on areas, so you define a LatLonAltBox to define a
square of land (techincally it actully a 3D cube, but it easier to
visualise with a flat 2D square. The LOD then makes it so that the
LatLonAltBox is between minLodPixels and maxLodPixels pixels in size
when shown on screen.

How I work with this is make a artifical square, that extends a
certain degree difference from your points, and the just experiment to
find reasonable Lod values for the approximate altitude you interested
in.

Example region for your placemark, using +/- 0.1 degrees...

<Region>
<LatLonAltBox>
<north>40.489885</north>
<south>40.289885</south>
<east>65.898899</east>
<west>65.698899</west>
</LatLonAltBox>
<Lod>
<minLodPixels>45</minLodPixels>
<maxLodPixels>150</maxLodPixels>
</Lod>
</Region>

You can experiment with the two lod values to get it about right.



Marcus

unread,
Apr 20, 2008, 1:44:33 AM4/20/08
to KML Developer Support - Getting Started with KML
I appreciate your help.........Can you as the last thing guide me
about how I get the code below into Google Earth......Do I put the
code in a new notepad document...what do I save it as ?


hope you can help with that.....maybe yot know of a kmzfile that uses
the region code. Then I can just click and open it and see it in
action.

kind regards Marcus

Marcus

unread,
Apr 20, 2008, 3:43:23 AM4/20/08
to KML Developer Support - Getting Started with KML
hmmm I have tried and tried......I cant figure it out........I just
want a placemark to show up if you zoom in and are within 500 meters
from it...........im a newbee so you have to explain it for me very
simple.........The best way you could do it is to make a kml/kmz file
that has one placemark that only become visible within 500
meters....then I can open it in google earth and copy and open the
code in notepad and analyze the kmlcode from that....

Please.....can anyone help me with that.

Kind regards Marcus
> > You can experiment with the two lod values to get it about right.- Skjul tekst i anførselstegn -
>
> - Vis tekst i anførselstegn -

barryhunter [KML Guru]

unread,
Apr 20, 2008, 7:27:27 PM4/20/08
to KML Developer Support - Getting Started with KML
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
<Placemark>
<name>ITS</name>
<Point>
<coordinates>65.79889965656227,40.38988543595632,0</coordinates>
</Point>
<Region>
<LatLonAltBox>
<north>40.399885</north>
<south>40.379885</south>
<east>65.808899</east>
<west>65.788899</west>
</LatLonAltBox>
<Lod>
<minLodPixels>1800</minLodPixels>
<maxLodPixels>240000</maxLodPixels>
</Lod>
</Region>
</Placemark>
</kml>

You still might need to tweak the LOD numbers to your requirements -
you dont set an altitude level, so you have to approximate it (trail
and error is probably the only way)

You just open that in Notepad or similar, and select it all, Copy,
goto Google Earth, select 'Temporary places' and Paste. Delete it when
tested it, and repeat the process.

barryhunter [KML Guru]

unread,
Apr 20, 2008, 7:27:27 PM4/20/08
to KML Developer Support - Getting Started with KML
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
<Placemark>
<name>ITS</name>
<Point>
<coordinates>65.79889965656227,40.38988543595632,0</coordinates>
</Point>
<Region>
<LatLonAltBox>
<north>40.399885</north>
<south>40.379885</south>

Marcus

unread,
Apr 21, 2008, 3:14:51 AM4/21/08
to KML Developer Support - Getting Started with KML
Hello

Thankyou for your help. It works well.

My idea is to make a "tresurehunt" game, where my pupils get som clues
and then have to find the next placemark. When they find the placemark
- gets close enought to it, they can click on it and read the next
clue in the balloonn.
I think they will have a lot of fun this way and also will learn a
little about our earth that way.

Offcourse its possible to cheat...they can just click on the
placemarks in the places sidebar....but I have made it a little tricky
for them by putting the placemarks in a folder and set the folder to
not allowed to expand. (I dont think they are smart enough to change
that)

But my questian is now: How does I make this the easiest way. I have
to place placemarks around the world - maybe 30-40 placemarks....how
will you guide me to do this...do I add a placemark and then take the
code to a notepad document...edit it and so on og will you guide me to
take the above code and copy and paste it in many examples.....?? Im
also a littele confused about the coordinates settings....how do you
get all these numbers...I only gets 8 numbers..fx 55.125292........

If you were to place a placemark under the Eiffeltower in Paris,
France...and it has to work as your above example...how would you then
make it the easiest way......both coordinates and region/
LatLonAltBox numbers....how do I see the values for the region ???

Hope you can give a littele advise about that.

Kind regards
Marcus

ManoM

unread,
Apr 21, 2008, 7:26:37 PM4/21/08
to KML Developer Support - Getting Started with KML
Hi Marcus,

Check out this video for some good examples of how to create content:
http://www.youtube.com/watch?v=WeHnQESDr-8&feature=user

Mano
Reply all
Reply to author
Forward
0 new messages