Google
Official Google Earth Download Site

Google Earth Community System Reliability: HIGH

Members' Open Area >> Open Forum

Jump to first unread post. Pages: 1
Weelki
Tourist


Reged: 08/28/08
Posts: 6
Loc: UK
<address> tag in KML file in Google Maps
      #1225365 - 08/28/08 08:49 AM

Hello,

Completely noob question, I would be grateful for any help!

I have done an extensive search for this particular issue but I can't find any specific solutions.

I have a very simple KML file:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">

<Document>
<name> TEST MAP!!! </name>
<description>Work it</description>

<address>SG1 1AL</address>

</Document>
</kml>

I am trying to use "Import KML" in Google Maps (not Google Earth!!!) to display this UK postcode.

The title and description display properly but nothing appears on the map for the postcode that I have specified.

Any idea's on where I am going wrong?

Many thanks

--------------------
------
Visit White Crane Martial Arts
------


Post Extras: Print Post   Remind Me!   Report this Post  
tekgergedanModerator
Master Guide


Reged: 09/25/05
Posts: 8053
Loc: Turkey GMT+2
Re: <address> tag in KML file in Google Maps [Re: Weelki]
      #1225387 - 08/28/08 09:55 AM

I don't even know how to load a file to GMaps. But it should be

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">

<Document>
<Placemark>
<name> TEST MAP!!! </name>
<description>Work it</description>

<address>SG1 1AL</address>

</Placemark>
</Document>
</kml>

ie, <Placemark> is absent in your codes.

--------------------
...::: | | | Install 4.3 and be aware you can switch back | | | :::...
...::: | | | what you are is what you eat and what you think | | | :::...
...::: | | | if you want to get something, first look and ask for its very details | | | :::...


Post Extras: Print Post   Remind Me!   Report this Post  
Weelki
Tourist


Reged: 08/28/08
Posts: 6
Loc: UK
Re: <address> tag in KML file in Google Maps [Re: tekgergedan]
      #1225649 - 08/29/08 01:29 AM

Thanks for coming back to me Tekgergedan.

Have tried adding the <Placemark> tags, but they make no difference. Have also tried including the <address> tags inside <point> tags (not sure if it is the correct syntax?).

To load a kml file in Google maps, you need to go to the 'My maps' section when in maps.google.co.uk / maps.google.com

There is a hyperlink for 'Create New map'. This then gives you a further hyperlink 'Import', clicking on this brings up a box:

'Import KMLAdd map data from a KML, KMZ, or GeoRSS file to this map. This may take a few minutes depending on the speed of your internet connection. Maximum size: 10MB'

Then you upload your .kml file etc etc.

The <points> tag does work with co-ordinates, i.e. This bit of code does actually put a point on the map (interestingly the description and title don't get filled out, but I can live with that!):

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">

<Document>

<Style id="my_icon">
<IconStyle><Icon>
<href>root://icons/palette-4.png</href><y>128</y><w>32</w><h>32</h>
</Icon></IconStyle>
</Style>


<Placemark>
<name> TEST MAP 2!!!</name>
<description>Work it</description>

<styleUrl>#my_icon</styleUrl>

<name>Test point</name>

<Point>
<coordinates>-0.195,51.911</coordinates>
</Point>

</Placemark>
</Document>
</kml>


However, I have a list of postcodes (not ordnance survey reference points) that I want to add to a Google Map, the <address> tag if it worked properly would be ideal for me.

Are you able to test any of the above in Google Maps?

Do you know where I am going wrong?

Once again thanks for the help.

--------------------
------
Visit White Crane Martial Arts
------


Post Extras: Print Post   Remind Me!   Report this Post  
tekgergedanModerator
Master Guide


Reged: 09/25/05
Posts: 8053
Loc: Turkey GMT+2
Re: <address> tag in KML file in Google Maps [Re: Weelki]
      #1226648 - 08/31/08 03:57 AM

Thanks. I saved the codes in your reply and I was able to load it even there are two <name>s:
http://maps.google.com/maps/ms?ie=UTF8&a...bf3872da509dd15

<Point> and <address> are alternatives to each other. <Point> overrides <address>.

--------------------
...::: | | | Install 4.3 and be aware you can switch back | | | :::...
...::: | | | what you are is what you eat and what you think | | | :::...
...::: | | | if you want to get something, first look and ask for its very details | | | :::...


Post Extras: Print Post   Remind Me!   Report this Post  
Weelki
Tourist


Reged: 08/28/08
Posts: 6
Loc: UK
Re: <address> tag in KML file in Google Maps [Re: tekgergedan]
      #1227671 - 09/02/08 04:37 AM

Once again thank you for the help Tekgergedan!

You are right about the two name tags... anyway I've cleaned my code up (finally have some basic grasp of kml!). Once again see below, it creates the map but I can't see the two points I am trying to add

This is the link to the map I just created using the code below: my creation...

Code:
 <?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">

<Document>
<name>The Final Test...</name>
<description>Well this should work, maybe I need some patience...</description>

<Style id="free_icon">
<IconStyle><Icon>
<href>root://icons/palette-4.png</href><x>32</x><y>32</y><w>32</w><h>32</h>
</Icon></IconStyle>
</Style>

<Style id="deployto_icon">
<IconStyle><Icon>
<href>http://maps.google.com/mapfiles/kml/pal4/icon57.png</href>
</Icon></IconStyle>
</Style>


<Placemark>

<name>Stevenage office</name>
<description>Tiscali Stevenage</description>
<address>SG1 1AL</address>

<styleUrl>#free_icon</styleUrl>

</Placemark>

<Placemark>

<name>Milton Keyness office</name>
<description>Tiscali Milton Keynes</description>
<address>MK14 6LB</address>

<styleUrl>#deployto_icon</styleUrl>

</Placemark>

</Document>
</kml>



I can see from the link in _your_ previous reply, my code must somehow be working, as it created a point! So could it be Google taking time to resolve the postcode to the map?

Well I left it 10 minutes and came back, still can't see 'em! Please could you do two things for me?

1) If you follow the link in this message, can you see any points in the map?

2) Once again if you copy and save the code above, does it create the points properly for you?


In any respect I gave up in the end!!! using a combination of Perl and Excel lookup's I resolved the postcodes to latitude and longitude and used this syntax instead:

Code:

<Placemark>
<name>ACOCKS GREEN Postcode: B27 6DN</name>
<Point>
<coordinates>-1.822,52.445</coordinates>
</Point>
<styleUrl>#free_icon</styleUrl>
</Placemark>



However, if you can shed any light on points 1 and 2 I would be grateful! I wonder if it could be a google.co.uk / google.com thing ?

*shrugs*

Thanks

Jos

--------------------
------
Visit White Crane Martial Arts
------


Post Extras: Print Post   Remind Me!   Report this Post  
tekgergedanModerator
Master Guide


Reged: 09/25/05
Posts: 8053
Loc: Turkey GMT+2
Re: <address> tag in KML file in Google Maps [Re: Weelki]
      #1227742 - 09/02/08 07:15 AM

1.
Yes. One placemark named "Bada bing"

2.
No. I tried myself with addresses but doesn't work. The previous one had worked in my tests because it was <Point> and not <address>.

Check this:
http://groups.google.com/group/Google-Ma...a32abc9a71f10d0

though the kml documentation says the reverse (this confuses ):
http://code.google.com/apis/kml/documentation/kmlreference.html#address

I think you better create your files via Google Earth. It loads your file. Then, it converts the addresses into coordinates. To do that:

- copy your text of codes
- r-click TemporaryPlaces and Paste
- r-click your document that appears
- save it as a kml file
- import to MyMaps

That is healthier for your styles which will be optimized, as well.

--------------------
...::: | | | Install 4.3 and be aware you can switch back | | | :::...
...::: | | | what you are is what you eat and what you think | | | :::...
...::: | | | if you want to get something, first look and ask for its very details | | | :::...


Post Extras: Print Post   Remind Me!   Report this Post  
Weelki
Tourist


Reged: 08/28/08
Posts: 6
Loc: UK
Re: <address> tag in KML file in Google Maps [Re: tekgergedan]
      #1228166 - 09/03/08 04:11 AM

Will give that a try, thanks for all the help, much appreciated!

--------------------
------
Visit White Crane Martial Arts
------


Post Extras: Print Post   Remind Me!   Report this Post  
Pages: 1




Extra information
1 registered and 7 anonymous users are browsing this forum.

Moderator:  Hill, Jumble, Kempster, mcshea98, jeffryv, dulce, esterrett, NormB, Frank_McVey, BeadieJay, TheLedge, Cyclonic, no_stranger, LuciaM, tekgergedan, Noisette, danescombe, Michal_Drewniak, mutex, marinerfan, Delta102, bebop, MarkAubin 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 973

Rate this topic

Jump to

earth.google.com    bbs.keyhole.com

*
UBB.threads™ 6.5.1.1