本文整理汇总了C#中OSGeo类的典型用法代码示例。如果您正苦于以下问题:C# OSGeo类的具体用法?C# OSGeo怎么用?C# OSGeo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OSGeo类属于命名空间,在下文中一共展示了OSGeo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: SectionInfoCtrl
public SectionInfoCtrl(IDrawingService drawSvc, string drawingSourceId, OSGeo.MapGuide.ObjectModels.Common.DrawingSectionListSection section)
: this()
{
_drawSvc = drawSvc;
_drawingSourceId = drawingSourceId;
_section = section;
}
开发者ID:kanbang,项目名称:Colt,代码行数:7,代码来源:SectionInfoCtrl.cs
示例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);
}
开发者ID:kanbang,项目名称:Colt,代码行数:34,代码来源:CopyMoveToAnotherServerCommand.cs
示例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);
}
开发者ID:kanbang,项目名称:Colt,代码行数:7,代码来源:LocalPreviewer.cs
示例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;
}
开发者ID:geobabbler,项目名称:arcgis-ogr,代码行数:8,代码来源:ogrplugin_utils.cs
示例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);
}
开发者ID:zhouqime,项目名称:arcgis-ogr,代码行数:8,代码来源:OGRDataset.cs
示例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;
}
开发者ID:kanbang,项目名称:Colt,代码行数:8,代码来源:ResourcePropertiesCommand.cs
示例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);
}
开发者ID:LANDIS-II-Foundation,项目名称:Landis-Spatial-Modeling-Library,代码行数:9,代码来源:GdalBandIO.cs
示例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();
}
开发者ID:PedroMaitan,项目名称:sharpmap,代码行数:14,代码来源:GeoTransform.cs
示例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;
}
开发者ID:fgcartographix,项目名称:arcgis-ogr,代码行数:15,代码来源:ogrplugin_utils.cs
示例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;
}
开发者ID:petr-k,项目名称:arcgis-ogr,代码行数:16,代码来源:ogrplugin_utils.cs
示例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);
}
}
}
开发者ID:jumpinjackie,项目名称:fdotoolbox,代码行数:23,代码来源:Converter.cs
示例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;
}
}
}
开发者ID:kanbang,项目名称:Colt,代码行数:22,代码来源:VectorLayer110ItemTemplate.cs
示例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;
}
开发者ID:stophun,项目名称:fdotoolbox,代码行数:38,代码来源:NodeFactory.cs
示例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();
}
}
}
开发者ID:kanbang,项目名称:Colt,代码行数:21,代码来源:OutboundRequestViewer.cs
示例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;
}
开发者ID:wangfeilong321,项目名称:vdpm,代码行数:6,代码来源:Geometry.cs
示例16: Transform
public int Transform(OSGeo.OSR.CoordinateTransformation trans)
{
int ret = OgrPINVOKE.Geometry_Transform(swigCPtr, OSGeo.OSR.CoordinateTransformation.getCPtr(trans));
if (OgrPINVOKE.SWIGPendingException.Pending) throw OgrPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
开发者ID:wangfeilong321,项目名称:vdpm,代码行数:6,代码来源:Geometry.cs
示例17: AssignSpatialReference
public void AssignSpatialReference(OSGeo.OSR.SpatialReference reference)
{
OgrPINVOKE.Geometry_AssignSpatialReference(swigCPtr, OSGeo.OSR.SpatialReference.getCPtr(reference));
if (OgrPINVOKE.SWIGPendingException.Pending) throw OgrPINVOKE.SWIGPendingException.Retrieve();
}
开发者ID:wangfeilong321,项目名称:vdpm,代码行数:5,代码来源:Geometry.cs
示例18: FdoMultiClassPicker
internal FdoMultiClassPicker(string title, string message, OSGeo.FDO.Schema.FeatureSchemaCollection schemas)
: this()
{
_schemas = schemas;
_presenter = new FdoMultiClassPickerPresenter(this, title, message);
}
开发者ID:jumpinjackie,项目名称:fdotoolbox,代码行数:6,代码来源:FdoMultiClassPicker.cs
示例19: LoadOgrFeatureToFeatureDataRow
private static FeatureDataRow LoadOgrFeatureToFeatureDataRow(FeatureDataTable table, OSGeo.OGR.Feature ogrFeature, GeoAPI.Geometries.IGeometryFactory factory)
{
var values = new object[ogrFeature.GetFieldCount()];
for (var iField = 0; iField < ogrFeature.GetFieldCount(); iField++)
{
// No need to get field value if there's no value available...
if (!ogrFeature.IsFieldSet(iField))
{
continue;
}
int count;
switch (ogrFeature.GetFieldType(iField))
{
case OgrFieldType.OFTString:
case OgrFieldType.OFTWideString:
values[iField] = ogrFeature.GetFieldAsString(iField);
break;
case OgrFieldType.OFTStringList:
case OgrFieldType.OFTWideStringList:
values[iField] = ogrFeature.GetFieldAsStringList(iField);
break;
case OgrFieldType.OFTInteger:
values[iField] = ogrFeature.GetFieldAsInteger(iField);
break;
case OgrFieldType.OFTIntegerList:
values[iField] = ogrFeature.GetFieldAsIntegerList(iField, out count);
break;
case OgrFieldType.OFTReal:
values[iField] = ogrFeature.GetFieldAsDouble(iField);
break;
case OgrFieldType.OFTRealList:
values[iField] = ogrFeature.GetFieldAsDoubleList(iField, out count);
break;
case OgrFieldType.OFTDate:
case OgrFieldType.OFTDateTime:
case OgrFieldType.OFTTime:
Int32 y, m, d, h, mi, s, tz;
ogrFeature.GetFieldAsDateTime(iField, out y, out m, out d, out h, out mi, out s, out tz);
try
{
if (y == 0 && m == 0 && d == 0)
values[iField] = DateTime.MinValue.AddMinutes(h * 60 + mi);
else
values[iField] = new DateTime(y, m, d, h, mi, s);
}
// ReSharper disable once EmptyGeneralCatchClause
catch { }
break;
default:
Debug.WriteLine("Cannot handle Ogr DataType '{0}'", ogrFeature.GetFieldType(iField));
break;
}
}
var fdr = (FeatureDataRow)table.LoadDataRow(values, true);
using (var gr = ogrFeature.GetGeometryRef())
{
fdr.Geometry = ParseOgrGeometry(gr, factory);
gr.Dispose();
}
return fdr;
}
开发者ID:lishxi,项目名称:_SharpMap,代码行数:65,代码来源:OgrProvider.cs
示例20: SupportsCommand
/// <summary>
/// Indicates if a specified custom command is supported and can be created
/// </summary>
/// <param name="cmdType"></param>
/// <returns></returns>
public bool SupportsCommand(OSGeo.MapGuide.MaestroAPI.Commands.CommandType cmdType)
{
return Array.IndexOf(_conn.Capabilities.SupportedCommands, (int)cmdType) >= 0;
}
开发者ID:kanbang,项目名称:Colt,代码行数:9,代码来源:ResourceEditorServiceBase.cs
注:本文中的OSGeo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论