Exemple #1
0
        public string Write(IGeoJsonObject obj)
        {
            var geometry = obj as IGeoJsonGeometry;

            if (geometry != null)
            {
                return(Write(geometry));
            }

            var feature = obj as Feature;

            if (feature != null)
            {
                return(Write(feature));
            }

            var featureCollection = obj as FeatureCollection;

            if (featureCollection != null)
            {
                return(Write(featureCollection));
            }

            throw new SerializationException("Object of type '" + obj.GetType().Name + "' is not supported by GeoJSON");
        }
Exemple #2
0
        public string Write(IGeoJsonObject obj)
        {
            var geometry = obj as IGeoJsonGeometry;
            if (geometry != null)
                return Write(geometry);

            var feature = obj as Feature;
            if (feature != null)
                return Write(feature);

            var featureCollection = obj as FeatureCollection;
            if (featureCollection != null)
                return Write(featureCollection);

            throw new SerializationException("Object of type '" + obj.GetType().Name + "' is not supported by GeoJSON");
        }
Exemple #3
0
 public static string Serialize(IGeoJsonObject obj)
 {
     return(Writer.Write(obj));
 }
Exemple #4
0
 public static string Serialize(IGeoJsonObject obj)
 {
     return Writer.Write(obj);
 }