Subscribe to this thread
Home - General / All posts - KML Export
pjrs2 post(s)
#13-Dec-18 21:29

Many moons - or more truthfully, years ago - the KML file for the attached was created using M8. It continues to work happily with Google Maps and one day, maybe Google Earth will have a new browser API so we can get back to where we were with GE. I can't remember precisely how I created it - the M8 documentation doesn't indicate that several fields could be included for the marker information, but it could through accidental experiment.

With the KML export from M9, I am currently finding a colour change (fixable in <polystyle>), and by deleting all of the first folder that is created I can make a file that provides that displays the <description> field. In Google Earth, the data for the other fields (e.g.<Area> and <Usage> are all present, thus they are being exported. Displaying it by a click on the area is not however proving possible and my efforts to replicate the equivalent to the jpg for the neighbouring parish are proving frustrating.

I am sure that the issue is really to do with the changed structure used by Google for KML, and there are doubtless good reasons for it development, but if any M9 user have any extra routines they follow when exporting KML from M9, I'd be pleased to hear.

Learning M9 when in the upper age range is proving slow but well worth it - I am gradually making the transfer.

Attachments:
2018-12-13.jpg

dchall8
530 post(s)
#14-Dec-18 14:29

I can help with understanding M8 export to KML. I create an update for our county every week or whenever someone asks for something special. In the case of the attached image, the property owner's association asked for the GE map.

The bubble contents is created in M8 with a script developed with the help of people here and some GE users. In the image there is one bubble for a parcel. The code that generated that bubble looks like this...

<head><style>body {background-color: linen;}p {color: maroon;}</style></head><hr /><p><strong>Owner:</strong><br />ALANIS EDWARD D</p> <hr /><p><strong>Owner&#39;s Address:</strong><br /> 2420 MC CULLOUGH #300<br /> SAN ANTONIO, TX</p> <hr /><p><strong>Legal Description:</strong><br />GOAT HILL ESTATES 2 LT 10 ***MEDINA LAKE***2.86 ACRES</p> <hr /><p><strong>Situs Address:</strong><br />0 JOHNSON RD</p> <hr /><p><strong>Driving Directions:</strong><br /><p>Click <a href="https://maps.google.com/maps?saddr=29.7264041+-99.0729435&daddr=29.5942569459406+-98.9700891132301">HERE</a> for directions from <strong>BANDERA</strong>.</p> <p>Click <a href="https://maps.google.com/maps?saddr=29.424565+-98.494713&daddr=29.5942569459406+-98.9700891132301">HERE</a> for directions from <strong>SAN ANTONIO</strong>.</p> <hr /><p>Click <a href="http://propaccess.banderaproptax.org/clientdb/Property.aspx?cid=1&prop_id=164242">HERE</a> to find this parcel at the Bandera County Appraisal website.</p> <hr />Courtesy of Bandera Central Appraisal District

The script which generated that code looks like this...

Function computeKMLDesc

'This function sets up an informational field (called KMLExportText) to be exported with a KML file. 

'After recalculating the column, the field contains information from the BanCAD database formatted 

'with HTML and CSS code for formatting in Google Earth. 

'The result is a text balloon in Google Earth. 

'The balloon appears when the map parcel is clicked and displays information from the database. 

'Thank you to Gustavo Palminha of the Georeference.org forum

'for his help to create this code.  5/6/2015

    dim KMLContent

'HTML Header section used to set up CSS formatting.

'This sets the background color to 'linen' and the text color for p style elements to maroon. 

'Text that is not designated with the p style will revert to black color. 

    KMLContent = KMLContent & "<head><style>body {background-color: linen;}"

    KMLContent = KMLContent & "p {color: maroon;}</style></head>"

'Balloon text formatting in HTML: 

'There is a horizontal line separating each part of the balloon, and 

'the title of the section is bold. 

'The following two 'if' statements prevent creating text balloons for 

'parcels with zero or missing property ID numbers. 

'The purpose is to keep the size of the exported file as small as possible to zip and attach to email.

if Record.Data("Prop_ID") > 0 then

if Record.Data("prop_id 2") <> "" then

'KMLContent = KMLContent & "<hr />" & vbNewLine

'KMLContent = KMLContent & "<p>Click <a href=""http://propaccess.banderaproptax.org/clientdb/Property.aspx?prop_id=" & Record.Data("Prop_ID")""> HERE</a> to find this parcel at the Bandera County Appraisal website.</p>" & vbNewLine

'KMLContent = KMLContent & "<p>Click <a href=" & "&quot;http://propaccess.banderaproptax.org/clientdb/Property.aspx?prop_id=" & Record.Data("Prop_ID") & "&quot;> HERE</a> to find this parcel at the Bandera County Appraisal website.</p>" & vbNewLine

' This works!! KMLContent = KMLContent & "<p>Click <a href=" & Chr(34) & "http://propaccess.banderaproptax.org/clientdb/Property.aspx?cid=1&prop_id=" & Record.Data("Prop_ID") & Chr(34) & ">HERE</a> to find this parcel at the Bandera County Appraisal website.</p>" & vbNewLine

 

'Format Owner's name 

    KMLContent = KMLContent & "<hr />" & "<p><strong>Owner:</strong><br />" & Record.Data("file_as_name") & "</p>" & vbNewLine

'Format Owner's address

    KMLContent = KMLContent & "<hr />" & "<p><strong>Owner&#39;s Address:</strong><br />" & vbNewLine

 

    If Record.Data("addr_line1") <> "" then

        KMLContent = KMLContent & "<hr />" & Record.Data("addr_line1") & "<br />" & vbNewLine

    End if

    If Record.Data("addr_line2") <> "" then

        KMLContent = KMLContent & Record.Data("addr_line2") & "<br />" & vbNewLine

    End if

    If Record.Data("addr_line3") <> "" then

        KMLContent = KMLContent & Record.Data("addr_line3") & "<br />" & vbNewLine

    End if

    KMLContent = KMLContent & Record.Data("addr_city") & ", " & Record.Data("addr_state") & "</p>" & vbNewLine

'Format Legal Description

    KMLContent = KMLContent & "<hr />" & "<p><strong>Legal Description:</strong><br />" & Record.Data("legal_desc") & "</p>" & vbNewLine

 

'Format Situs Address

    KMLContent = KMLContent & "<hr />" & "<p><strong>Situs Address:</strong><br />" & Record.Data("situs_num") & " " & Record.Data("situs_street") & "</p>" & vbNewLine

'Format Driving Directions

    KMLContent = KMLContent & "<hr />" & "<p><strong>Driving Directions:</strong><br />" & "<p>Click <a href=" & Chr(34) & "https://maps.google.com/maps?saddr=29.7264041+-99.0729435&daddr=" & Record.Data("Latitude (I)") & Chr(43) & Record.Data("Longitude (I)") & Chr(34) & ">HERE</a> for directions from <strong>BANDERA</strong>.</p>" & vbNewLine

    KMLContent = KMLContent & "<p>Click <a href=" & Chr(34) & "https://maps.google.com/maps?saddr=29.424565+-98.494713&daddr=" & Record.Data("Latitude (I)") & Chr(43) & Record.Data("Longitude (I)") & Chr(34) & ">HERE</a> for directions from <strong>SAN ANTONIO</strong>.</p>" & vbNewLine

'Format balloon footer

    KMLContent = KMLContent & "<hr />" & "<p>Click <a href=" & Chr(34) & "http://propaccess.banderaproptax.org/clientdb/Property.aspx?cid=1&prop_id=" & Record.Data("Prop_ID") & Chr(34) & ">HERE</a> to find this parcel at the Bandera County Appraisal website.</p>" & vbNewLine

    KMLContent = KMLContent & "<hr />" & "Courtesy of Bandera Central Appraisal District" & vbNewLine

    computeKMLDesc = KMLContent ' Record.Data("Column")

end if

end if

End Function

dchall8
530 post(s)
#14-Dec-18 15:06

Now that I see that onscreen, I'm not sure it is all that helpful. At least it's out there if someone wants to dig into it. Basically the script picks data from our office database using the property id number (PID) to collect it into each record. By refreshing the field, the script updates the records according to the latest information in the database.

When I export a drawing from M8, I set the export dialog parameters as shown in the attached image.

Also I forgot to attach the GE Bubble image to the previous post, so I'm attaching it here.

As for M9, I have looked at the KML export and don't see the ability to control the content of the export file. My patience with the development of M9 has been rewarded many times, so I'm thinking positive about the future of the KML interface. I don't expect it to be less robust than M8.

Attachments:
GE Bubble - Orig in M8.jpg
GE Export Dialog Parameters.jpg

dchall8
530 post(s)
#14-Dec-18 15:18

One more thing that people may notice in my image is the logo at the bottom of the screen. That is also a KML file with the following code.

<?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"

xmlns:kml="http://www.opengis.net/kml/2.2"

xmlns:atom="http://www.w3.org/2005/Atom">

<Folder>

<name>Parcel Source</name>

<ScreenOverlay>

<name>Source</name>

<Icon>

<href>file:////PACSSERVER/Users Shared Folders/Google Earth Overlay/Central Appraisal Dist Logo.png</href>

</Icon>

<overlayXY x="0" y=".001" xunits="fraction" yunits="fraction"/>

<screenXY x="0" y=".001" xunits="fraction" yunits="fraction"/>

<rotationXY x="0" y="0" xunits="fraction" yunits="fraction"/>

<size x="0" y="0" xunits="fraction" yunits="fraction"/>

</ScreenOverlay>

</Folder>

</kml>

The text is an image file in the PNG format. The file is located on our server as shown in the code. I am providing this as possible further insight into what can be done with KML.

The only other 'trick' I have with KML is to continually update the file within my office. Every time I update the file I give it the same name so that the code can auto-refresh on the user's computers every 2700 seconds. I'm still experimenting with the refresh rate. That code looks like this...

<?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" 

xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">

<NetworkLink>

    <name>Bandera Parcels</name>

        <description><![CDATA[Bandera appraisal district parcels will update automatically several times per month.]]></description>

    <open>1</open>

    <Link>

        <href>file:////PACSSERVER/Users Shared Folders/Google Earth Overlay/BanderaGEParcels.kmz</href>

        <refreshMode>onInterval</refreshMode>

        <refreshInterval>2700</refreshInterval>

    </Link>

</NetworkLink>

</kml>

pjrs2 post(s)
#14-Dec-18 20:09

Very many thanks. Glad you concur that it isn't there yet in M9 - I have missed some things but found them eventually - but like you I'm confident it will develop in due course. I'll have a dig into the code with a bit of help from a colleague.

Manifold User Community Use Agreement Copyright (C) 2007-2017 Manifold Software Limited. All rights reserved.