Skip to content

Conversation

@jeffw-wherethebitsroam
Copy link

Hi,

This is a collection of a few small updates for ruby_kml:

  • include test kmls in the repository
  • strip leading and trailing space from coordinates
  • allow polygons to have multiple inner boundaries
  • alias KMLFile.objects as features so it can be treated in the same way as containers
  • specify dependency on builder in the gemfile

Hope they seem ok!

Jeff

This is for when the coordinates are read in from an external source and
contain leading or trailing space, which would otherwise result in an
empty coordinate.
- we need the test kmls in the repository to run tests
This update still allows the old way of setting a single inner bounday
via equals:

polygon.inner_boundary_is = LinearRing.new(...)

Is adds support to assign as array:

polygon.inner_boundary_is = [
  LinearRing.new(...),
  LinearRing.new(...)
]

Or add to the existing array:

polygon.inner_boundary_is << LinearRing.new(...)
polygon.inner_boundary_is << LinearRing.new(...)

I have added a test for this
This allows you to loop over the features in the KMLFile in the same way
you loop over features in containers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant