Skip to content

Releases: urbancamo/javaapiforkml

Support for kml22gx.xsd extension

10 Apr 11:05

Choose a tag to compare

Release Notes

Bug Fixes

Style classes no longer emit stray default elements on marshal

IconStyle, LineStyle, and LabelStyle previously serialized <scale>, <heading>, and <width> elements even when callers never set them, because the underlying fields were primitive double (always 0.0) and JAXB's defaultValue only applies during unmarshalling. Affected fields have been converted to boxed Double so that unset (null) values are correctly omitted from output.

  • IconStyle.scale, IconStyle.heading
  • LineStyle.width
  • LabelStyle.scale

Breaking change (source-level, mostly benign): getters now return Double and setters/fluent withX(...) methods accept Double. Callers passing double literals (e.g. withWidth(6.0)) remain source-compatible via autoboxing; callers passing integer literals (e.g. withWidth(1)) must add a decimal (withWidth(1.0)). Binary compatibility is broken — downstream jars must be recompiled.

New Features

Icon palette sheet (sprite sheet) support

Added support for the Google gx: extension elements gx:x, gx:y, gx:w, gx:h on the <Icon> element, allowing callers to select a sub-rectangle of a larger sprite sheet image. This unblocks consumption of KML feeds — including some NOAA/NWS weather products and Google Earth sample data — that use sprite-based icon palettes.

iconStyle.createAndSetIcon()
    .withHref("https://example.com/weather-sprites.png")
    .withX(0.0).withY(0.0)
    .withW(138.0).withH(138.0);

Produces:

<Icon>
    <href>https://example.com/weather-sprites.png</href>
    <gx:x>0.0</gx:x>
    <gx:y>0.0</gx:y>
    <gx:w>138.0</gx:w>
    <gx:h>138.0</gx:h>
</Icon>

The new fields are typed Double (nullable) rather than Integer — verified necessary against Google's own libkml golden fixture, which uses floating-point values like 3.2/4.3. The local kml22gx.xsd has been updated to document the four new elements.

Test Coverage

  • IconStyleTest — 11 tests covering unset/explicit/zero scenarios for IconStyle.scale/heading, LineStyle.width, LabelStyle.scale, plus a verbatim reproduction of the reported bug scenario.
  • IconPaletteSheetTest — 5 tests covering defaults, marshal, unmarshal (both integer-form and float-form values), and round-trip.
  • RealWorldNwsFixturesTest — 4 tests parsing real NOAA/WPC KML fixtures (QPF6hr_f00-f06_latest.kml, Day1_psnow_gt_12inches.kml, Day_1_Excessive_Rainfall_Outlook.kml), including a round-trip regression check that confirms no stray <scale>/<heading>/<width> elements get introduced when a real-world file is parsed and re-serialized.
  • New test fixtures: libkml-all-gx.kml (from google/libkml, Apache 2.0, included with attribution header) and a synthetic icon_palette_sheet.kml modeled on the Google KML reference.

Total: 263 tests passing (up from 243).

Housekeeping

  • Removed the unresolvable maven-changelog-plugin reference from pom.xml (plugin last released 2014, no longer resolvable in modern Maven setups; only affected mvn site, which this project doesn't publish).

3.1.0

10 Apr 10:00

Choose a tag to compare

This is a breaking release, designed to address the bug reported in Issue #60

Changes:

  • IconStyle.scale and IconStyle.heading → Double
  • LineStyle.width → Double
  • LabelStyle.scale → Double
  • Each class: getters, setters, fluent withX, equals(), hashCode() updated for nullability
  • Example2.java test: withWidth(1) → withWidth(1.0) (int literals don't autobox to Double)

Breaking changes:

any Java code calling withWidth(1), withScale(2), etc. with integer literals will need a .0 suffix — everything else (double literals, variables, auto-unboxing to primitive) keeps working source-compatibly.

KML Namespace and Licensing

10 Apr 09:35

Choose a tag to compare

Issue 59 - jakarta namespace prefix default behaviour mitigation

  • security fixes
  • specify correct BSD license tag in pom.xml

Bug fixes, enhancements and move to central repo for publishing

29 May 11:38

Choose a tag to compare

Release 3.0.11

 - bug fixes
 - migrated to maven central for publishing

v3.0.9

26 Apr 15:33
edb1135

Choose a tag to compare

Issue 46

v3.0.8

21 Nov 19:29

Choose a tag to compare

Fixes issue with default namespace prefix and JAXB implementation dependency.

v3.0.7

21 Nov 18:31

Choose a tag to compare

I've checked this release against my own Java 11 based application and it is producing identical results to previous releases.

Rebase following repository move

21 Nov 14:58
aab2ba2

Choose a tag to compare

Issue 39 (#40)

* Remove idea files from repo

* Merge in urbancamo's branch pom.

* Merge in urbancamo's branch pom.

* - merge in urbancamo's branch source code to fix javadoc errors to allow release
 - update groupId in pom.xml to allow me to release via apache.

* - update groupId in pom.xml to allow me to release via apache.

* - updated docs.

* - version 3.0.6

---------

Co-authored-by: Mark Wickens <msw@wickensonline.co.uk>