org.geotools.demo
Class FirstProject

java.lang.Object
  extended by org.geotools.demo.FirstProject

public class FirstProject
extends java.lang.Object

The example code for the "FirstProject" in the GeoTools wiki.

This code matches these examples:

The code illustrates how to open a shapefile and collect data about the features contained within it.

Author:
Jody Garnett

Constructor Summary
FirstProject()
           
 
Method Summary
static void main(java.lang.String[] args)
          Opens a shapefile provided by the user (that should contain line or polygon features), then iterates over the features within it to calculate the sum of their line or boundary length.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FirstProject

public FirstProject()
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Opens a shapefile provided by the user (that should contain line or polygon features), then iterates over the features within it to calculate the sum of their line or boundary length. The user can specify the path/name of the shapefile as an argument on the command line; otherwise a dialog is displayed to prompt for the file.

Note: If specifying the shapefile at the command line, don't forget the quotes around your path if there are spaces!

The code for this method illustrates:

Parameters:
args - Optionally, the path and name of the shapefile
Throws:
java.lang.Exception - if the shapefile cannot be opened


Copyright © 1996-2010 Geotools. All Rights Reserved.