本文整理汇总了C#中OSGeo类的典型用法代码示例。如果您正苦于以下问题:C# OSGeo类的具体用法?C# OSGeo怎么用?C# OSGeo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OSGeo类属于命名空间,在下文中一共展示了OSGeo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SectionInfoCtrl
public SectionInfoCtrl(IDrawingService drawSvc, string drawingSourceId, OSGeo.MapGuide.ObjectModels.Common.DrawingSectionListSection section)
: this()
{
_drawSvc = drawSvc;
_drawingSourceId = drawingSourceId;
_section = section;
}
示例2: DoMigrate
private static int DoMigrate(OSGeo.MapGuide.MaestroAPI.IServerConnection source, OSGeo.MapGuide.MaestroAPI.IServerConnection target, CopyMoveToServerDialog migrate)
{
var diag = new ProgressDialog();
diag.CancelAbortsThread = true;
var method = new ProgressDialog.DoBackgroundWork((worker, e, args) =>
{
var src = (IServerConnection)args[0];
var dst = (IServerConnection)args[1];
var ids = (string[])args[2];
var folder = (string)args[3];
var overwrite = (bool)args[4];
var act = (MigrationAction)args[5];
var cb = new LengthyOperationProgressCallBack((sender, cbe) =>
{
worker.ReportProgress(cbe.Progress, cbe.StatusMessage);
});
var migrator = new ResourceMigrator(source, target);
int affected = 0;
switch (act)
{
case MigrationAction.Copy:
affected = migrator.CopyResources(ids, folder, overwrite, cb);
break;
case MigrationAction.Move:
affected = migrator.MoveResources(ids, folder, overwrite, cb);
break;
}
return affected;
});
return (int)diag.RunOperationAsync(Workbench.Instance, method, source, target, migrate.SourceResourceIds, migrate.TargetFolder, migrate.OverwriteResources, migrate.SelectedAction);
}
示例3: IsPreviewable
public bool IsPreviewable(OSGeo.MapGuide.MaestroAPI.Resource.IResource res)
{
var rt = res.ResourceType;
return (rt == ResourceTypes.LayerDefinition ||
rt == ResourceTypes.MapDefinition ||
rt == ResourceTypes.WatermarkDefinition);
}
示例4: get_extent
public static ESRI.ArcGIS.Geometry.IEnvelope get_extent(OSGeo.OGR.Envelope ogr_envelope, ISpatialReference sr)
{
IEnvelope env = new EnvelopeClass();
env.PutCoords(ogr_envelope.MinX, ogr_envelope.MinY, ogr_envelope.MaxX, ogr_envelope.MaxY);
env.SpatialReference = sr;
return env;
}
示例5: OGRDataset
public OGRDataset(OSGeo.OGR.Layer layer)
{
m_layer = layer;
ogr_utils.map_fields(layer, out m_fieldMapping, out m_fields, out m_datasetType,
out m_geometryType, out m_geometryFieldIndex, out m_oidFieldIndex,
out m_spatialReference);
}
示例6: IsValid
private bool IsValid(OSGeo.MapGuide.MaestroAPI.IServerConnection conn)
{
return conn.Capabilities.SupportsResourceHeaders &&
conn.Capabilities.SupportsResourceReferences &&
conn.Capabilities.SupportsResourceSecurity &&
conn.Capabilities.SupportsWfsPublishing &&
conn.Capabilities.SupportsWmsPublishing;
}
示例7: ReadShortBlock
public static void ReadShortBlock(OSGeo.GDAL.Band rasterBand,
BandBlock<short> block)
{
rasterBand.ReadRaster(block.XOffset, block.YOffset,
block.UsedPortionXSize, block.UsedPortionYSize,
block.Buffer,
block.UsedPortionXSize, block.UsedPortionYSize,
block.PixelSpace, block.LineSpace);
}
示例8: GeoTransform
/// <summary>
/// Constructor
/// </summary>
/// <param name="gdalDataset">The gdal dataset</param>
public GeoTransform(OSGeo.GDAL.Dataset gdalDataset)
{
if (gdalDataset == null)
throw new ArgumentException("GeoTransform constructor invoked with null dataset.", "gdalDataset");
var array = new double[6];
gdalDataset.GetGeoTransform(array);
_transform = array;
ComputeInverse();
}
示例9: get_spatialReference
public static ESRI.ArcGIS.Geometry.ISpatialReference get_spatialReference(OSGeo.OSR.SpatialReference ogrSR)
{
ogrSR.MorphToESRI();
string wkt;
ogrSR.ExportToWkt(out wkt);
ISpatialReferenceFactory4 spatialReferenceFactory = new ESRI.ArcGIS.Geometry.SpatialReferenceEnvironmentClass();
ISpatialReference sr;
int bytesRead;
spatialReferenceFactory.CreateESRISpatialReference(wkt, out sr, out bytesRead);
return sr;
}
示例10: GetSpatialReference
public static ISpatialReference GetSpatialReference(OSGeo.OSR.SpatialReference ogrSr)
{
ogrSr.MorphToESRI();
string wkt;
ogrSr.ExportToWkt(out wkt);
var type = Type.GetTypeFromCLSID(typeof (SpatialReferenceEnvironmentClass).GUID);
ISpatialReferenceFactory4 spatialReferenceFactory = (ISpatialReferenceFactory4) Activator.CreateInstance(type);
ISpatialReference sr;
int bytesRead;
spatialReferenceFactory.CreateESRISpatialReference(wkt, out sr, out bytesRead);
return sr;
}
示例11: FromFdoGeometry
/// <summary>
/// Converts an FDO Geometry to a SharpMap geometry
/// </summary>
/// <param name="geom">The FDO geometry</param>
/// <returns></returns>
public static Sm.Geometry FromFdoGeometry(FdoGeometry geom, OSGeo.FDO.Geometry.FgfGeometryFactory geomFactory)
{
if (FdoGeometryUtil.Is2D(geom.InternalInstance))
{
//Get the WKB form of the geometry
byte[] wkb = FdoGeometryFactory.Instance.GetWkb(geom.InternalInstance);
return GeometryFromWKB.Parse(wkb);
}
else
{
using (OSGeo.FDO.Geometry.IGeometry flattened = FdoGeometryUtil.Flatten(geom.InternalInstance, geomFactory))
{
//Get the WKB form of the geometry
byte[] wkb = FdoGeometryFactory.Instance.GetWkb(flattened);
return GeometryFromWKB.Parse(wkb);
}
}
}
示例12: CreateItem
public override OSGeo.MapGuide.MaestroAPI.Resource.IResource CreateItem(string startPoint, OSGeo.MapGuide.MaestroAPI.IServerConnection conn)
{
using (var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.FeatureSource, ResourcePickerMode.OpenResource))
{
picker.SetStartingPoint(startPoint);
if (picker.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
var lyr = ObjectFactory.CreateDefaultLayer(conn, OSGeo.MapGuide.ObjectModels.LayerDefinition.LayerType.Vector, new Version(1, 1, 0));
var vl = (IVectorLayerDefinition)lyr.SubLayer;
vl.ResourceId = picker.ResourceID;
//Stub these for now, validation will ensure this never makes it
//into the session repository until all validation errors pass
vl.FeatureName = string.Empty;
vl.Geometry = string.Empty;
return lyr;
}
else
{
return null;
}
}
}
示例13: CreateOdbcMappingNode
private static TreeNode CreateOdbcMappingNode(OSGeo.FDO.Providers.Rdbms.Override.ODBC.OvPhysicalSchemaMapping mapping)
{
var schema = new OdbcPhysicalSchemaMappingItem(mapping);
var node = new TreeNode(schema.Name);
node.Text = schema.Name;
node.Tag = schema;
foreach (OdbcClassDefinitionItem cls in schema.Classes)
{
var clsNode = new TreeNode(cls.Name);
clsNode.Text = cls.Name;
clsNode.Tag = cls;
foreach (object prop in cls.Properties)
{
if (prop.GetType() == typeof(OdbcDataPropertyDefinitionItem))
{
OdbcDataPropertyDefinitionItem p = (OdbcDataPropertyDefinitionItem)prop;
var propNode = new TreeNode(p.Name);
propNode.Text = p.Name;
propNode.Tag = p;
clsNode.Nodes.Add(propNode);
}
else if (prop.GetType() == typeof(OdbcGeometricPropertyDefinitionItem))
{
OdbcGeometricPropertyDefinitionItem p = (OdbcGeometricPropertyDefinitionItem)prop;
var propNode = new TreeNode(p.Name);
propNode.Text = p.Name;
propNode.Tag = p;
clsNode.Nodes.Add(propNode);
}
}
node.Nodes.Add(clsNode);
}
return node;
}
示例14: OnRequestDispatched
void OnRequestDispatched(object sender, OSGeo.MapGuide.MaestroAPI.RequestEventArgs e)
{
string msg = string.Format("[{0}]: {1}", DateTime.Now.ToString("dd MMM yyyy hh:mm:ss"), e.Data); //NOXLATE
if (!txtMessages.IsDisposed)
{
if (txtMessages.InvokeRequired)
{
txtMessages.Invoke(new MethodInvoker(() =>
{
txtMessages.AppendText(msg + Environment.NewLine);
txtMessages.ScrollToCaret();
}));
}
else
{
txtMessages.AppendText(msg + Environment.NewLine);
txtMessages.ScrollToCaret();
}
}
}
示例15: TransformTo
public int TransformTo(OSGeo.OSR.SpatialReference reference)
{
int ret = OgrPINVOKE.Geometry_TransformTo(swigCPtr, OSGeo.OSR.SpatialReference.getCPtr(reference));
if (OgrPINVOKE.SWIGPendingException.Pending) throw OgrPINVOKE.SWIGPendingException.Retrieve();
return ret;
}