Giter Site home page Giter Site logo

urbancamo / javaapiforkml Goto Github PK

View Code? Open in Web Editor NEW
137.0 137.0 75.0 1 MB

The objective of the Java API for KML is to provide Java interfaces for easy access to KML (Keyhole Markup Language) data.

Home Page: https://github.com/urbancamo/javaapiforkml/wiki

License: Other

Perl 0.35% Java 99.65%

javaapiforkml's People

Contributors

dependabot[bot] avatar gitterrost4 avatar holycowmp3 avatar jlleitschuh avatar klemensz avatar laubfall avatar mischah avatar neilireson avatar srirammln avatar tech-consortium avatar twisterrob avatar unterstein avatar urbancamo avatar zigliouk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

javaapiforkml's Issues

Defining GroundOverlay using LatLonQuad

Hi guys,
I understand the project is currently changing hands, but I have a question and would greatly appreciate some help.

I am using JavaAPIForKML as a bridge between systems and at some point I need to have GroundOverlays defined with LatLonQuad.

Apparently once cannot create an overlay with LatLonQuad (LatLonBox is required), but if I convert LatLonBox to LatLonQuad in Gooogle Earth, would JavaAPIForKML be able to read the converted KML ?

Many thanks for your help,
JM

Re-publish after move

Re-engineer the pom.xml file to support release of repo now that it has been moved.

JAK creating malformed KML

The KML generated by JAK is malformed in Schema validation with ogckml22.xsd due to refreshInterval, viewRefreshTime and viewBoundScale all three set to 0.0 by default in element. This issue is reported only for under .
All three variables are from de.micromata.opengis.kml.v_2_2_0.Icon Java class.
Analysed the Icon class and found the issue was due to declaration of refreshInterval, viewRefreshTime and viewBoundScale all as primitive double.
Changing the data type from primitive to Double wrapper fixes the issue but not sure on other impacted areas. Performed a call hierarchy on these three getters and setters and there are no impact in other classes except Icon, example and JUnit tests.
Please validate my findings and will be great if a new code is released with this fix.
KML Fragment:

<Style id="pushpin"> 0.0 0.0 http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png 0.0 0.0 0.0 </Style>

Failed logging during maven build

log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
log4j:ERROR [java.net.URLClassLoader@759fad4] whereas object of type
log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by [org.jvnet.jaxb2.maven2.ParentFirstClassLoader@77307458].
log4j:ERROR Could not instantiate appender named "stdout".

Handle to FileOutputstream not closed in Kml.marshal

It seems that it occurs in Kml.marshal(File ..) impl :

/**
* Java to KML
* The object graph is marshalled to a File object.
* The object is not saved as a zipped .kmz file.
* @see marshalKmz(String, Kml...)
*
*/
public boolean marshal(final File filename)
throws FileNotFoundException
{
OutputStream out = new FileOutputStream(filename);
return this.marshal(out);
}

Help with maintainance

Micromata can’t maintain the project actively. But we would love to find someone who is willing to take that over even if this person is only reviewing and merging PRs.

Please ping @micromata/developers in case your are interested.

Thanks in advance 😘

Support for JakartaEE 9

Are there plans to release support for JakartaEE 9 now that you have moved the project to Github?

Decouple from glassfish

Currently, the glassfish JAXB implementation is included as dependency while 99% of the project only depends on jakarta.
Only the Kml class itself uses it for a beautifier feature:
https://github.com/micromata/javaapiforkml/blob/36e63335cf8642e20d990a414134677c06a5e536/src/main/java/de/micromata/opengis/kml/v_2_2_0/Kml.java#L944-L945

We use this library together with eclipselink moxy to fix issues with CDATA handling: https://code.google.com/archive/p/javaapiforkml/issues/37

Ideally this could be converted to a bring-your-own-implementation library. The tests can still rely on jaxb, and they could even be expanded to test against different implementations altough not really required because they all should handle the jakarta API appropriately.

To not break backwards compatibility, if that's even a concern, there could be a split between modules where a core module provides all models with just a dependency to jakarta.
The current released module could then have a dependency on glassfish and the core module.

Upgrade Java version from 5 to 6,7 or 8?

At least java 6, so that we can remove the jaxb-dependencies.

Btw. is this project dead? I see 3 PRs since spring and no acitivity. Does anyone know of other active Java KML libs?

Update docs

This setup not working:

  <repositories>
    <repository>
      <id>maven2-repository.dev.java.net</id>
      <name>Java.net Maven 2 Repository</name>
      <url>http://download.java.net/maven/2</url>
      <layout>default</layout>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>

    <dependency>
      <groupId>de.micromata.jak</groupId>
      <artifactId>JavaAPIforKml</artifactId>
      <version>2.2.0-SNAPSHOT</version>
    </dependency>

This is working:

    <dependency>
      <groupId>de.micromata.jak</groupId>
      <artifactId>JavaAPIforKml</artifactId>
      <version>2.2.0</version>
    </dependency>

can't use it in Android cause Jaxb

I can't use this library in android by gradle.
Cause Javaapiforkml use Jaxb, and Jaxb can't be used in android for its core libraries can't be replaced.
See:

234b5bc280986aa6747b70a4541614b8

default namespace is ns3:

I used this jar to generate kml, but the default namespace is "ns3:" which is quite annoying.

<ns3:kml xmlns:xal="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:ns3="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">

I extended the Kml class to override the NameSpaceBeautyfier. add this:
if (namespaceUri.matches("http://www.opengis.net/kml/.*?")) {
return "";
}

now it output kml without ns3 but default. The difference is "" will be used as default namespace, while "null" will generate some namespace (e.g. ns3:).

it will be great if you can update your code in github so I don't need to extend your class but use it directly.

Class leak

Currently, every Kml instance has a private JAXBContext field named jc.
This is not the correct way to use JAXB.
The creation of the context takes a significant amount of time and creates many classes dynamically, which is a severe leak, because classes are never garbage collected.
This problem can be seen by creating and marshalling a large number of Kml instances - after some hundred or thousand runs, the JVM runs out of class space and crashes.

The JAXBContext field should be static to improve performance and to prevent this class leak.

Support for the latest kml22gx.xsd

Hi, I'm looking to utilize this API, but one feature I am not finding is support for Icon palette sheets (specifically the X, Y, H, and W elements) found in the latest kml22gx.xsd. I am trying to display weather data from a National Weather Service KML file which utilizes this feature for their icons.

Is there any chance this can be supported in the near term? I attempted to update the schema and compile myself but to no avail. Thanks!

Broken HashCode implementation in Icon

The following code snippet produces a NullPointerException:
var h = new Icon().hashCode();
I believe this is du to the fact that Double.doubleToLongBits() is called upon the nullable members this.refreshInterval, this.viewRefreshTime and this.viewBoundScale.
Solution would be to add null checks as for the other members.

Handle incorrectly-specified LinearRing coordinates

When a LinearRing's <coordinates> tag is malformed using additional commas instead of spaces (i.e. x,y,z,x,y,z,x,y,z,... instead of x,y,z x,y,z x,y,z ...), JAK simply returns a list with only the first point.

That behaviour is fair enough, but it would be nice if it could either parse the malformed data or throw an exception, since returning a single point is technically incorrect and makes it harder to catch data errors.

Google Earth and other apps parse that malformed data correctly, so perhaps it's not so uncommon? A subset of the file I'm working with is:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
  <Document>
    <name>malformed sample</name>
    <open>1</open>
    <description>20150015_182600_walkability</description>
    <Folder>
      <name>Convex hulls</name>
      <description>Convex hulls</description>
      <Placemark>
        <name>Convex hull</name>
        <description>14min</description>
        <Polygon>
          <tessellate>1</tessellate>
          <outerBoundaryIs>
            <LinearRing>
              <coordinates>
                144.92556815,-37.75302462,0,144.92250866,-37.75137202,0,144.91917398,-37.74918087,0,144.91607408,-37.74220241,0,144.92396822,-37.73528384,0,144.92542654,-37.73525344,0,144.93609834,-37.74142729,0,144.93865024,-37.74562287,0,144.93879371,-37.74586098,0,144.93115197,-37.75120675,0,144.93001997,-37.75173478,0,144.92556815,-37.75302462,0
              </coordinates>
            </LinearRing>
          </outerBoundaryIs>
        </Polygon>
      </Placemark>
    </Folder>
  </Document>
</kml>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.