Exemplo n.º 1
0
    public static void Main(string[] args)
    {
        if (args.Length != 1)
        {
            usage();
        }

        shapefileObj sf_obj = new shapefileObj(args[0], -1);
        shapeObj     s_obj  = new shapeObj(-1);

        for (int i = 0; i < sf_obj.numshapes; i++)
        {
            sf_obj.get(i, s_obj);
            Console.WriteLine("Shape " + i + " has " + s_obj.numlines + " part(s)");
            Console.WriteLine("bounds (" + s_obj.bounds.minx + ", " + s_obj.bounds.miny + ") (" + s_obj.bounds.maxx + ", " + s_obj.bounds.maxy + ")");
            for (int j = 0; j < s_obj.numlines; j++)
            {
                lineObj l_obj = s_obj.get(j);
                Console.WriteLine("Part " + j + " has " + l_obj.numpoints + " points.");

                for (int k = 0; k < l_obj.numpoints; k++)
                {
                    pointObj p_obj = l_obj.get(k);
                    Console.WriteLine(k + ": " + p_obj.x + ", " + p_obj.y);
                }
            }
        }
    }
 internal static HandleRef getCPtrAndSetReference(shapefileObj obj, object parent) {
   if (obj != null)
   {
     obj.swigParentRef = parent;
     return obj.swigCPtr;
   }
   else
   {
     return new HandleRef(null, IntPtr.Zero);
   }
 }
Exemplo n.º 3
0
  public static void Main(string[] args) {
	 
	if (args.Length != 1) usage();

	Hashtable ht = new Hashtable();
	ht.Add(1,"point");	
	ht.Add(3,"arc");	
	ht.Add(5,"polygon");
	ht.Add(8,"multipoint");
		
    shapefileObj shpObj = new shapefileObj(args[0],-1); 
    Console.WriteLine ("ShapeType = " + ht[shpObj.type]);
    Console.WriteLine ("Num shapes = " + shpObj.numshapes);
    Console.WriteLine ("(xmin, ymin) = (" + shpObj.bounds.minx + "," + shpObj.bounds.miny + ") (xmax, ymax) = (" + shpObj.bounds.maxx + "," + shpObj.bounds.maxy + ")");
  }
Exemplo n.º 4
0
    public static void Main(string[] args)
    {
        if (args.Length != 1)
        {
            usage();
        }

        Hashtable ht = new Hashtable();

        ht.Add(1, "point");
        ht.Add(3, "arc");
        ht.Add(5, "polygon");
        ht.Add(8, "multipoint");

        shapefileObj shpObj = new shapefileObj(args[0], -1);

        Console.WriteLine("ShapeType = " + ht[shpObj.type]);
        Console.WriteLine("Num shapes = " + shpObj.numshapes);
        Console.WriteLine("(xmin, ymin) = (" + shpObj.bounds.minx + "," + shpObj.bounds.miny + ") (xmax, ymax) = (" + shpObj.bounds.maxx + "," + shpObj.bounds.maxy + ")");
    }
Exemplo n.º 5
0
  public static void Main(string[] args) {

	if (args.Length != 1) usage();
		  
 	shapefileObj sf_obj = new shapefileObj(args[0],-1); 
	shapeObj s_obj = new shapeObj(-1);
	for (int i=0; i<sf_obj.numshapes; i++) 
	{
	  sf_obj.get(i, s_obj);
	  Console.WriteLine("Shape " + i + " has " + s_obj.numlines + " part(s)");
	  Console.WriteLine("bounds (" + s_obj.bounds.minx + ", " +  s_obj.bounds.miny + ") (" + s_obj.bounds.maxx + ", " + s_obj.bounds.maxy + ")" );
	  for(int j=0; j<s_obj.numlines; j++) 
	  {
		lineObj l_obj = s_obj.get(j);
		Console.WriteLine("Part " + j + " has " + l_obj.numpoints + " points.");
                    
		for(int k=0; k < l_obj.numpoints; k++) {
		  pointObj p_obj = l_obj.get(k);                     
          Console.WriteLine(k +": " + p_obj.x + ", " + p_obj.y);							
		}
	  }	  
    }
  }
 internal static HandleRef getCPtr(shapefileObj obj) {
   return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }