Esempio n. 1
0
        public static Geometry FromGeoJson(geoJson.IGeometryObject geometry)
        {
            switch (geometry.Type)
            {
            case GeoJSONObjectType.LineString:
                return(From((geoJson.LineString)geometry));

            case GeoJSONObjectType.MultiLineString:
                return(From((geoJson.MultiLineString)geometry));

            case GeoJSONObjectType.Polygon:
                return(From((geoJson.Polygon)geometry));

            case GeoJSONObjectType.MultiPolygon:
                return(From((geoJson.MultiPolygon)geometry));

            default:
                throw new Exception("Ukjent geometritype '" + geometry.Type + "'.");
            }
        }
Esempio n. 2
0
 public static JFeature.Feature Feature2JG(Feature feature)
 {
     JGeometry.IGeometryObject igeometry = Geometry2JG(feature.geometry);
     JFeature.Feature          jFeature  = new JFeature.Feature(igeometry, feature.attributes, feature.featureID.ToString());
     return(jFeature);
 }