@@ -29,9 +29,9 @@ geomToWKT(geom::Ptr{GEOSGeometry}) = bytestring(GEOSGeomToWKT(geom))
2929# -----
3030
3131# Create a Coordinate sequence with ``size'' coordinates of ``dims'' dimensions (Return NULL on exception)
32- function createCoordSeq (size:: Int , ndim:: Int )
32+ function createCoordSeq (size:: Integer , ndim:: Integer )
3333 @assert ndim >= 2
34- result = GEOSCoordSeq_create (@compat ( UInt32 ( size)), @compat ( UInt32 ( ndim)) )
34+ result = GEOSCoordSeq_create (size, ndim)
3535 if result == C_NULL
3636 error (" LibGEOS: Error in GEOSCoordSeq_create" )
3737 end
@@ -56,49 +56,49 @@ function destroyCoordSeq(ptr::GEOSCoordSeq)
5656end
5757
5858# Set ordinate values in a Coordinate Sequence (Return 0 on exception)
59- function setX! (ptr:: GEOSCoordSeq , i:: Int , value:: Float64 )
60- result = GEOSCoordSeq_setX (ptr, @compat ( UInt32 ( i- 1 )) , value)
59+ function setX! (ptr:: GEOSCoordSeq , i:: Integer , value:: Real )
60+ result = GEOSCoordSeq_setX (ptr, i- 1 , value)
6161 if result == 0
6262 error (" LibGEOS: Error in GEOSCoordSeq_setX" )
6363 end
6464 result
6565end
6666
67- function setY! (ptr:: GEOSCoordSeq , i:: Int , value:: Float64 )
68- result = GEOSCoordSeq_setY (ptr, @compat ( UInt32 ( i- 1 )) , value)
67+ function setY! (ptr:: GEOSCoordSeq , i:: Integer , value:: Real )
68+ result = GEOSCoordSeq_setY (ptr, i- 1 , value)
6969 if result == 0
7070 error (" LibGEOS: Error in GEOSCoordSeq_setY" )
7171 end
7272 result
7373end
7474
75- function setZ! (ptr:: GEOSCoordSeq , i:: Int , value:: Float64 )
76- result = GEOSCoordSeq_setZ (ptr, @compat ( UInt32 ( i- 1 )) , value)
75+ function setZ! (ptr:: GEOSCoordSeq , i:: Integer , value:: Real )
76+ result = GEOSCoordSeq_setZ (ptr, i- 1 , value)
7777 if result == 0
7878 error (" LibGEOS: Error in GEOSCoordSeq_setZ" )
7979 end
8080 result
8181end
8282
8383# Get ordinate values from a Coordinate Sequence (Return 0 on exception)
84- function getX! (ptr:: GEOSCoordSeq , index:: Int , coord:: Vector{Float64} )
85- result = GEOSCoordSeq_getX (ptr, @compat ( UInt32 ( index- 1 )) , pointer (coord))
84+ function getX! (ptr:: GEOSCoordSeq , index:: Integer , coord:: Vector{Float64} )
85+ result = GEOSCoordSeq_getX (ptr, index- 1 , pointer (coord))
8686 if result == 0
8787 error (" LibGEOS: Error in GEOSCoordSeq_getX" )
8888 end
8989 result
9090end
9191
92- function getY! (ptr:: GEOSCoordSeq , index:: Int , coord:: Vector{Float64} )
93- result = GEOSCoordSeq_getY (ptr, @compat ( UInt32 ( index- 1 )) , pointer (coord))
92+ function getY! (ptr:: GEOSCoordSeq , index:: Integer , coord:: Vector{Float64} )
93+ result = GEOSCoordSeq_getY (ptr, index- 1 , pointer (coord))
9494 if result == 0
9595 error (" LibGEOS: Error in GEOSCoordSeq_getY" )
9696 end
9797 result
9898end
9999
100- function getZ! (ptr:: GEOSCoordSeq , index:: Int , coord:: Vector{Float64} )
101- result = GEOSCoordSeq_getZ (ptr, @compat ( UInt32 ( index- 1 )) , pointer (coord))
100+ function getZ! (ptr:: GEOSCoordSeq , index:: Integer , coord:: Vector{Float64} )
101+ result = GEOSCoordSeq_getZ (ptr, index- 1 , pointer (coord))
102102 if result == 0
103103 error (" LibGEOS: Error in GEOSCoordSeq_getZ" )
104104 end
@@ -130,7 +130,7 @@ let out = Array(UInt32, 1)
130130end
131131
132132# convenience functions
133- function setCoordSeq! (ptr:: GEOSCoordSeq , i:: Int , coords:: Vector{Float64} )
133+ function setCoordSeq! (ptr:: GEOSCoordSeq , i:: Integer , coords:: Vector{Float64} )
134134 ndim = length (coords)
135135 @assert ndim >= 2
136136 setX! (ptr, i, coords[1 ])
@@ -139,14 +139,14 @@ function setCoordSeq!(ptr::GEOSCoordSeq, i::Int, coords::Vector{Float64})
139139 ptr
140140end
141141
142- function createCoordSeq (x:: Float64 , y:: Float64 )
142+ function createCoordSeq (x:: Real , y:: Real )
143143 coordinates = createCoordSeq (1 , 2 )
144144 setX! (coordinates, 1 , x)
145145 setY! (coordinates, 1 , y)
146146 coordinates
147147end
148148
149- function createCoordSeq (x:: Float64 , y:: Float64 , z:: Float64 )
149+ function createCoordSeq (x:: Real , y:: Real , z:: Real )
150150 coordinates = createCoordSeq (1 , 3 )
151151 setX! (coordinates, 1 , x)
152152 setY! (coordinates, 1 , y)
174174
175175let out = Array (Float64, 1 )
176176 global getX
177- function getX (ptr:: GEOSCoordSeq , i:: Int )
177+ function getX (ptr:: GEOSCoordSeq , i:: Integer )
178178 getX! (ptr, i, out)
179179 out[1 ]
180180 end
@@ -186,14 +186,14 @@ function getX(ptr::GEOSCoordSeq)
186186 start = pointer (xcoords)
187187 floatsize = sizeof (Float64)
188188 for i= 0 : ncoords- 1
189- GEOSCoordSeq_getX (ptr, @compat ( UInt32 (i)) , start + i* floatsize)
189+ GEOSCoordSeq_getX (ptr, i , start + i* floatsize)
190190 end
191191 xcoords
192192end
193193
194194let out = Array (Float64, 1 )
195195 global getY
196- function getY (ptr:: GEOSCoordSeq , i:: Int )
196+ function getY (ptr:: GEOSCoordSeq , i:: Integer )
197197 out = Array (Float64, 1 )
198198 getY! (ptr, i, out)
199199 out[1 ]
@@ -206,14 +206,14 @@ function getY(ptr::GEOSCoordSeq)
206206 start = pointer (ycoords)
207207 floatsize = sizeof (Float64)
208208 for i= 0 : ncoords- 1
209- GEOSCoordSeq_getY (ptr, @compat ( UInt32 (i)) , start + i* floatsize)
209+ GEOSCoordSeq_getY (ptr, i , start + i* floatsize)
210210 end
211211 ycoords
212212end
213213
214214let out = Array (Float64, 1 )
215215 global getZ
216- function getZ (ptr:: GEOSCoordSeq , i:: Int )
216+ function getZ (ptr:: GEOSCoordSeq , i:: Integer )
217217 getZ! (ptr, i, out)
218218 out[1 ]
219219 end
@@ -225,20 +225,20 @@ function getZ(ptr::GEOSCoordSeq)
225225 start = pointer (zcoords)
226226 floatsize = sizeof (Float64)
227227 for i= 0 : ncoords- 1
228- GEOSCoordSeq_getZ (ptr, @compat ( UInt32 (i)) , start + i* floatsize)
228+ GEOSCoordSeq_getZ (ptr, i , start + i* floatsize)
229229 end
230230 zcoords
231231end
232232
233- function getCoordinates (ptr:: GEOSCoordSeq , i:: Int )
233+ function getCoordinates (ptr:: GEOSCoordSeq , i:: Integer )
234234 ndim = getDimensions (ptr)
235235 coord = Array (Float64, ndim)
236236 start = pointer (coord)
237237 floatsize = sizeof (Float64)
238- GEOSCoordSeq_getX (ptr, @compat ( UInt32 ( i- 1 )) , start)
239- GEOSCoordSeq_getY (ptr, @compat ( UInt32 ( i- 1 )) , start+ floatsize)
238+ GEOSCoordSeq_getX (ptr, i- 1 , start)
239+ GEOSCoordSeq_getY (ptr, i- 1 , start+ floatsize)
240240 if ndim == 3
241- GEOSCoordSeq_getZ (ptr, @compat ( UInt32 ( i- 1 )) , start+ 2 * floatsize)
241+ GEOSCoordSeq_getZ (ptr, i- 1 , start+ 2 * floatsize)
242242 end
243243 coord
244244end
262262# Return distance of point 'p' projected on 'g' from origin of 'g'. Geometry 'g' must be a lineal geometry
263263project (g:: GEOSGeom , p:: GEOSGeom ) = GEOSProject (g, p)
264264# Return closest point to given distance within geometry (Geometry must be a LineString)
265- function interpolate (ptr:: GEOSGeom , d:: Float64 )
265+ function interpolate (ptr:: GEOSGeom , d:: Real )
266266 result = GEOSInterpolate (ptr, d)
267267 if result == C_NULL
268268 error (" LibGEOS: Error in GEOSInterpolate" )
272272
273273projectNormalized (g:: GEOSGeom , p:: GEOSGeom ) = GEOSProjectNormalized (g, p)
274274
275- function interpolateNormalized (ptr:: GEOSGeom , d:: Float64 )
275+ function interpolateNormalized (ptr:: GEOSGeom , d:: Real )
276276 result = GEOSInterpolateNormalized (ptr, d)
277277 if result == C_NULL
278278 error (" LibGEOS: Error in GEOSInterpolateNormalized" )
288288# The user can control the accuracy of the curve approximation by specifying the number of linear segments with which to approximate a curve.
289289
290290# Always returns a polygon. The negative or zero-distance buffer of lines and points is always an empty Polygon.
291- buffer (ptr:: GEOSGeom , width:: Float64 , quadsegs:: Int = 8 ) = GEOSBuffer (ptr, width, @compat (Int32 (quadsegs)))
291+ buffer (ptr:: GEOSGeom , width:: Real , quadsegs:: Integer = 8 ) = GEOSBuffer (ptr, width, @compat (Int32 (quadsegs)))
292292
293293# enum GEOSBufCapStyles
294294# enum GEOSBufJoinStyles
@@ -316,8 +316,8 @@ function createPoint(ptr::GEOSCoordSeq)
316316 end
317317 result
318318end
319- createPoint (x:: Float64 , y:: Float64 ) = createPoint (createCoordSeq (x,y))
320- createPoint (x:: Float64 , y:: Float64 , z:: Float64 ) = createPoint (createCoordSeq (x,y,z))
319+ createPoint (x:: Real , y:: Real ) = createPoint (createCoordSeq (x,y))
320+ createPoint (x:: Real , y:: Real , z:: Real ) = createPoint (createCoordSeq (x,y,z))
321321createPoint (coords:: Vector{Vector{Float64}} ) = createPoint (createCoordSeq (coords))
322322createPoint (coords:: Vector{Float64} ) = createPoint (createCoordSeq (Vector{Float64}[coords]))
323323
@@ -343,24 +343,23 @@ createLineString(coords::Vector{Vector{Float64}}) = GEOSGeom_createLineString(cr
343343# The caller remains owner of the array, but pointed-to
344344# objects become ownership of the returned GEOSGeometry.
345345function createPolygon (shell:: GEOSGeom , holes:: Vector{GEOSGeom} )
346- result = GEOSGeom_createPolygon (shell, pointer (holes), @compat ( UInt32 ( length (holes)) ))
346+ result = GEOSGeom_createPolygon (shell, pointer (holes), length (holes))
347347 if result == C_NULL
348348 error (" LibGEOS: Error in GEOSGeom_createPolygon" )
349349 end
350350 result
351351end
352352
353-
354- function createCollection (geomtype:: Int , geoms:: Vector{GEOSGeom} )
355- result = GEOSGeom_createCollection (@compat (Int32 (geomtype)), pointer (geoms), @compat (UInt32 (length (geoms))))
353+ function createCollection (geomtype:: Integer , geoms:: Vector{GEOSGeom} )
354+ result = GEOSGeom_createCollection (geomtype, pointer (geoms), length (geoms))
356355 if result == C_NULL
357356 error (" LibGEOS: Error in GEOSGeom_createCollection" )
358357 end
359358 result
360359end
361360
362- function createEmptyCollection (geomtype:: Int )
363- result = GEOSGeom_createEmptyCollection (@compat ( Int32 ( geomtype)) )
361+ function createEmptyCollection (geomtype:: Integer )
362+ result = GEOSGeom_createEmptyCollection (geomtype)
364363 if result == C_NULL
365364 error (" LibGEOS: Error in GEOSGeom_createEmptyCollection" )
366365 end
@@ -493,15 +492,15 @@ function lineMerge(ptr::GEOSGeom)
493492 result
494493end
495494
496- function simplify (ptr:: GEOSGeom , tol:: Float64 )
495+ function simplify (ptr:: GEOSGeom , tol:: Real )
497496 result = GEOSSimplify (ptr, tol)
498497 if result == C_NULL
499498 error (" LibGEOS: Error in GEOSSimplify" )
500499 end
501500 result
502501end
503502
504- function topologyPreserveSimplify (ptr:: GEOSGeom , tol:: Float64 )
503+ function topologyPreserveSimplify (ptr:: GEOSGeom , tol:: Real )
505504 result = GEOSTopologyPreserveSimplify (ptr, tol)
506505 if result == C_NULL
507506 error (" LibGEOS: Error in GEOSTopologyPreserveSimplify" )
536535
537536# Snap first geometry on to second with given tolerance
538537# (Returns a newly allocated geometry, or NULL on exception)
539- function snap (g1:: GEOSGeom , g2:: GEOSGeom , tol:: Float64 )
538+ function snap (g1:: GEOSGeom , g2:: GEOSGeom , tol:: Real )
540539 result = GEOSSnap (g1, g2, tol)
541540 if result == C_NULL
542541 error (" LibGEOS: Error in GEOSSnap" )
552551# return a GEOMETRYCOLLECTION containing triangular POLYGONs.
553552#
554553# @return a newly allocated geometry, or NULL on exception
555- function delaunayTriangulation (ptr:: GEOSGeom , tol:: Float64 = 0.0 , onlyEdges:: Bool = false )
554+ function delaunayTriangulation (ptr:: GEOSGeom , tol:: Real = 0.0 , onlyEdges:: Bool = false )
556555 result = GEOSDelaunayTriangulation (ptr, tol, @compat (Int32 (onlyEdges)))
557556 if result == C_NULL
558557 error (" LibGEOS: Error in GEOSDelaunayTriangulation" )
@@ -627,7 +626,7 @@ function equals(g1::GEOSGeom, g2::GEOSGeom)
627626 result != 0x00
628627end
629628
630- function equalsexact (g1:: GEOSGeom , g2:: GEOSGeom , tol:: Float64 )
629+ function equalsexact (g1:: GEOSGeom , g2:: GEOSGeom , tol:: Real )
631630 result = GEOSEqualsExact (g1, g2, tol)
632631 if result == 0x02
633632 error (" LibGEOS: Error in GEOSEqualsExact" )
886885# it must NOT be destroyed directly.
887886# Up to GEOS 3.2.0 the input geometry must be a Collection, in
888887# later version it doesn't matter (i.e. getGeometryN(0) for a single will return the input).
889- function getGeometry (ptr:: GEOSGeom , n:: Int )
890- result = GEOSGetGeometryN (ptr, @compat ( Int32 ( n- 1 )) )
888+ function getGeometry (ptr:: GEOSGeom , n:: Integer )
889+ result = GEOSGetGeometryN (ptr, n- 1 )
891890 if result == C_NULL
892891 error (" LibGEOS: Error in GEOSGetGeometryN" )
893892 end
948947
949948# Return NULL on exception, Geometry must be a Polygon.
950949# Returned object is a pointer to internal storage: it must NOT be destroyed directly.
951- function interiorRing (ptr:: GEOSGeom , n:: Int )
952- result = GEOSGetInteriorRingN (ptr, @compat ( Int32 ( n- 1 )) )
950+ function interiorRing (ptr:: GEOSGeom , n:: Integer )
951+ result = GEOSGetInteriorRingN (ptr, n- 1 )
953952 if result == C_NULL
954953 error (" LibGEOS: Error in GEOSGetInteriorRingN" )
955954 end
@@ -998,11 +997,11 @@ end
998997getGeomDimensions (ptr:: GEOSGeom ) = GEOSGeom_getDimensions (ptr)
999998
1000999# Return 2 or 3.
1001- getCoordinateDimension (ptr:: GEOSGeom ) = int ( GEOSGeom_getCoordinateDimension (ptr) )
1000+ getCoordinateDimension (ptr:: GEOSGeom ) = GEOSGeom_getCoordinateDimension (ptr)
10021001
10031002# Call only on LINESTRING, and must be freed by caller (Returns NULL on exception)
1004- function getPoint (ptr:: GEOSGeom , n:: Int )
1005- result = GEOSGeomGetPointN (ptr, @compat ( Int32 ( n- 1 )) )
1003+ function getPoint (ptr:: GEOSGeom , n:: Integer )
1004+ result = GEOSGeomGetPointN (ptr, n- 1 )
10061005 if result == C_NULL
10071006 error (" LibGEOS: Error in GEOSGeomGetPointN" )
10081007 end
@@ -1080,7 +1079,7 @@ end
10801079
10811080let out = Array (Float64, 1 )
10821081 global hausdorffdistance
1083- function hausdorffdistance (g1:: GEOSGeom , g2:: GEOSGeom , densifyFrac:: Float64 )
1082+ function hausdorffdistance (g1:: GEOSGeom , g2:: GEOSGeom , densifyFrac:: Real )
10841083 # Return 0 on exception, 1 otherwise
10851084 result = GEOSHausdorffDistanceDensify (g1, g2, densifyFrac, pointer (out))
10861085 if result == 0
0 commit comments