Ejemplo n.º 1
0
        public static unsafe string Proj_as_wkt(IntPtr ctx, IntPtr pj, PJ_WKT_TYPE type, bool indentText = true)
        {
            if (indentText)
            {
                byte *wkt = proj_as_wkt(ctx, pj, type, null);
                return(wkt != null ? new string((sbyte *)wkt) : null);
            }
            else
            {
                byte[] optionBytes = System.Text.Encoding.ASCII.GetBytes("MULTILINE=NO\0");
                fixed(byte *ptr = optionBytes)
                {
                    byte **options = stackalloc byte *[1];

                    options[0] = ptr;
                    byte *wkt = proj_as_wkt(ctx, pj, type, options);

                    return(wkt != null ? new string((sbyte *)wkt) : null);
                }
            }
        }
Ejemplo n.º 2
0
 static unsafe extern byte *proj_as_wkt(IntPtr ctx, IntPtr pj, PJ_WKT_TYPE type, byte **options);