@Before
  public void setUp() throws Exception {
    indexFile = File.createTempFile("idx-", ".idx");
    indexFile.delete();
    indexFile.deleteOnExit();

    super.setUpTestsWithoutEdition();

    sm.register("points", new File(TestResourceHandler.TESTRESOURCES, "points.shp"));
    sm.register("lines", new File(TestResourceHandler.TESTRESOURCES, "hedgerow.shp"));
    sm.register("pols", new File(TestResourceHandler.TESTRESOURCES, "landcover2000.shp"));
  }
Example #2
0
  @Before
  public void setUp() throws Exception {
    super.setUpTestsWithEdition(false);

    testFile = new File(TestResourceHandler.OTHERRESOURCES, "test.csv");
    testDB =
        new DBSource(
            null,
            0,
            TestResourceHandler.OTHERRESOURCES + "testhsqldb",
            "sa",
            "",
            "gisapps",
            "jdbc:hsqldb:file");
    testWMS = new WMSSource("127.0.0.1", "cantons", "EPSG:1234", "format/pig");
    obj = new MemoryDataSetDriver();
  }
Example #3
0
  @Before
  public void setUp() throws Exception {
    super.setUpTestsWithoutEdition();
    wktReader = new WKTReader();
    JTSMultiPolygon2D = wktReader.read("MULTIPOLYGON (((0 0, 1 1, 0 1, 0 0)))");
    JTSMultiLineString2D = wktReader.read("MULTILINESTRING ((0 0, 1 1, 0 1, 0 0))");
    JTSMultiPoint2D = wktReader.read("MULTIPOINT (0 0, 1 1, 0 1, 0 0)");
    JTSPolygon2D =
        wktReader.read(
            "POLYGON ((181 124, 87 162, 76 256, 166 315, 286 325, 373 255, 387 213, 377 159, 351 121, 298 101, 234 56, 181 124), (165 244, 227 219, 234 300, 168 288, 165 244), (244 130, 305 135, 324 186, 306 210, 272 206, 206 174, 244 130))");

    JTSLineString2D = wktReader.read("LINESTRING (1 1, 2 1, 2 2, 1 2, 1 1)");
    JTSLineString3D = wktReader.read("LINESTRING (1 1 1, 2 1 2, 2 2 3, 1 2 4, 1 1 5)");
    JTSPoint3D = wktReader.read("POINT(0 10 20)");
    JTSPoint2D = wktReader.read("POINT(0 10)");

    JTSPolygonWith2Holes =
        wktReader.read(
            "POLYGON ((85 55, 85 306, 366 306, 366 55, 85 55), (153 205, 212 173, 241 190, 251 253, 235 278, 147 254, 153 205), (262 88, 321 97, 324 153, 303 177, 240 138, 262 88))");

    GeometryFactory gf = new GeometryFactory();
    JTSGeometryCollection =
        gf.createGeometryCollection(
            new Geometry[] {JTSMultiPolygon2D, JTSMultiLineString2D, JTSPolygon2D});
    JTS3DCollection =
        gf.createGeometryCollection(new Geometry[] {JTSMultiPolygon2D, JTSLineString3D});

    // first datasource
    final MemoryDataSetDriver driver1 =
        new MemoryDataSetDriver(
            new String[] {"pk", "geom"},
            new Type[] {
              TypeFactory.createType(Type.INT, new PrimaryKeyConstraint()),
              TypeFactory.createType(Type.GEOMETRY)
            });

    // insert all filled rows...
    driver1.addValues(
        new Value[] {ValueFactory.createValue(1), ValueFactory.createValue(JTSMultiPolygon2D)});
    driver1.addValues(
        new Value[] {ValueFactory.createValue(2), ValueFactory.createValue(JTSMultiLineString2D)});
    driver1.addValues(
        new Value[] {ValueFactory.createValue(3), ValueFactory.createValue(JTSLineString2D)});
    driver1.addValues(
        new Value[] {ValueFactory.createValue(4), ValueFactory.createValue(JTSPolygon2D)});
    // and register this new driver...

    dsf.getSourceManager().register("ds1", driver1);

    // second datasource
    final MemoryDataSetDriver driver2 =
        new MemoryDataSetDriver(
            new String[] {"pk", "geom"},
            new Type[] {
              TypeFactory.createType(Type.INT, new PrimaryKeyConstraint()),
              TypeFactory.createType(Type.GEOMETRY)
            });

    driver1.addValues(
        new Value[] {ValueFactory.createValue(1), ValueFactory.createValue(JTSMultiPolygon2D)});
    // and register this new driver...
    dsf.getSourceManager().register("ds2", driver2);
  }
 @Before
 public void setUp() throws Exception {
   super.setUpTestsWithoutEdition();
 }
 @Before
 public void setUp() throws Exception {
   super.setUpTestsWithEdition(false);
 }
 @Before
 public void setUp() throws Exception {
   super.setUpTestsWithoutEdition();
   dsf.getSourceManager()
       .register("alltypes", new MemorySourceDefinition(new AllTypesObjectDriver(), "main"));
 }