Skip to content

Commit 549c6cb

Browse files
evetionyeesian
authored andcommitted
Buffer can also return a MultiPolygon, not only a Polygon (#31)
* Buffer can return other things than Polygon. * Added test for buffer output type. * Removed dummy false check. * allow failures on nightlies * allow failures on nightlies on Travis
1 parent 699d527 commit 549c6cb

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ julia:
66
- 0.4
77
- 0.5
88
- nightly
9+
matrix:
10+
allow_failures:
11+
- julia: nightly
912
notifications:
1013
email: false
1114
script:

appveyor.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ branches:
1212
- master
1313
- /release-.*/
1414

15+
matrix:
16+
allow_failures:
17+
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
18+
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
19+
1520
notifications:
1621
- provider: Email
1722
on_build_success: false

src/geos_operations.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ interpolateNormalized(line::LineString, dist::Real) = Point(interpolateNormalize
3636
# # Topology operations
3737
# # -----
3838
for geom in (:Point, :MultiPoint, :LineString, :MultiLineString, :LinearRing, :Polygon, :MultiPolygon, :GeometryCollection)
39-
@eval buffer(obj::$geom, dist::Real, quadsegs::Integer=8) = Polygon(buffer(obj.ptr, dist, quadsegs))
39+
@eval buffer(obj::$geom, dist::Real, quadsegs::Integer=8) = geomFromGEOS(buffer(obj.ptr, dist, quadsegs))
4040
@eval envelope(obj::$geom) = geomFromGEOS(envelope(obj.ptr))
4141
@eval convexhull(obj::$geom) = geomFromGEOS(convexhull(obj.ptr))
4242
@eval boundary(obj::$geom) = geomFromGEOS(boundary(obj.ptr))

test/test_geos_operations.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,3 +242,7 @@ test_within("POLYGON((1 1,1 2,2 2,2 1,1 1))", "MULTIPOLYGON(((0 0,0 10,10 10,10
242242
# GEOSisClosedTest
243243
@fact isClosed(parseWKT("LINESTRING(0 0, 1 0, 1 1)")) --> false
244244
@fact isClosed(parseWKT("LINESTRING(0 0, 0 1, 1 1, 0 0)")) --> true
245+
246+
# Buffer should return Polygon or MultiPolygon
247+
@fact typeof(buffer(MultiPoint([[1.0, 1.0], [2.0, 2.0], [2.0, 0.0]]), 0.1)) --> :MultiPolygon
248+
@fact typeof(buffer(MultiPoint([[1.0, 1.0], [2.0, 2.0], [2.0, 0.0]]), 10)) --> :Polygon

0 commit comments

Comments
 (0)