Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to parse kml with gx:LatLonQuad node #650

Closed
acespring78 opened this issue Mar 6, 2020 · 8 comments · May be fixed by #1396
Closed

Unable to parse kml with gx:LatLonQuad node #650

acespring78 opened this issue Mar 6, 2020 · 8 comments · May be fixed by #1396
Assignees
Labels
priority: p4 An issue that should be addressed eventually. stale type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@acespring78
Copy link

Hello. I have a kml file that uses the xmlns:gx="http://www.google.com/kml/ext/2.2" namespace and uses the gx:LatLonQuad node with the coordinates defining the lat/lon coordinates of the box, instead of LatLonBox

When loading this kml file to KmlLayer, it throws an exception because I believe it doesn't read the gx:LatLonQuad node, but instead is looking for LatLonBox to parse the north, south, east, and west nodes. The following exception trace is as follows:

java.lang.NullPointerException: Attempt to invoke virtual method 'double java.lang.Double.doubleValue()' on a null object reference
        at com.google.maps.android.data.kml.KmlFeatureParser.createLatLngBounds(KmlFeatureParser.java:452)
        at com.google.maps.android.data.kml.KmlFeatureParser.createGroundOverlay(KmlFeatureParser.java:150)
        at com.google.maps.android.data.kml.KmlContainerParser.assignPropertiesToContainer(KmlContainerParser.java:113)
        at com.google.maps.android.data.kml.KmlContainerParser.createContainer(KmlContainerParser.java:67)
        at com.google.maps.android.data.kml.KmlParser.parseKml(KmlParser.java:89)
        at com.google.maps.android.data.kml.KmlLayer.parseKml(KmlLayer.java:189)
        at com.google.maps.android.data.kml.KmlLayer.<init>(KmlLayer.java:156)
        at com.google.maps.android.data.kml.KmlLayer.<init>(KmlLayer.java:79)

This kml file works when loading to Google Earth by the way.

Is there plans to support gx:LatLonQuad in later releases?

@acespring78 acespring78 added triage me I really want to be triaged. type: question Request for information or clarification. Not an issue. labels Mar 6, 2020
@arriolac
Copy link
Contributor

arriolac commented Mar 6, 2020

Thanks for reporting. This was not something we were planning on adding, however, contributions are certainly welcome to get this working.

@arriolac arriolac added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed type: question Request for information or clarification. Not an issue. triage me I really want to be triaged. labels Mar 6, 2020
@arriolac
Copy link
Contributor

arriolac commented Mar 6, 2020

Would you mind sharing an example KML file / snippet in case someone wants to take this on?

@acespring78
Copy link
Author

Here's a sample. The icon field can be replaced with any image file, but the key item here is the gx:LatLonQuad node and the absence of the LatLonBox

<?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>HelloSanDiego</name>
		<description>Simple overlay bitmap in San Diego</description>
		<GroundOverlay>
			<name>Simple overlay bitmap in San Diego</name>
			<LookAt>
				<longitude>-117.16818999089882</longitude>
				<latitude>32.71496098150528</latitude>
				<altitude>5.073048377858894</altitude>
				<heading>4.842019007966769E-10</heading>
				<tilt>0.0</tilt>
				<range>0.0</range>
				<altitudeMode>relativeToGround</altitudeMode>
			</LookAt>
			<Icon>
				<href>files/image.png</href>
			</Icon>
			<gx:LatLonQuad>
				<coordinates>-117.16818999089882,32.71496098150528,5.073048377858894 -117.1675446751236,32.71496097984488,5.073048377858894 -117.1675446751236,32.7155966911221,5.073048377858894 -117.16818999089882,32.715596692782505,5.073048377858894</coordinates>
			</gx:LatLonQuad>
		</GroundOverlay>
	</Document>
</kml>

@arriolac arriolac added the priority: p4 An issue that should be addressed eventually. label May 5, 2020
@stale
Copy link

stale bot commented Sep 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. Please comment here if it is still valid so that we can reprioritize. Thank you!

@stale stale bot added the stale label Sep 2, 2020
@acespring78
Copy link
Author

Hi, do we know if there are still plans to support gx:LatLonQuad in the near future?

@stale stale bot removed the stale label Sep 2, 2020
@stale
Copy link

stale bot commented Dec 31, 2020

This issue has been automatically marked as stale because it has not had recent activity. Please comment here if it is still valid so that we can reprioritize. Thank you!

@stale stale bot added the stale label Dec 31, 2020
@stale
Copy link

stale bot commented Jul 1, 2021

Closing this. Please reopen if you believe it should be addressed. Thank you for your contribution.

@noberasco
Copy link
Contributor

noberasco commented Oct 3, 2024

Old ticket, but it has recently become relevant to one of our workflows (offline cartography), so I have raised a PR to fix this...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p4 An issue that should be addressed eventually. stale type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants