⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shapeinfo.cs

📁 Welcome to MS4W, the no fuss installer for setting up MapServer on Microsoft Windows platforms. The
💻 CS
字号:
using System;
using System.Collections;

/**
 * <p>Title: Mapscript shapeinfo example.</p>
 * <p>Description: A Java based mapscript example to dump information from a shapefile.</p>
 * @author Yew K Choo (ykchoo@geozervice.com)
 * @version 1.0
 */

/// <summary>
/// A C# based mapscript mapscript to dump information from a shapefile.
/// </summary> 
class ShapeInfo {
	
  public static void usage() 
  { 
	Console.WriteLine("usage: shapeinfo {shapefile}");
	System.Environment.Exit(-1);
  }
  
  	
  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 + ")");
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -