useDynLib(rgeos)

import(methods)
import(sp)
importFrom(utils, packageVersion)
importFrom(stats, optim)
importFrom(graphics, par, lines, strwidth, strheight, text)

export(createPolygonsComment, createSPComment, set_do_poly_check, get_do_poly_check)
export(rgeos_extSoftVersion)
#export(checkPolygonsGEOS)
#export(checkHolesGPC)
export(poly_findInBoxGEOS, gUnarySTRtreeQuery, gBinarySTRtreeQuery)

# sp extension classes
exportClasses(Ring,SpatialRings, SpatialRingsDataFrame)
export(Ring,SpatialRings,SpatialRingsDataFrame)

exportClasses(SpatialLinesNULL, SpatialPointsNULL, SpatialPolygonsNULL, SpatialRingsNULL)
exportClasses(SpatialCollections)
export(SpatialCollections)

exportMethods(row.names)

# Utility Functions
export(getScale,setScale,translate,checkP4S) #,groupID)
export(version_GEOS, version_GEOS0)
export(set_RGEOS_dropSlivers, get_RGEOS_dropSlivers, set_RGEOS_warnSlivers,
 get_RGEOS_warnSlivers, set_RGEOS_polyThreshold, get_RGEOS_polyThreshold,
 get_RGEOS_CheckValidity, set_RGEOS_CheckValidity)

# WKT Functions
export(readWKT, writeWKT)


# GEOS unary predicate functions
export(RGEOSisEmpty, RGEOSisValid, RGEOSisSimple, RGEOSisRing)#, RGEOSHasZ)
export(gIsEmpty, gIsValid, gIsSimple, gIsRing)#, gHasZ)


# GEOS binary predicate functions
export( RGEOSRelate, RGEOSDisjoint, RGEOSTouches, RGEOSIntersects, RGEOSCrosses,
		RGEOSWithin, RGEOSContains, RGEOSOverlaps, RGEOSEquals, RGEOSEqualsExact)
export( gRelate, gDisjoint, gTouches, gIntersects, gCrosses,
		gWithin, gContains, gOverlaps, gEquals, gEqualsExact,
		gContainsProperly, gCovers, gCoveredBy)

# GEOS misc functions
export( RGEOSArea, RGEOSLength, RGEOSDistance, RGEOSisWithinDistance, 
		RGEOSHausdorffDistance)
export( gArea, gLength, gDistance, gWithinDistance, gNearestPoints)
export( bbox2SP )

# GEOS topology functions
export( RGEOSEnvelope, RGEOSConvexHull, RGEOSBoundary, RGEOSGetCentroid, 
		RGEOSPointOnSurface, RGEOSLineMerge, RGEOSUnionCascaded)
export( gEnvelope, gConvexHull, gBoundary, gCentroid, 
		gPointOnSurface, gLineMerge, gUnionCascaded, gUnaryUnion)

export(	gSimplify, gPolygonize, gDelaunayTriangulation, gNode)
		
# GEOS binary topology functions
export( gDifference, gSymdifference, gIntersection, gUnion)# RSB FIXME

# GEOS buffer functions
export( RGEOSBuffer, gBuffer )

# GEOS linearref functions
export(gProject, gInterpolate)


# gpclib shadows

#importFrom(graphics, plot)

exportClasses("gpc.poly", "gpc.poly.nohole")
exportMethods("show", "get.bbox", "plot", "intersect", "union", "symdiff",
              "setdiff", "[", "append.poly", "scale.poly", "area.poly",
              "get.pts", "coerce", "tristrip", "triangulate")

export("read.polyfile", "write.polyfile")

export(polygonsLabel)

export(overGeomGeom) # needed by sp::overMultiPoints
export(overGeomGeomDF) # needed by sp::overMultiPoints
