예제 #1
0
        /// <summary>
        /// Converts a line string into an osm object.
        /// </summary>
        /// <param name="lineString"></param>
        /// <returns></returns>
        private static Feature ConvertLineString(OsmSharp.IO.Xml.Kml.v2_1.LineStringType 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);
        }
예제 #2
0
        /// <summary>
        /// Converts a point into an osm object.
        /// </summary>
        /// <param name="point"></param>
        /// <returns></returns>
        private static Feature ConvertPoint(OsmSharp.IO.Xml.Kml.v2_0_response.Point point)
        {
            // convert the coordiantes.
            var coordinates = KmlFeatureStreamSource.ConvertCoordinates(point.coordinates);

            // create the point.
            var feature = new Feature(new Point(coordinates[0]));

            if (point.altitudeModeSpecified)
            {
                feature.Attributes.Add("altitude", point.altitudeMode);
            }
            if (point.extrudeSpecified)
            {
                feature.Attributes.Add("extrude", point.extrude);
            }
            if (point.id != null)
            {
                feature.Attributes.Add("id", point.id);
            }

            return(feature);
        }
예제 #3
0
        private static Feature ConvertPoint(PointType point)
        {
            Feature feature = new Feature((Geometry) new OsmSharp.Geo.Geometries.Point(KmlFeatureStreamSource.ConvertCoordinates(point.coordinates)[0]));

            if (point.targetId != null)
            {
                feature.Attributes.Add("targetId", (object)point.targetId);
            }
            feature.Attributes.Add("altitude", (object)point.altitudeMode);
            if (point.extrude)
            {
                feature.Attributes.Add("extrude", (object)point.extrude);
            }
            if (point.id != null)
            {
                feature.Attributes.Add("id", (object)point.id);
            }
            return(feature);
        }
예제 #4
0
 private static Feature ConvertLineString(LineStringType lineString)
 {
     return(new Feature((Geometry) new OsmSharp.Geo.Geometries.LineString((IEnumerable <GeoCoordinate>)KmlFeatureStreamSource.ConvertCoordinates(lineString.coordinates)))
     {
         Attributes =
         {
             {
                 "id",
                 (object)lineString.id
             }
         }
     });
 }
예제 #5
0
        private static Feature ConvertPoint(OsmSharp.IO.Xml.Kml.v2_0_response.Point point)
        {
            Feature feature = new Feature((Geometry) new OsmSharp.Geo.Geometries.Point(KmlFeatureStreamSource.ConvertCoordinates(point.coordinates)[0]));

            if (point.altitudeModeSpecified)
            {
                feature.Attributes.Add("altitude", (object)point.altitudeMode);
            }
            if (point.extrudeSpecified)
            {
                feature.Attributes.Add("extrude", (object)point.extrude);
            }
            if (point.id != null)
            {
                feature.Attributes.Add("id", (object)point.id);
            }
            return(feature);
        }
예제 #6
0
 private static Feature ConvertLinearRing(OsmSharp.IO.Xml.Kml.v2_0_response.LinearRing linearRing)
 {
     return(new Feature((Geometry) new LineairRing((IEnumerable <GeoCoordinate>)KmlFeatureStreamSource.ConvertCoordinates(linearRing.coordinates)))
     {
         Attributes =
         {
             {
                 "id",
                 (object)linearRing.id
             }
         }
     });
 }