Different KML File Formats From Google Earth - kml

I'm creating KML files from Google Earth Polygons. However, the created KML files will appear in two different formats. One type, when appearing in Google Earth, will appear as a link. Another will appear as plain text.
The KML that appears as a link has format like:
<?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">
<Placemark>
<name>GHG</name>
<ExtendedData>
<Data name="stroke">
<value>#555555</value>
</Data>
<Data name="stroke-width">
<value>2</value>
</Data>
<Data name="stroke-opacity">
<value>1</value>
</Data>
<Data name="fill">
<value>#555555</value>
</Data>
<Data name="fill-opacity">
<value>0.5</value>
</Data>
<Data name="Code">
<value>GHG</value>
</Data>
</ExtendedData>
<Polygon>
<outerBoundaryIs>
<LinearRing>
<coordinates>
35.54397940635681,33.17158011534832,0 35.54336249828339,33.16975707112739,0 35.54345905780792,33.16957296849484,0 35.54412424564362,33.17153521323674,0 35.54397940635681,33.17158011534832,0
</coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</Placemark>
</kml>
The kml format of the plot that appears in plain text looks something like:
?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">
<Document>
<name>BFB.kml</name>
<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">
<LineStyle>
<color>99ffffff</color>
</LineStyle>
</Style>
<Style id="sh_ylw-pushpin">
<IconStyle>
<scale>1.2</scale>
</IconStyle>
<LineStyle>
<color>99ffffff</color>
</LineStyle>
</Style>
<Placemark>
<name>BFB</name>
<visibility>0</visibility>
<styleUrl>#msn_ylw-pushpin</styleUrl>
<Polygon>
<tessellate>1</tessellate>
<outerBoundaryIs>
<LinearRing>
<coordinates>
35.42654700219181,32.70002475720476,0 35.43086711604241,32.70023107874993,0 35.43106772797857,32.7007191672116,0 35.42656173211241,32.70057776992705,0 35.42654700219181,32.70002475720476,0
</coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</Placemark>
</Document>
</kml>
I need to parse these kml files and it is a much easier task when the format is standardized. I'd much prefer the first (GHG) format.

Related

wsimport bindings namespace error

I'm trying to change the package name space for some namespaces because they have objects that collide.
Here is the wsdl:
<wsdl:definitions
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://tempuri.org/"
<wsdl:types>
<xsd:schema targetNamespace="http://tempuri.org/Imports">
<xsd:import schemaLocation="https://localhost/DS/Search.svc?xsd=xsd0" namespace="http://tempuri.org/"/>
<xsd:import schemaLocation="https://localhost/DS/Search.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
</xsd:schema>
</wsdl:types>
</wsdl:definitions>
Here are the bindings:
<?xml version="1.0" encoding="UTF-8"?>
<jaxb:bindings xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
jaxb:version="2.0"
wsdlLocation="https://localhost/DS/Search.svc?wsdl">
<jaxb:bindings node="//wsdl:definitions/wsdl:types/xsd:schema/xsd:import[#namespace='http://tempuri.org/']">
<jaxb:schemaBindings>
<jaxb:package name="directoryservice"/>
</jaxb:schemaBindings>
</jaxb:bindings>
<jaxb:bindings node="//wsdl:definitions/wsdl:types/xsd:schema/xsd:import[#namespace='http://localhost.datacontract.org/2004/07/Search.Models.SearchAPI']">
<jaxb:schemaBindings>
<jaxb:package name="directoryservice.model"/>
</jaxb:schemaBindings>
</jaxb:bindings>
</jaxb:bindings>
When I run wsimport with the -b option I get this error
[ERROR] XPath evaluation of "//wsdl:definitions/wsdl:types/xsd:schema/xsd:import[#namespace='http://tempuri.org/']" results in empty target node
line 7 of file:service-bindings.xml
I get the error for both bindings..
Am I missing something with the definition of the bindings?
I found a way round this issue by using the global binding. The binding will create the serivce ObjectFactory but not the model pojos.
<?xml version="1.0" encoding="UTF-8"?>
<jaxb:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
jaxb:version="2.0">
<jaxb:globalBindings generateElementProperty="false"/>
</jaxb:bindings>

Spring integration Splunk: Failed to read schema document

I am getting the below error while running Splunk integration spring adapter.
org.xml.sax.SAXParseException; lineNumber: 16; columnNumber: 212;
schema_reference.4: Failed to read schema document
'http://www.springframework.org/schema/integration/splunk/spring-integration-splunk.xsd',
because 1) could not find the document; 2) the document could not be
read; 3) the root element of the document is not .
I tried to search http://www.springframework.org/schema/integration/splunk/ but it looks like it is not reachable. Has Spring deprecated the support of Splunk?
Configuration:
Beans.xml looks like:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-splunk="http://www.springframework.org/schema/integration/splunk"
xmlns:stream="http://www.springframework.org/schema/integration/stream"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/integration/stream http://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd
http://www.springframework.org/schema/integration/splunk http://www.springframework.org/schema/integration/splunk/spring-integration-splunk.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.4.RELEASE.xsd">
<import resource="SplunkInboundChannelAdapterCommon-context.xml"/>
<int-splunk:inbound-channel-adapter id="splunkInboundChannelAdapter"
auto-startup="true" search="sourcetype=SplunkRabbitMQ_messaging | spath input=msg_body | where '3' > 0" splunk-server-ref="splunkServer" channel="inputFromSplunk" mode="realtime" initEarliestTime="-1d">
<int:poller fixed-rate="5" time-unit="SECONDS"/>
</int-splunk:inbound-channel-adapter>
</beans>
SplunkCommon-context.xml looks like:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-splunk="http://www.springframework.org/schema/integration/splunk"
xmlns:stream="http://www.springframework.org/schema/integration/stream"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/integration/stream
http://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd
http://www.springframework.org/schema/integration/splunk
http://www.springframework.org/schema/integration/splunk/spring-integration-splunk.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.4.RELEASE.xsd">
<context:component-scan base-package="org.springframework.integration.splunk"></context:component-scan>
<bean id="conversionService" class="org.springframework.context.support.ConversionServiceFactoryBean"/>
<int-splunk:server id="splunkServer" host="xxx.xx.xx.xxx" port="8089" userName="admin" password="ferggegtg" owner="admin"/>
</beans>
SplunkInboundChannelAdapterCommon-context.xml looks like:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-splunk="http://www.springframework.org/schema/integration/splunk"
xmlns:stream="http://www.springframework.org/schema/integration/stream"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/integration/stream http://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd
http://www.springframework.org/schema/integration/splunk http://www.springframework.org/schema/integration/splunk/spring-integration-splunk.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.4.RELEASE.xsd">
<import resource="SplunkCommon-context.xml"/>
<context:component-scan base-package="org.springframework.integration.samples.splunk"></context:component-scan>
<int:channel id="inputFromSplunk">
</int:channel>
<int:service-activator input-channel="inputFromSplunk" ref="splunkDataHandler"></int:service-activator>
<!-- <stream:stdout-channel-adapter id="stdout" channel="inputFromSplunk" append-newline="true"/> -->
</beans>
The schema is not online, spring resolves it from the class path in the jar from META-INF/spring-schemas in the jar - if this is a runtime error, it appears you don't have the jar on the class path. If this error is just in an IDE (and not at runtime) you are using one that is not spring-aware - you can ignore the error in an IDE, use a spring-aware IDE, or use the IDE features to manually add the schema mappings.

Google Earth KML clampToGround allows subterranean lines

I am creating a Google Earth KML, and having trouble. My LineString won't stay above ground. I'm using clampToGround as instructed in the documentation, I think.
Why doesn't clampToGround keep the LineString above the ground here? If I'm reading the documentation right, it really should stay above the ground. I tried to work around it by going relativeToGround and giving it a little altitude, but that didn't work either. I just want to make sure the line is visible above ground for its whole length.
Salient portions of the KML:
<Placemark>
<name>Untitled Path</name>
<styleUrl>#m_ylw-pushpin</styleUrl>
<LineString>
<extrude>1</extrude>
<tessellate>1</tessellate>
<altitudeMode>clampToGround</altitudeMode>
<coordinates>
86.66797376467392,48.79933074280933,100 87.52400441880934,49.14303840409646,100
</coordinates>
</LineString>
</Placemark>
<Placemark>
<name>Untitled Path2</name>
<styleUrl>#m_ylw-pushpin</styleUrl>
<LineString>
<extrude>1</extrude>
<tessellate>1</tessellate>
<altitudeMode>clampToGround</altitudeMode>
<coordinates>
86.66797376467392,48.81933074280933,10 87.52400441880934,49.15303840409646,10
</coordinates>
</LineString>
</Placemark>
<Placemark>
<name>Untitled Path3</name>
<styleUrl>#m_ylw-pushpin</styleUrl>
<LineString>
<extrude>1</extrude>
<tessellate>1</tessellate>
<altitudeMode>relativeToGround</altitudeMode>
<coordinates>
86.66797376467392,48.91933074280933,10 87.52400441880934,49.25303840409646,10
</coordinates>
</LineString>
</Placemark>
The more I zoom in, the more gets occluded but the ground. How do I stop this?
I can still cause this to happen, even if drawing when very zoomed in:
Here's the KML:
<?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">
<Document>
<name>aaaa.kml</name>
<Style id="s_ylw-pushpin_hl">
<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>
<Style id="s_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>
<StyleMap id="m_ylw-pushpin">
<Pair>
<key>normal</key>
<styleUrl>#s_ylw-pushpin</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#s_ylw-pushpin_hl</styleUrl>
</Pair>
</StyleMap>
<Placemark>
<name>Untitled Path</name>
<styleUrl>#m_ylw-pushpin</styleUrl>
<LineString>
<tessellate>1</tessellate>
<coordinates>
-110.8533929259622,43.78725268338503,0 -110.8487894073726,43.78768726798314,0
</coordinates>
</LineString>
</Placemark>
</Document>
</kml>

KML Balloon will not automatically open

From what I've read to have a placemark balloon automatically open (without the need to click on it) you simply put <open>1</open> under the <placemark> tag.
I've also seen the <open> tag placed other places such as under the <document> tag but no matter where I place it the balloon never opens up by itself.
Here's the file I'm using (I placed the <open> tag in three different places hoping it would work):
<?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" xmlns:location="http://blah.com">
<Document>
<name>RSSToKml</name>
<open>1</open>
<StyleMap id="m_ylw-pushpin">
<Pair>
<key>normal</key>
<styleUrl>#s_ylw-pushpin</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#s_ylw-pushpin_hl0</styleUrl>
</Pair>
</StyleMap>
<Style id="s_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>
<Style id="s_ylw-pushpin_hl0">
<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>
<Placemark>
<name>A name</name>
<open>1</open>
<description>A description</description>
<LookAt>
<longitude>-73.99736287597681</longitude>
<latitude>40.71745136763278</latitude>
<altitude>0</altitude>
<heading>-46.51707308500568</heading>
<tilt>5.83698745180558</tilt>
<range>7808.551256710743</range>
<gx:altitudeMode>relativeToSeaFloor</gx:altitudeMode>
</LookAt>
<styleUrl>#m_ylw-pushpin</styleUrl>
<Point>
<gx:drawOrder>1</gx:drawOrder>
<coordinates>-73.9994479424963,40.71617147826365,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>
here's the tame plate of automatically balloon visibility, i hope it'll:
<?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">
<Placemark>
<name>automatically balloon </name>
<description>
Located in Paris, France.
This description balloon opens
when the Placemark is loaded.
</description>
<gx:balloonVisibility>1</gx:balloonVisibility>
<Point>
<coordinates>57.0833,30.2833,0</coordinates>
</Point>
</Placemark>
</kml>

I am struggling with resolving this resource error in xml

I have been struggling with this error for 2 days now and i am at wits end.
building this project in eclipse.according to the sdk this png does not need to be imported. i imported into my drawables anyway after this error generated to no avail.
is anybody willing to point me in the right direction here?
Error: No resource found that matches the given name (at 'icon' with value '#android.drawable/ic_menu_add').
W/ResourceType( 1020): Bad XML block: header size 62 or total size 9767704 is larger than data size 0
//*list_menu.xml
<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="#+id/menu_insert"
android:icon="#android.drawable/ic_menu_add"
android:title="#string/menu_insert"
/>
</menu>
//*strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">Hello World, ReminderListActivity!</string>
<string name="app_name">Task Reminder</string>
<string name="no_reminders">No Reminders Yet</string>
<string name="title">Title</string>
<string name="body">Body</string>
<string name="date">Date</string>
<string name="time">Time</string>
<string name="confirm">Confirm</string>
<string name="menu_insert">Add Reminder</string>
</resources>
//*AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dummies.android.taskreminder"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<application android:icon="#drawable/icon"
android:label="#string/app_name" android:debuggable="true">
<activity android:name=".ReminderListActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".ReminderEditActivity"
android:label="#string/app_name"/>
</application>
</manifest>
Try changing
android:icon="#android.drawable/ic_menu_add"
to
android:icon="#android:drawable/ic_menu_add"
I believe you need a : not a .

Resources