/// <summary> /// Use this constructor for initializing this dataprovider with all necessary /// parameters to gather metadata from 'GetCapabilities' contract. /// </summary> public WFSProvider(IXPathQueryManager getCapabilitiesCache, string nsPrefix, string featureType, GeometryTypeEnum geometryType, WFSVersionEnum wfsVersion) { _featureTypeInfoQueryManager = getCapabilitiesCache; if (wfsVersion == WFSVersionEnum.WFS_1_0_0) { _textResources = new WFS_1_0_0_TextResources(); } else { _textResources = new WFS_1_1_0_TextResources(); } _wfsVersion = wfsVersion; if (string.IsNullOrEmpty(nsPrefix)) { ResolveFeatureType(featureType); } else { _nsPrefix = nsPrefix; _featureType = featureType; } _geometryType = geometryType; GetFeatureTypeInfo(); }
/// <summary> /// Use this constructor for initializing this dataprovider with all necessary /// parameters to gather metadata from 'GetCapabilities' contract. /// </summary> /// <param name="nsPrefix"> /// Use an empty string or 'null', if there is no prefix for the featuretype. /// </param> /// <param name="geometryType"> /// Specifying the geometry type helps to accelerate the rendering process, /// if the geometry type in 'DescribeFeatureType is unprecise. /// </param> public WFS(string getCapabilitiesURI, string nsPrefix, string featureType, GeometryTypeEnum geometryType, WFSVersionEnum wfsVersion) { _GetCapabilitiesURI = getCapabilitiesURI; if (wfsVersion == WFSVersionEnum.WFS1_0_0) { _TextResources = new WFS_1_0_0_TextResources(); } else { _TextResources = new WFS_1_1_0_TextResources(); } _WfsVersion = wfsVersion; if (string.IsNullOrEmpty(nsPrefix)) { resolveFeatureType(featureType); } else { _NsPrefix = nsPrefix; _FeatureType = featureType; } _GeometryType = geometryType; GetFeatureTypeInfo(); }
/// <summary> /// Initializes a new instance of the <see cref="WfsFeatureTypeInfo"/> class. /// </summary> /// <param name="nsPrefix"> /// Use an empty string or 'null', if there is no prefix for the featuretype. /// </param> /// <param name="featureTypeNamespace"> /// Use an empty string or 'null', if there is no namespace for the featuretype. /// You don't need to know the namespace of the feature type, if you use the quick geometries option. /// </param> /// <param name="geometryName"> /// The geometry name is the property of the featuretype from which geometry information can be obtained from. /// Usually this property is called something like 'Shape' or 'geom'. It is absolutely necessary to give this parameter. /// </param> /// <param name="geometryType"> /// Specifying the geometry type helps to accelerate the rendering process. /// </param> public WfsFeatureTypeInfo(string serviceURI, string nsPrefix, string featureTypeNamespace, string featureType, string geometryName, GeometryTypeEnum geometryType) { _ServiceURI = serviceURI; _Prefix = nsPrefix; _FeatureTypeNamespace = string.IsNullOrEmpty(featureTypeNamespace) ? string.Empty : featureTypeNamespace; _Name = featureType; _Geometry._GeometryName = geometryName; _Geometry._GeometryType = geometryType.ToString(); }
} // temp solution /// <summary> /// Initializes a new instance of the <see cref="WfsFeatureTypeInfo"/> class. /// </summary> /// <param name="serviceUri"></param> /// <param name="nsPrefix"> /// Use an empty string or 'null', if there is no prefix for the featuretype. /// </param> /// <param name="featureTypeNamespace"> /// Use an empty string or 'null', if there is no namespace for the featuretype. /// You don't need to know the namespace of the feature type, if you use the quick geometries option. /// </param> /// <param name="featureType"></param> /// <param name="geometryName"> /// The geometry name is the property of the featuretype from which geometry information can be obtained from. /// Usually this property is called something like 'Shape' or 'geom'. It is absolutely necessary to give this parameter. /// </param> /// <param name="geometryType"> /// Specifying the geometry type helps to accelerate the rendering process. /// </param> public WfsFeatureTypeInfo(string serviceUri, string nsPrefix, string featureTypeNamespace, string featureType, string geometryName, GeometryTypeEnum geometryType) { _serviceUri = serviceUri; _prefix = nsPrefix; _featureTypeNamespace = string.IsNullOrEmpty(featureTypeNamespace) ? string.Empty : featureTypeNamespace; _name = featureType; _geometry.GeometryName = geometryName; _geometry.GeometryType = geometryType.ToString(); }
/// <summary> /// Initializes a new instance of the <see cref="WfsFeatureTypeInfo"/> class. /// </summary> /// <param name="serviceUri"></param> /// <param name="nsPrefix"> /// Use an empty string or 'null', if there is no prefix for the featuretype. /// </param> /// <param name="featureTypeNamespace"> /// Use an empty string or 'null', if there is no namespace for the featuretype. /// You don't need to know the namespace of the feature type, if you use the quick geometries option. /// </param> /// <param name="featureType"></param> /// <param name="geometryName"> /// The geometry name is the property of the featuretype from which geometry information can be obtained from. /// Usually this property is called something like 'Shape' or 'geom'. It is absolutely necessary to give this parameter. /// </param> /// <param name="geometryType"> /// Specifying the geometry type helps to accelerate the rendering process. /// </param> public WfsFeatureTypeInfo(string serviceUri, string nsPrefix, string featureTypeNamespace, string featureType, string geometryName, GeometryTypeEnum geometryType) { _serviceUri = serviceUri; _prefix = nsPrefix; _featureTypeNamespace = string.IsNullOrEmpty(featureTypeNamespace) ? string.Empty : featureTypeNamespace; _name = featureType; _geometry.GeometryName = geometryName; _geometry.GeometryType = geometryType.ToString(); }
/// <summary> /// 渲染几何图形 /// </summary> /// <param name="g"></param> /// <param name="map"></param> /// <param name="feature"></param> protected void RenderGeometry(Graphics g, Map map, Geometry feature) { GeometryTypeEnum geometryType = feature.GeometryType; switch (geometryType) { case GeometryTypeEnum.Point: VectorRenderer.DrawPoint(g, (Point)feature, _style.PointColor, _style.PointSize, map); break; default: break; } }
/// <summary> /// Use this constructor for initializing this dataprovider with all mandatory /// metadata for retrieving a featuretype, so that 'GetCapabilities' and 'DescribeFeatureType' can be bypassed. /// </summary> public WFSProvider(string serviceUri, string nsPrefix, string featureTypeNamespace, string featureType, string geometryName, GeometryTypeEnum geometryType, WFSVersionEnum wfsVersion) { _featureTypeInfo = new WfsFeatureTypeInfo(serviceUri, nsPrefix, featureTypeNamespace, featureType, geometryName, geometryType); if (wfsVersion == WFSVersionEnum.WFS_1_0_0) { _textResources = new WFS_1_0_0_TextResources(); } else { _textResources = new WFS_1_1_0_TextResources(); } _wfsVersion = wfsVersion; }
/// <summary> /// 几何类型转换 /// </summary> /// <param name="geometry"></param> /// <returns></returns> public static string GeometryTypeToString(GeometryTypeEnum geometry) { switch (geometry) { case GeometryTypeEnum.None: return("NONE"); case GeometryTypeEnum.Point: return("P1"); case GeometryTypeEnum.Line: return("LINE"); default: return(GeometryTypeEnum.PolyLine.ToString().ToUpper());; } }
/// <summary> /// Use this constructor for initializing this dataprovider with all necessary /// parameters to gather metadata from 'GetCapabilities' contract. /// </summary> public WFSProvider(string getCapabilitiesUri, string nsPrefix, string featureType, GeometryTypeEnum geometryType, WFSVersionEnum wfsVersion) { _getCapabilitiesUri = getCapabilitiesUri; if (wfsVersion == WFSVersionEnum.WFS_1_0_0) _textResources = new WFS_1_0_0_TextResources(); else _textResources = new WFS_1_1_0_TextResources(); _wfsVersion = wfsVersion; if (string.IsNullOrEmpty(nsPrefix)) ResolveFeatureType(featureType); else { _nsPrefix = nsPrefix; _featureType = featureType; } _geometryType = geometryType; GetFeatureTypeInfo(); }
public void LoadObstacleInfo(string filename, KdObstacleTree tree, float scale) { using (FileStream fs = new FileStream(filename, FileMode.Open)) { while (fs.Position < fs.Length) { GeometryTypeEnum type = (GeometryTypeEnum)fs.ReadByte(); int ct = ReadInt(fs); if (ct > 0) { List <Vector3> pts = new List <Vector3>(); for (int i = 0; i < ct; ++i) { float x = (float)ReadInt(fs); float z = (float)ReadInt(fs); Vector3 pt = new Vector3(x / 100.0f, 0, z / 100.0f); pts.Add(pt); } switch (type) { case GeometryTypeEnum.WalkArea: case GeometryTypeEnum.ObstacleArea: AddObstacle(pts, true, tree, scale); break; case GeometryTypeEnum.ObstacleLine: AddObstacle(pts, false, tree, scale); break; } } else { break; } } fs.Close(); } }
/// <summary> /// Use this constructor for initializing this dataprovider with all necessary /// parameters to gather metadata from 'GetCapabilities' contract. /// </summary> /// <param name="getCapabilitiesCache"> /// This cache (obtained from an already instantiated dataprovider that retrieves a featuretype hosted by the same service) /// helps to speed up gathering metadata. It caches the 'GetCapabilities' response. ///</param> /// <param name="nsPrefix"> /// Use an empty string or 'null', if there is no prefix for the featuretype. /// </param> /// <param name="geometryType"> /// Specifying the geometry type helps to accelerate the rendering process, /// if the geometry type in 'DescribeFeatureType is unprecise. /// </param> /// <param name="featureType">The name of the feature type</param> /// <param name="wfsVersion">The desired WFS Server version.</param> public WFS(IXPathQueryManager getCapabilitiesCache, string nsPrefix, string featureType, GeometryTypeEnum geometryType, WFSVersionEnum wfsVersion) { _featureTypeInfoQueryManager = getCapabilitiesCache; if (wfsVersion == WFSVersionEnum.WFS1_0_0) _textResources = new WFS_1_0_0_TextResources(); else _textResources = new WFS_1_1_0_TextResources(); _wfsVersion = wfsVersion; if (string.IsNullOrEmpty(nsPrefix)) ResolveFeatureType(featureType); else { _nsPrefix = nsPrefix; _featureType = featureType; } _geometryType = geometryType; GetFeatureTypeInfo(); }
/// <summary> /// Use this constructor for initializing this dataprovider with all mandatory /// metadata for retrieving a featuretype, so that 'GetCapabilities' and 'DescribeFeatureType' can be bypassed. /// </summary> /// <param name="serviceURI">The service URL</param> /// <param name="nsPrefix"> /// Use an empty string or 'null', if there is no prefix for the featuretype. /// </param> /// <param name="featureTypeNamespace"> /// Use an empty string or 'null', if there is no namespace for the featuretype. /// You don't need to know the namespace of the feature type, if you use the quick geometries option. /// </param> /// <param name="geometryName"> /// The name of the geometry. /// </param> /// <param name="geometryType"> /// Specifying the geometry type helps to accelerate the rendering process. /// </param> /// <param name="featureType">The name of the feature type</param> /// <param name="wfsVersion">The desired WFS Server version.</param> public WFS(string serviceURI, string nsPrefix, string featureTypeNamespace, string featureType, string geometryName, GeometryTypeEnum geometryType, WFSVersionEnum wfsVersion) { _featureTypeInfo = new WfsFeatureTypeInfo(serviceURI, nsPrefix, featureTypeNamespace, featureType, geometryName, geometryType); if (wfsVersion == WFSVersionEnum.WFS1_0_0) _textResources = new WFS_1_0_0_TextResources(); else _textResources = new WFS_1_1_0_TextResources(); _wfsVersion = wfsVersion; }
/// <summary> /// Use this constructor for initializing this dataprovider with all necessary /// parameters to gather metadata from 'GetCapabilities' contract. /// </summary> /// <param name="nsPrefix"> /// Use an empty string or 'null', if there is no prefix for the featuretype. /// </param> /// <param name="geometryType"> /// Specifying the geometry type helps to accelerate the rendering process, /// if the geometry type in 'DescribeFeatureType is unprecise. /// </param> public WFS(string getCapabilitiesURI, string nsPrefix, string featureType, GeometryTypeEnum geometryType, WFSVersionEnum wfsVersion) { _GetCapabilitiesURI = getCapabilitiesURI; if (wfsVersion == WFSVersionEnum.WFS1_0_0) _TextResources = new WFS_1_0_0_TextResources(); else _TextResources = new WFS_1_1_0_TextResources(); _WfsVersion = wfsVersion; if (string.IsNullOrEmpty(nsPrefix)) resolveFeatureType(featureType); else { _NsPrefix = nsPrefix; _FeatureType = featureType; } _GeometryType = geometryType; GetFeatureTypeInfo(); }