/// <summary>
        /// Converts a linestring to osm objects.
        /// </summary>
        /// <param name="lineString"></param>
        /// <returns></returns>
        private static Feature ConvertLineString(OsmSharp.IO.Xml.Kml.v2_0_response.LineString lineString)
        {
            // convert the coordinates.
            var coordinates = KmlFeatureStreamSource.ConvertCoordinates(lineString.coordinates);

            // create the ring.
            var feature = new Feature(new LineString(coordinates));

            feature.Attributes.Add("id", lineString.id);

            return(feature);
        }
Esempio n. 2
0
        /// <summary>
        /// Converts a linestring to osm objects.
        /// </summary>
        /// <param name="lineString"></param>
        /// <returns></returns>
        private static LineString ConvertLineString(OsmSharp.IO.Xml.Kml.v2_0_response.LineString lineString)
        {
            // convert the coordinates.
            IList <GeoCoordinate> coordinates = KmlGeoStreamSource.ConvertCoordinates(lineString.coordinates);

            // create the ring.
            LineString lineStringGeometry = new LineString(coordinates);

            lineStringGeometry.Attributes = new SimpleGeometryAttributeCollection();
            lineStringGeometry.Attributes.Add("id", lineString.id);

            return(lineStringGeometry);
        }