/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 1.3.25 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ using System; using System.Runtime.InteropServices; public class Geometry : IDisposable { private HandleRef swigCPtr; protected bool swigCMemOwn; internal Geometry(IntPtr cPtr, bool cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = new HandleRef(this, cPtr); } internal static HandleRef getCPtr(Geometry obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; } public virtual void Dispose() { if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) { swigCMemOwn = false; throw new MethodAccessException("C++ destructor does not have public access"); } swigCPtr = new HandleRef(null, IntPtr.Zero); GC.SuppressFinalize(this); } public Geometry(int type, string wkt, int wkb, string wkb_buf, string gml) : this(ogrPINVOKE.new_Geometry(type, wkt, wkb, wkb_buf, gml), true) { } public string ExportToWkt() { string ret = ogrPINVOKE.Geometry_ExportToWkt(swigCPtr); return ret; } public int ExportToWkb(int byte_order) { int ret = ogrPINVOKE.Geometry_ExportToWkb(swigCPtr, byte_order); return ret; } public string ExportToGML() { string ret = ogrPINVOKE.Geometry_ExportToGML(swigCPtr); return ret; } public void AddPoint(double x, double y, double z) { ogrPINVOKE.Geometry_AddPoint(swigCPtr, x, y, z); } public int AddGeometryDirectly(Geometry other) { int ret = ogrPINVOKE.Geometry_AddGeometryDirectly(swigCPtr, Geometry.getCPtr(other)); return ret; } public int AddGeometry(Geometry other) { int ret = ogrPINVOKE.Geometry_AddGeometry(swigCPtr, Geometry.getCPtr(other)); return ret; } public Geometry Clone() { IntPtr cPtr = ogrPINVOKE.Geometry_Clone(swigCPtr); Geometry ret = (cPtr == IntPtr.Zero) ? null : new Geometry(cPtr, true); return ret; } public void Destroy() { ogrPINVOKE.Geometry_Destroy(swigCPtr); } public int GetGeometryType() { int ret = ogrPINVOKE.Geometry_GetGeometryType(swigCPtr); return ret; } public string GetGeometryName() { string ret = ogrPINVOKE.Geometry_GetGeometryName(swigCPtr); return ret; } public double GetArea() { double ret = ogrPINVOKE.Geometry_GetArea(swigCPtr); return ret; } public int GetPointCount() { int ret = ogrPINVOKE.Geometry_GetPointCount(swigCPtr); return ret; } public double GetX(int point) { double ret = ogrPINVOKE.Geometry_GetX(swigCPtr, point); return ret; } public double GetY(int point) { double ret = ogrPINVOKE.Geometry_GetY(swigCPtr, point); return ret; } public double GetZ(int point) { double ret = ogrPINVOKE.Geometry_GetZ(swigCPtr, point); return ret; } public int GetGeometryCount() { int ret = ogrPINVOKE.Geometry_GetGeometryCount(swigCPtr); return ret; } public void SetPoint(int point, double x, double y, double z) { ogrPINVOKE.Geometry_SetPoint(swigCPtr, point, x, y, z); } public Geometry GetGeometryRef(int geom) { IntPtr cPtr = ogrPINVOKE.Geometry_GetGeometryRef(swigCPtr, geom); Geometry ret = (cPtr == IntPtr.Zero) ? null : new Geometry(cPtr, true); return ret; } public Geometry GetBoundary() { IntPtr cPtr = ogrPINVOKE.Geometry_GetBoundary(swigCPtr); Geometry ret = (cPtr == IntPtr.Zero) ? null : new Geometry(cPtr, true); return ret; } public Geometry ConvexHull() { IntPtr cPtr = ogrPINVOKE.Geometry_ConvexHull(swigCPtr); Geometry ret = (cPtr == IntPtr.Zero) ? null : new Geometry(cPtr, true); return ret; } public Geometry Buffer(double distance, int quadsecs) { IntPtr cPtr = ogrPINVOKE.Geometry_Buffer(swigCPtr, distance, quadsecs); Geometry ret = (cPtr == IntPtr.Zero) ? null : new Geometry(cPtr, true); return ret; } public Geometry Intersection(Geometry other) { IntPtr cPtr = ogrPINVOKE.Geometry_Intersection(swigCPtr, Geometry.getCPtr(other)); Geometry ret = (cPtr == IntPtr.Zero) ? null : new Geometry(cPtr, true); return ret; } public Geometry Union(Geometry other) { IntPtr cPtr = ogrPINVOKE.Geometry_Union(swigCPtr, Geometry.getCPtr(other)); Geometry ret = (cPtr == IntPtr.Zero) ? null : new Geometry(cPtr, true); return ret; } public Geometry Difference(Geometry other) { IntPtr cPtr = ogrPINVOKE.Geometry_Difference(swigCPtr, Geometry.getCPtr(other)); Geometry ret = (cPtr == IntPtr.Zero) ? null : new Geometry(cPtr, true); return ret; } public Geometry SymmetricDifference(Geometry other) { IntPtr cPtr = ogrPINVOKE.Geometry_SymmetricDifference(swigCPtr, Geometry.getCPtr(other)); Geometry ret = (cPtr == IntPtr.Zero) ? null : new Geometry(cPtr, true); return ret; } public double Distance(Geometry other) { double ret = ogrPINVOKE.Geometry_Distance(swigCPtr, Geometry.getCPtr(other)); return ret; } public void Empty() { ogrPINVOKE.Geometry_Empty(swigCPtr); } public int Intersect(Geometry other) { int ret = ogrPINVOKE.Geometry_Intersect(swigCPtr, Geometry.getCPtr(other)); return ret; } public int Equal(Geometry other) { int ret = ogrPINVOKE.Geometry_Equal(swigCPtr, Geometry.getCPtr(other)); return ret; } public int Disjoint(Geometry other) { int ret = ogrPINVOKE.Geometry_Disjoint(swigCPtr, Geometry.getCPtr(other)); return ret; } public int Touches(Geometry other) { int ret = ogrPINVOKE.Geometry_Touches(swigCPtr, Geometry.getCPtr(other)); return ret; } public int Crosses(Geometry other) { int ret = ogrPINVOKE.Geometry_Crosses(swigCPtr, Geometry.getCPtr(other)); return ret; } public int Within(Geometry other) { int ret = ogrPINVOKE.Geometry_Within(swigCPtr, Geometry.getCPtr(other)); return ret; } public int Contains(Geometry other) { int ret = ogrPINVOKE.Geometry_Contains(swigCPtr, Geometry.getCPtr(other)); return ret; } public int Overlaps(Geometry other) { int ret = ogrPINVOKE.Geometry_Overlaps(swigCPtr, Geometry.getCPtr(other)); return ret; } public int TransformTo(SWIGTYPE_p_OSRSpatialReferenceShadow reference) { int ret = ogrPINVOKE.Geometry_TransformTo(swigCPtr, SWIGTYPE_p_OSRSpatialReferenceShadow.getCPtr(reference)); return ret; } public int Transform(SWIGTYPE_p_OSRCoordinateTransformationShadow trans) { int ret = ogrPINVOKE.Geometry_Transform(swigCPtr, SWIGTYPE_p_OSRCoordinateTransformationShadow.getCPtr(trans)); return ret; } public SWIGTYPE_p_OSRSpatialReferenceShadow GetSpatialReference() { IntPtr cPtr = ogrPINVOKE.Geometry_GetSpatialReference(swigCPtr); SWIGTYPE_p_OSRSpatialReferenceShadow ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_OSRSpatialReferenceShadow(cPtr, false); return ret; } public void AssignSpatialReference(SWIGTYPE_p_OSRSpatialReferenceShadow reference) { ogrPINVOKE.Geometry_AssignSpatialReference(swigCPtr, SWIGTYPE_p_OSRSpatialReferenceShadow.getCPtr(reference)); } public void CloseRings() { ogrPINVOKE.Geometry_CloseRings(swigCPtr); } public void FlattenTo2D() { ogrPINVOKE.Geometry_FlattenTo2D(swigCPtr); } public void GetEnvelope() { ogrPINVOKE.Geometry_GetEnvelope(swigCPtr); } public Geometry Centroid() { IntPtr cPtr = ogrPINVOKE.Geometry_Centroid(swigCPtr); Geometry ret = (cPtr == IntPtr.Zero) ? null : new Geometry(cPtr, true); return ret; } public int WkbSize() { int ret = ogrPINVOKE.Geometry_WkbSize(swigCPtr); return ret; } public int GetCoordinateDimension() { int ret = ogrPINVOKE.Geometry_GetCoordinateDimension(swigCPtr); return ret; } public int GetDimension() { int ret = ogrPINVOKE.Geometry_GetDimension(swigCPtr); return ret; } }