/// <summary>
        /// This method populates the given sink with the information about the geography instance
        /// extracted from the KML string
        /// </summary>
        /// <param name="sink">Sink to be filled</param>
        /// <param name="makeValid">If true and the extracted geography instance is invalid then the MakeValid
        /// function will be executed on the extracted geography instance</param>
        public void Populate(
            IGeographySink sink,
            bool makeValid)
        {
            sink.SetSrid(m_Srid);

            int numOfGeographies = m_Parser.Geographies.Count;

            if (numOfGeographies == 1)
            {
                m_Parser.Geographies[0].Populate(sink, makeValid);
            }
            else if (numOfGeographies > 1)
            {
                sink.BeginGeography(OpenGisGeographyType.GeometryCollection);

                foreach (Geography g in m_Parser.Geographies)
                {
                    g.Populate(sink, makeValid);
                }

                sink.EndGeography();
            }
            else
            {
                // Geography instance is not found. The empty geography collection will be generated.
                sink.BeginGeography(OpenGisGeographyType.GeometryCollection);
                sink.EndGeography();
            }
        }
Example #2
0
 public void SetSrid(int srid)
 {
     _target.SetSrid(srid);
 }
 public Unprojector(SqlProjection projection, IGeographySink sink, int newSrid)
 {
     _projection = projection;
     _sink       = sink;
     _sink.SetSrid(newSrid);
 }
 public void SetSrid(int srid)
 {
     _sink.SetSrid(srid);
 }
 public void SetSrid(int srid)
 {
     m_srid = srid;
     m_sink.SetSrid(srid);
 }