Ejemplo n.º 1
0
        // Needed?
        #endregion

        #region Import
        public static AgGateway.ADAPT.ApplicationDataModel.Shapes.Shape Map(Feature feature, AffineTransformation affineTransformation = null)
        {
            // ToDo: importing different GeoJSONObjectTypes
            switch (feature.Type)
            {
            case GeoJSON.Net.GeoJSONObjectType.Point:
                return(PointMapper.MapPosition(((GeoJSON.Net.Geometry.Point)feature.Geometry).Coordinates, affineTransformation));

            case GeoJSON.Net.GeoJSONObjectType.MultiPoint:
                break;

            case GeoJSON.Net.GeoJSONObjectType.LineString:
                return(LineStringMapper.MapLineString((GeoJSON.Net.Geometry.LineString)feature.Geometry, affineTransformation));

            case GeoJSON.Net.GeoJSONObjectType.MultiLineString:
                break;

            case GeoJSON.Net.GeoJSONObjectType.Polygon:
                return(PolygonMapper.MapPolygon((GeoJSON.Net.Geometry.Polygon)feature.Geometry, affineTransformation));

            case GeoJSON.Net.GeoJSONObjectType.MultiPolygon:
                return(MultiPolygonMapper.MapMultiPolygon((GeoJSON.Net.Geometry.MultiPolygon)feature.Geometry, affineTransformation));

            case GeoJSON.Net.GeoJSONObjectType.GeometryCollection:
                break;

            case GeoJSON.Net.GeoJSONObjectType.Feature:
                break;

            case GeoJSON.Net.GeoJSONObjectType.FeatureCollection:
                break;
            }
            return(null);
        }
Ejemplo n.º 2
0
//<<<<<<< HEAD
        public static GeoJSON.Net.Geometry.LineString MapLineString(AgGateway.ADAPT.ApplicationDataModel.Shapes.Point a, AgGateway.ADAPT.ApplicationDataModel.Shapes.Point b, AffineTransformation affineTransformation = null)
        {
            var positions = new List <Position>();
            var positionA = PointMapper.MapPoint(a, affineTransformation);
            var positionB = PointMapper.MapPoint(b, affineTransformation);

            positions.Add(positionA);
            positions.Add(positionB);

            return(new GeoJSON.Net.Geometry.LineString(positions));
        }
Ejemplo n.º 3
0
        public static AgGateway.ADAPT.ApplicationDataModel.Shapes.LinearRing MapLineString(GeoJSON.Net.Geometry.LineString lineString, AffineTransformation affineTransformation = null)
        {
            // ToDo: [Check] if the LineString is actually a LinearRing
            var linearRing = new AgGateway.ADAPT.ApplicationDataModel.Shapes.LinearRing();

            foreach (var position in lineString.Coordinates)
            {
                linearRing.Points.Add(PointMapper.MapPosition(position, affineTransformation));
            }

            return(linearRing);
        }
Ejemplo n.º 4
0
        public static GeoJSON.Net.Geometry.LineString MapLineString(AgGateway.ADAPT.ApplicationDataModel.Shapes.LinearRing adaptLinearRing, AffineTransformation affineTransformation = null)
        {
            var positions = new List <Position>();

            foreach (var point in adaptLinearRing.Points)
            {
                var position = PointMapper.MapPoint(point, affineTransformation);
                positions.Add(position);
            }

            return(new GeoJSON.Net.Geometry.LineString(positions));
        }