Beispiel #1
0
 private static void ExportSpatialReference(int export_flags, com.epl.geometry.SpatialReference spatial_reference, com.epl.geometry.JsonWriter json_writer)
 {
     if (spatial_reference != null)
     {
         int wkid = spatial_reference.GetLatestID();
         if (wkid <= 0)
         {
             throw new com.epl.geometry.GeometryException("invalid call");
         }
         json_writer.StartObject();
         json_writer.AddFieldName("type");
         json_writer.AddValueString("name");
         json_writer.AddFieldName("properties");
         json_writer.StartObject();
         json_writer.AddFieldName("name");
         string authority = ((com.epl.geometry.SpatialReferenceImpl)spatial_reference).GetAuthority();
         authority = authority.ToUpper();
         System.Text.StringBuilder crs_identifier = new System.Text.StringBuilder(authority);
         crs_identifier.Append(':');
         crs_identifier.Append(wkid);
         json_writer.AddValueString(crs_identifier.ToString());
         json_writer.EndObject();
         json_writer.EndObject();
     }
     else
     {
         json_writer.AddValueNull();
     }
 }
Beispiel #2
0
 // Mirrors wkt
 private static void PointTaggedText_(int precision, bool bFixedPoint, bool b_export_zs, bool b_export_ms, double x, double y, double z, double m, com.epl.geometry.JsonWriter json_writer)
 {
     json_writer.AddFieldName("type");
     json_writer.AddValueString("Point");
     json_writer.AddFieldName("coordinates");
     if (com.epl.geometry.NumberUtils.IsNaN(x))
     {
         json_writer.StartArray();
         json_writer.EndArray();
         return;
     }
     PointText_(precision, bFixedPoint, b_export_zs, b_export_ms, x, y, z, m, json_writer);
 }
Beispiel #3
0
 // Mirrors wkt
 private static void PolygonTaggedTextFromEnvelope_(int precision, bool bFixedPoint, bool b_export_zs, bool b_export_ms, double xmin, double ymin, double xmax, double ymax, double zmin, double zmax, double mmin, double mmax, com.epl.geometry.JsonWriter json_writer)
 {
     json_writer.AddFieldName("type");
     json_writer.AddValueString("Polygon");
     json_writer.AddFieldName("coordinates");
     if (com.epl.geometry.NumberUtils.IsNaN(xmin))
     {
         json_writer.StartArray();
         json_writer.EndArray();
         return;
     }
     WriteEnvelopeAsGeoJsonPolygon_(precision, bFixedPoint, b_export_zs, b_export_ms, xmin, ymin, xmax, ymax, zmin, zmax, mmin, mmax, json_writer);
 }
Beispiel #4
0
 // Mirrors wkt
 private static void PolygonTaggedText_(int precision, bool bFixedPoint, bool b_export_zs, bool b_export_ms, com.epl.geometry.AttributeStreamOfDbl zs, com.epl.geometry.AttributeStreamOfDbl ms, com.epl.geometry.AttributeStreamOfDbl position, com.epl.geometry.AttributeStreamOfInt32
                                        paths, int path_count, com.epl.geometry.JsonWriter json_writer)
 {
     json_writer.AddFieldName("type");
     json_writer.AddValueString("Polygon");
     json_writer.AddFieldName("coordinates");
     if (position == null)
     {
         json_writer.StartArray();
         json_writer.EndArray();
         return;
     }
     PolygonText_(precision, bFixedPoint, b_export_zs, b_export_ms, zs, ms, position, paths, 0, path_count, json_writer);
 }
Beispiel #5
0
 // Mirrors wkt
 private static void MultiPointTaggedText_(int precision, bool bFixedPoint, bool b_export_zs, bool b_export_ms, com.epl.geometry.AttributeStreamOfDbl zs, com.epl.geometry.AttributeStreamOfDbl ms, com.epl.geometry.AttributeStreamOfDbl position, int point_count, com.epl.geometry.JsonWriter
                                           json_writer)
 {
     json_writer.AddFieldName("type");
     json_writer.AddValueString("MultiPoint");
     json_writer.AddFieldName("coordinates");
     if (position == null)
     {
         json_writer.StartArray();
         json_writer.EndArray();
         return;
     }
     LineStringText_(false, false, precision, bFixedPoint, b_export_zs, b_export_ms, zs, ms, position, 0, point_count, json_writer);
 }
Beispiel #6
0
        // Mirrors wkt
        private static void LineStringTaggedText_(int precision, bool bFixedPoint, bool b_export_zs, bool b_export_ms, com.epl.geometry.AttributeStreamOfDbl zs, com.epl.geometry.AttributeStreamOfDbl ms, com.epl.geometry.AttributeStreamOfDbl position, com.epl.geometry.AttributeStreamOfInt8
                                                  path_flags, com.epl.geometry.AttributeStreamOfInt32 paths, com.epl.geometry.JsonWriter json_writer)
        {
            json_writer.AddFieldName("type");
            json_writer.AddValueString("LineString");
            json_writer.AddFieldName("coordinates");
            if (position == null)
            {
                json_writer.StartArray();
                json_writer.EndArray();
                return;
            }
            bool b_closed = ((path_flags.Read(0) & com.epl.geometry.PathFlags.enumClosed) != 0);

            LineStringText_(false, b_closed, precision, bFixedPoint, b_export_zs, b_export_ms, zs, ms, position, 0, paths.Read(1), json_writer);
        }