public void TestMultiPointShapePosition() { MultiPointShape points = new MultiPointShape(m_recordNumber, m_metadata, m_extent, m_positions); Assert.AreEqual(m_positions[0], points[0]); Assert.AreEqual(new Cartographic(Constants.RadiansPerDegree, Constants.RadiansPerDegree, 1.0), points[1]); }
public override void Write() { MultiPointShape multipoint = (MultiPointShape)m_shape; for (int i = 0; i < multipoint.Count; i++) { this.WritePacket(i); } }
public void TestMultiPoint() { Cartographic[] points = new Cartographic[] { new Cartographic(0.0, 0.0, 0.0), new Cartographic(1.0, 1.0, 1.0), new Cartographic(2.0, 2.0, 2.0) }; CartographicExtent extent = new CartographicExtent(0.0, 0.0, 2.0, 2.0); MultiPointShape multipoint = new MultiPointShape(0, m_metadata, extent, points); MultiPoint mp = new MultiPoint(multipoint, m_document, Color.Blue); mp.Write(); string result = m_stringWriter.ToString(); Regex pointPattern = new Regex(m_pointPattern); Assert.AreEqual(3, pointPattern.Matches(result).Count); }
/// <summary> /// Writes each point to its <see cref="CzmlDocument"/> as a separate packet. /// </summary> private void WritePacket(int index) { using (PacketCesiumWriter packetWriter = m_document.CesiumStreamWriter.OpenPacket(m_document.CesiumOutputStream)) { packetWriter.WriteId(Guid.NewGuid().ToString()); MultiPointShape multipoint = (MultiPointShape)m_shape; using (PositionCesiumWriter position = packetWriter.OpenPositionProperty()) { position.WriteCartographicRadians(multipoint[index]); } using (PointCesiumWriter pointWriter = packetWriter.OpenPointProperty()) { pointWriter.WriteColorProperty(m_color); } } }
public void TestMultiPointShapeType() { MultiPointShape points = new MultiPointShape(m_recordNumber, m_metadata, m_extent, m_positions); Assert.AreEqual(ShapeType.MultiPoint, points.ShapeType); }
/// <summary> /// Initializes a new instance of the <see cref="MultiPoint"/> class. /// </summary> /// <param name="multipoint">A MultiPointShape object read from a shapefile.</param> /// <param name="document">The CzmlDocument to write to.</param> /// <param name="color">The points's color.</param> public MultiPoint(MultiPointShape multipoint, CzmlDocument document, Color color) : base(document, color) { m_shape = multipoint; }