import junit.framework.TestCase;

public class ShapeFileTest extends TestCase {

	ShapeFile shp = null;
	ShapeFile shp2 = null;

	public void testRead() {
		shp = new ShapeFile();
		shp.setFileName("data/sinnamary1988_1_latlong.shp");
		shp.setCrsEPSG("EPSG:4326");
	}

	public void testReadMares() {
		shp = new ShapeFile();
		shp.setFileName("data/2mares.shp");
		shp.setCrsEPSG("EPSG:32628");
	}

	public void testBuffer() {
		shp = new ShapeFile();
		shp.setFileName("data/2mares.shp");
		shp.setCrsEPSG("EPSG:32628");

		shp2 = new ShapeFile();
		shp2.definePolygonAttribute("the_geom");
		shp2.buildSchema("Buffer");
		shp2.setCrsEPSG("EPSG:32628");

		while (shp.hasNextRecord()) {
			ShpRecord sr2 = shp2.createEmptyShpRecord();
			sr2.setMPolygonBuffer(shp.getNextRecord(), 20);
		}
	}

	public void testView() {
		// testRead();
		testBuffer();
		if (shp != null)
			shp.view();
		else
			System.out.println("Shp C'est null !");
	}

}
