Java Code Examples for com.vividsolutions.jts.geom.GeometryFactory

The following examples show how to use com.vividsolutions.jts.geom.GeometryFactory. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: Getaviz   Source File: DiskLayout.java    License: Apache License 2.0 6 votes vote down vote up
private void calculateRadiusForOuterCircles(Disk disk) {
	List<Disk> innerDisks = disk.getInnerDisks();
	CoordinateList coordinates = new CoordinateList();
	for (Disk d : innerDisks) {
		coordinates.add(d.getCoordinates(), false);
	}
	
	GeometryFactory geoFactory = new GeometryFactory();
	MultiPoint innerCirclemultipoint = geoFactory.createMultiPoint(coordinates.toCoordinateArray());
	MinimumBoundingCircle mbc = new MinimumBoundingCircle(innerCirclemultipoint);

	final double radius = mbc.getRadius();

	disk.updatePosition(mbc.getCentre().x,mbc.getCentre().y);
	disk.setRadius(disk.getBorderWidth() + radius + calculateB(calculateD(disk.getMinArea(), radius), radius));
	disk.setInnerRadius(radius);
	normalizePositionOfInnerCircles(disk);
}
 
Example 2
Source Project: coordination_oru   Source File: PathEditor.java    License: GNU General Public License v3.0 6 votes vote down vote up
private Geometry makeObstacle(Pose p) {
	GeometryFactory gf = new GeometryFactory();
	Geometry geom = null;
	if (obstacleFootprint == null) {
		geom = gf.createPolygon(new Coordinate[] { new Coordinate(0.0,0.0), new Coordinate(0.0,OBSTACLE_SIZE), new Coordinate(OBSTACLE_SIZE,OBSTACLE_SIZE), new Coordinate(OBSTACLE_SIZE,0.0), new Coordinate(0.0,0.0) });
	}
	else {
		geom = gf.createPolygon(obstacleFootprint);
	}		
	AffineTransformation at = new AffineTransformation();
	at.rotate(p.getTheta());
	at.translate(p.getX(), p.getY());
	Geometry transGeom = at.transform(geom);
	Pose center = new Pose(p.getX(), p.getY(), p.getTheta());
	obstacles.add(transGeom);
	obstacleCenters.add(center);
	return transGeom;
}
 
Example 3
public GeometryConverterTest() {
	factory = new GeometryFactory(new PrecisionModel(), SRID);
	jtsC1 = new com.vividsolutions.jts.geom.Coordinate(10.0, 10.0);
	jtsC2 = new com.vividsolutions.jts.geom.Coordinate(20.0, 10.0);
	jtsC3 = new com.vividsolutions.jts.geom.Coordinate(20.0, 20.0);
	jtsC4 = new com.vividsolutions.jts.geom.Coordinate(10.0, 20.0);
	jtsC5 = new com.vividsolutions.jts.geom.Coordinate(12.0, 12.0);
	jtsC6 = new com.vividsolutions.jts.geom.Coordinate(12.0, 18.0);
	jtsC7 = new com.vividsolutions.jts.geom.Coordinate(18.0, 18.0);
	jtsC8 = new com.vividsolutions.jts.geom.Coordinate(18.0, 12.0);

	dtoC1 = new Coordinate(10.0, 10.0);
	dtoC2 = new Coordinate(20.0, 10.0);
	dtoC3 = new Coordinate(20.0, 20.0);
	dtoC4 = new Coordinate(10.0, 20.0);
	dtoC5 = new Coordinate(12.0, 12.0);
	dtoC6 = new Coordinate(12.0, 18.0);
	dtoC7 = new Coordinate(18.0, 18.0);
	dtoC8 = new Coordinate(18.0, 12.0);
}
 
Example 4
@Test
@DirtiesContext // adding a bean
public void testPersistAddFeatureTransaction() throws Exception {
	PersistTransactionRequest request = new PersistTransactionRequest();
	request.setCrs(CRS);
	FeatureTransaction featureTransaction = new FeatureTransaction();
	featureTransaction.setLayerId(LAYER_ID);
	Feature feature = new Feature();
	GeometryFactory factory = new GeometryFactory();
	Geometry circle =
			dtoConverter.toDto(geoService.createCircle(factory.createPoint(new Coordinate(0, 0)), 10, 10));
	feature.setGeometry(circle);
	featureTransaction.setNewFeatures(new Feature[] {feature});
	request.setFeatureTransaction(featureTransaction);
	PersistTransactionResponse response = (PersistTransactionResponse) dispatcher.execute(
			PersistTransactionRequest.COMMAND, request, null, "en");
	if (response.isError()) {
		response.getErrors().get(0).printStackTrace();
	}
	Assert.assertFalse(response.isError());
	Assert.assertNotNull(response.getFeatureTransaction());
	Feature[] newFeatures = response.getFeatureTransaction().getNewFeatures();
	Assert.assertEquals(1, newFeatures.length);
	Assert.assertNotNull(newFeatures[0].getId());
}
 
Example 5
@Test
public void testMergePolygon() throws Exception {
	MergePolygonRequest request = new MergePolygonRequest();
	GeometryFactory factory = new GeometryFactory();
	request.setPolygons(new Geometry[] {
			dtoConverter.toDto(geoService.createCircle(factory.createPoint(new Coordinate(0, 0)), 10, 10)),
			dtoConverter.toDto(geoService.createCircle(factory.createPoint(new Coordinate(5, 5)), 10, 10))});
	MergePolygonResponse response = (MergePolygonResponse) dispatcher.execute(
			MergePolygonRequest.COMMAND, request, null, "en");
	if (response.isError()) {
		response.getErrors().get(0).printStackTrace();
	}
	Assert.assertFalse(response.isError());
	Assert.assertNotNull(response.getGeometry());
	// @todo should verify that merge is correct
}
 
Example 6
public static Geometry randomSegmentsInGrid(Geometry g, int nPts) {
  Envelope env = FunctionsUtil.getEnvelopeOrDefault(g);
  GeometryFactory geomFact = FunctionsUtil.getFactoryOrDefault(g);

  int nCell = (int) Math.sqrt(nPts) + 1;

  double xLen = env.getWidth() / nCell;
  double yLen = env.getHeight() / nCell;

  List lines = new ArrayList();

  for (int i = 0; i < nCell; i++) {
    for (int j = 0; j < nCell; j++) {
      double x0 = env.getMinX() + i * xLen + xLen * Math.random();
      double y0 = env.getMinY() + j * yLen + yLen * Math.random();
      double x1 = env.getMinX() + i * xLen + xLen * Math.random();
      double y1 = env.getMinY() + j * yLen + yLen * Math.random();
      lines.add(geomFact.createLineString(new Coordinate[] {
          new Coordinate(x0, y0), new Coordinate(x1, y1) }));
    }
  }
  return geomFact.buildGeometry(lines);
}
 
Example 7
public static Geometry randomSegments(Geometry g, int nPts) {
  Envelope env = FunctionsUtil.getEnvelopeOrDefault(g);
  GeometryFactory geomFact = FunctionsUtil.getFactoryOrDefault(g);
  double xLen = env.getWidth();
  double yLen = env.getHeight();

  List lines = new ArrayList();

  for (int i = 0; i < nPts; i++) {
    double x0 = env.getMinX() + xLen * Math.random();
    double y0 = env.getMinY() + yLen * Math.random();
    double x1 = env.getMinX() + xLen * Math.random();
    double y1 = env.getMinY() + yLen * Math.random();
    lines.add(geomFact.createLineString(new Coordinate[] {
        new Coordinate(x0, y0), new Coordinate(x1, y1) }));
  }
  return geomFact.buildGeometry(lines);
}
 
Example 8
Source Project: jts   Source File: GeoJsonReader.java    License: GNU Lesser General Public License v2.1 6 votes vote down vote up
private Geometry createMultiPoint(Map<String, Object> geometryMap,
    GeometryFactory geometryFactory) throws ParseException {

  Geometry result = null;

  try {

    @SuppressWarnings("unchecked")
    List<List<Number>> coordinatesList = (List<List<Number>>) geometryMap
        .get(GeoJsonConstants.NAME_COORDINATES);

    CoordinateSequence coordinates = this
        .createCoordinateSequence(coordinatesList);

    result = geometryFactory.createMultiPoint(coordinates);

  } catch (RuntimeException e) {
    throw new ParseException(
        "Could not parse MultiPoint from GeoJson string.", e);
  }

  return result;
}
 
Example 9
public static Geometry randomRadialPoints(Geometry g, int nPts) {
  Envelope env = FunctionsUtil.getEnvelopeOrDefault(g);
  GeometryFactory geomFact = FunctionsUtil.getFactoryOrDefault(g);
  double xLen = env.getWidth();
  double yLen = env.getHeight();
  double rMax = Math.min(xLen, yLen) / 2.0;
  
  double centreX = env.getMinX() + xLen/2;
  double centreY = env.getMinY() + yLen/2;
  
  List pts = new ArrayList();

  for (int i = 0; i < nPts; i++) {
    double rand = Math.random();
    // use rand^2 to accentuate radial distribution
    double r = rMax * rand * rand;
    // produces even distribution
    //double r = rMax * Math.sqrt(rand);
    double ang = 2 * Math.PI * Math.random();
    double x = centreX + r * Math.cos(ang);
    double y = centreY + r * Math.sin(ang);
    pts.add(geomFact.createPoint(new Coordinate(x, y)));
  }
  return geomFact.buildGeometry(pts);
}
 
Example 10
public Polygon getResult()
{
  GeometryFactory gf = poly.getFactory();
  Polygon shell = gf.createPolygon((LinearRing) poly.getExteriorRing());
  PreparedGeometry shellPrep = PreparedGeometryFactory.prepare(shell);
  
  List holes = new ArrayList();
  for (int i = 0; i < poly.getNumInteriorRing(); i++) {
    LinearRing hole = (LinearRing) poly.getInteriorRingN(i);
    if (shellPrep.covers(hole)) {
      holes.add(hole);
    }
  }
  // all holes valid, so return original
  if (holes.size() == poly.getNumInteriorRing())
    return poly;
  
  // return new polygon with covered holes only
  Polygon result = gf.createPolygon((LinearRing) poly.getExteriorRing(), 
      GeometryFactory.toLinearRingArray(holes));
  return result;
}
 
Example 11
Geometry parseGeometry(JTextComponent txt, Color clr) {
    try {
        WKTReader rdr =
            new WKTReader(
                new GeometryFactory(JTSTestBuilder.model().getPrecisionModel(), 0));
        Geometry g = rdr.read(txt.getText());
        txtError.setText("");
        return g;
    } catch (Exception ex) {
        txtError.setText(ex.getMessage());
        txtError.setForeground(clr);
        parseError = true;
        // TODO: display this exception
    }
    return null;
}
 
Example 12
Source Project: jts   Source File: MiscellaneousTest.java    License: GNU Lesser General Public License v2.1 6 votes vote down vote up
public void testPredicatesReturnFalseForEmptyGeometries() {
  Point p1 = new GeometryFactory().createPoint((Coordinate)null);
  Point p2 = new GeometryFactory().createPoint(new Coordinate(5,5));
  assertEquals(false, p1.equals(p2));
  assertEquals(true, p1.disjoint(p2));
  assertEquals(false, p1.intersects(p2));
  assertEquals(false, p1.touches(p2));
  assertEquals(false, p1.crosses(p2));
  assertEquals(false, p1.within(p2));
  assertEquals(false, p1.contains(p2));
  assertEquals(false, p1.overlaps(p2));

  assertEquals(false, p2.equals(p1));
  assertEquals(true, p2.disjoint(p1));
  assertEquals(false, p2.intersects(p1));
  assertEquals(false, p2.touches(p1));
  assertEquals(false, p2.crosses(p1));
  assertEquals(false, p2.within(p1));
  assertEquals(false, p2.contains(p1));
  assertEquals(false, p2.overlaps(p1));
}
 
Example 13
@Test
public void intersect50percentOverlapAlmost() throws Exception {
	// prepare command
	SearchByLocationRequest request = new SearchByLocationRequest();
	request.setCrs("EPSG:4326");
	request.setQueryType(SearchByLocationRequest.QUERY_INTERSECTS);
	request.setSearchType(SearchByLocationRequest.SEARCH_ALL_LAYERS);
	request.setRatio(0.5f);
	request.setLayerIds(new String[] {LAYER_ID});

	// create a rectangle that overlaps 49 %
	GeometryFactory factory = new GeometryFactory();
	LinearRing half1 = factory.createLinearRing(new Coordinate[] {new Coordinate(0, 0), new Coordinate(1, 0),
			new Coordinate(1, 0.49), new Coordinate(0, 0.49), new Coordinate(0, 0)});
	Polygon polygon = factory.createPolygon(half1, null);
	request.setLocation(converter.toDto(polygon));

	// execute
	SearchByLocationResponse response = (SearchByLocationResponse) dispatcher.execute(
			SearchByLocationRequest.COMMAND, request, null, "en");
	// test
	List<Feature> features = response.getFeatureMap().get(LAYER_ID);
	Assert.assertNull(features);
}
 
Example 14
protected Geometry getAuthorizedArea(String layerId) {
	if (null == biggestGeometry) {
		// build Geometry which covers biggest possible area
		Envelope maxBounds = new Envelope(-Double.MAX_VALUE, Double.MAX_VALUE,
				-Double.MAX_VALUE, Double.MAX_VALUE);
		PrecisionModel precisionModel = new PrecisionModel(PrecisionModel.FLOATING);
		GeometryFactory geometryFactory = new GeometryFactory(precisionModel, 0);
		biggestGeometry = geometryFactory.toGeometry(maxBounds);
	}
	return biggestGeometry;
}
 
Example 15
Source Project: jts   Source File: IOUtil.java    License: GNU Lesser General Public License v2.1 5 votes vote down vote up
public static Geometry readGMLString(String gml, GeometryFactory geomFact)
throws ParseException, IOException, SAXException, ParserConfigurationException 
{
  GMLReader reader = new GMLReader();
  Geometry geom = reader.read(gml, geomFact);
  return geom;
}
 
Example 16
Source Project: Elasticsearch   Source File: BaseLineStringBuilder.java    License: Apache License 2.0 5 votes vote down vote up
protected static ArrayList<LineString> decompose(GeometryFactory factory, Coordinate[] coordinates, ArrayList<LineString> strings) {
    for(Coordinate[] part : decompose(+DATELINE, coordinates)) {
        for(Coordinate[] line : decompose(-DATELINE, part)) {
            strings.add(factory.createLineString(line));
        }
    }
    return strings;
}
 
Example 17
@Before
public void setupBeans() throws LayerException {
	GeometryFactory factory = new GeometryFactory(new PrecisionModel(PrecisionModel.FLOATING), 4329);
	LinearRing shell = factory.createLinearRing(new Coordinate[] { new Coordinate(0, 0), new Coordinate(1, 0),
			new Coordinate(1, 1), new Coordinate(0, 1), new Coordinate(0, 0), });
	Polygon p = factory.createPolygon(shell, null);
	MultiPolygon expected = factory.createMultiPolygon(new Polygon[] { p });
	CustomBean cb = new CustomBean();
	cb.setId(1);
	cb.setGeometry(expected);
	cb.setName("testbean");
	layer.saveOrUpdate(cb);
}
 
Example 18
private Geometry readWkt(String area) {
	try {
		WKTReader wktReader = new WKTReader(new GeometryFactory(new PrecisionModel(), 0));
		return wktReader.read(area);
	} catch (ParseException pe) {
		throw new IllegalArgumentException("Could not parse geometry " + area, pe);
	}
}
 
Example 19
private Geometry getFootprintAsGeometry() {
	GeometryFactory gf = new GeometryFactory();
	Coordinate[] newFoot = new Coordinate[footprintCoords.length+1];
	for (int j = 0; j < footprintCoords.length; j++) {
		newFoot[j] = footprintCoords[j];
	}
	newFoot[footprintCoords.length] = footprintCoords[0];
	Geometry foot = gf.createPolygon(newFoot);
	return foot;
}
 
Example 20
Source Project: jts   Source File: IOUtil.java    License: GNU Lesser General Public License v2.1 5 votes vote down vote up
public static Geometry readGeoJSONString(String s, GeometryFactory geomFact)
throws ParseException 
{
  GeoJsonMultiReader reader = new GeoJsonMultiReader(geomFact);
  Geometry geom = reader.read(s);
  return geom;
}
 
Example 21
Source Project: jts   Source File: SegmentStringUtil.java    License: GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * Converts a collection of {@link SegmentString}s into a {@link Geometry}.
 * The geometry will be either a {@link LineString} or a {@link MultiLineString} (possibly empty).
 *
 * @param segStrings a collection of SegmentStrings
 * @return a LineString or MultiLineString
 */
public static Geometry toGeometry(Collection segStrings, GeometryFactory geomFact)
{
  LineString[] lines = new LineString[segStrings.size()];
  int index = 0;
  for (Iterator i = segStrings.iterator(); i.hasNext(); ) {
    SegmentString ss = (SegmentString) i.next();
    LineString line = geomFact.createLineString(ss.getCoordinates());
    lines[index++] = line;
  }
  if (lines.length == 1) return lines[0];
  return geomFact.createMultiLineString(lines);
}
 
Example 22
/**
 * Creates a new smoother that will use the given {@code GeometryFactory}.
 * 
 * @param geomFactory factory to use for creating smoothed objects
 * 
 * @throws IllegalArgumentException if {@code geomFactory} is {@code null}
 */
public GeometrySmoother(GeometryFactory geomFactory) {
    if (geomFactory == null) {
        throw new IllegalArgumentException("geomFactory must not be null");
    }
    this.geomFactory = geomFactory;
    
    this.control = DEFAULT_CONTROL;
}
 
Example 23
@Test
public void testDefaultVisibleAreaOne() throws Exception {
	DefaultSecurityContext securityContext = (DefaultSecurityContext)this.securityContext;
	List<Authentication> authentications = new ArrayList<Authentication>();
	Authentication auth1 = getAuthentication();
	Authentication auth2 = getAreaAuthentication(1);
	authentications.add(auth1);
	authentications.add(auth2);
	securityContext.setAuthentications("token", authentications);

	Geometry geometry = securityContext.getVisibleArea(LAYER_ID);
	Assert.assertNotNull(geometry);
	PrecisionModel precisionModel  = new PrecisionModel(PrecisionModel.FLOATING);
	GeometryFactory geometryFactory = new GeometryFactory(precisionModel, LAYER_SRID);
	Coordinate coordinate = new Coordinate();
	coordinate.x = coordinate.y = 0.5;
	Assert.assertFalse(geometry.contains(geometryFactory.createPoint(coordinate)));
	coordinate.x = coordinate.y = 1.5;
	Assert.assertTrue(geometry.contains(geometryFactory.createPoint(coordinate)));
	coordinate.x = coordinate.y = 2.5;
	Assert.assertTrue(geometry.contains(geometryFactory.createPoint(coordinate)));
	coordinate.x = coordinate.y = 3.5;
	Assert.assertFalse(geometry.contains(geometryFactory.createPoint(coordinate)));
	coordinate.x = coordinate.y = 4.5;
	Assert.assertFalse(geometry.contains(geometryFactory.createPoint(coordinate)));

	Assert.assertFalse(securityContext.isPartlyVisibleSufficient(LAYER_ID));
}
 
Example 24
Source Project: TomboloDigitalConnector   Source File: OpenMappingImporter.java    License: MIT License 5 votes vote down vote up
public Geometry getShape(String wtk) throws FactoryException, TransformException {
    GeometryFactory geometryFactory = new GeometryFactory(new PrecisionModel(), Subject.SRID);
    WKTReader reader = new WKTReader(geometryFactory);
    MathTransform crsTransform = GeotoolsDataStoreUtils.makeCrsTransform("EPSG:27700");

    try {
        LineString line = (LineString) reader.read(wtk);
        Geometry transformedGeom = JTS.transform(line, crsTransform);
        return transformedGeom;
    } catch (ParseException e) {
        e.printStackTrace();
        log.error("Not a valid geometry");
        return null;
    }
}
 
Example 25
@Override
protected void importDatasource(Datasource datasource, List<String> geographyScope, List<String> temporalScope, List<String> datasourceLocation) throws Exception {

    GeometryFactory geometryFactory = new GeometryFactory(new PrecisionModel(), Subject.SRID);
    JSONObject documentObj = downloadUtils.fetchJSON(new URL(datasource.getDatasourceSpec().getUrl()), getProvider().getLabel());

    List<Map<String, String>> results = (List<Map<String, String>>) documentObj.get("result");

    List<Subject> subjects = results.stream().map(healthOrgObj -> {
        String label = healthOrgObj.get("organisation_id");
        String name = healthOrgObj.get("organisation_name");
        Point point = null;
        try {
            Double longitude = Double.parseDouble(healthOrgObj.get("longitude"));
            Double latitude = Double.parseDouble(healthOrgObj.get("latitude"));
            Coordinate coordinate = new Coordinate(longitude, latitude);
            point = geometryFactory.createPoint(coordinate);

            // FIXME: Add fixed values

        } catch (Exception e) {
            // If we have any trouble with the geometry, e.g. the figures are blank or invalid,
            // we use the null geometry prepopulated in the `point` variable, and log.
            log.warn("Health organisation {} ({}) has no valid geometry", name, label);
        }
        return new Subject(datasource.getUniqueSubjectType(), label, name, point);

    }).collect(Collectors.toList());

    saveAndClearSubjectBuffer(subjects);
}
 
Example 26
Source Project: jts   Source File: GeometryTestCase.java    License: GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * Reads a {@link Geometry} from a WKT string using a custom {@link GeometryFactory}.
 *  
 * @param geomFactory the custom factory to use
 * @param wkt the WKT string
 * @return the geometry read
 */
protected Geometry read(GeometryFactory geomFactory, String wkt) {
  WKTReader reader = new WKTReader(geomFactory);
  try {
     return reader.read(wkt);
  } catch (ParseException e) {
    throw new RuntimeException(e.getMessage());
  }
}
 
Example 27
Source Project: jts   Source File: WKBTest.java    License: GNU Lesser General Public License v2.1 5 votes vote down vote up
private void runWKBTestCoordinateArray(String wkt) throws IOException, ParseException {
  GeometryFactory geomFactory = new GeometryFactory();
  WKTReader rdr = new WKTReader(geomFactory);
	Geometry g = rdr.read(wkt);
	
	// CoordinateArrays support dimension 3, so test both dimensions
	runWKBTest(g, 2, true);
	runWKBTest(g, 2, false);
	runWKBTest(g, 3, true);
	runWKBTest(g, 3, false);
}
 
Example 28
Source Project: TomboloDigitalConnector   Source File: TestFactory.java    License: MIT License 5 votes vote down vote up
/**
 * Returns a square geometry
 * @param lowerLeftXOffset x-coordinate of lower left corner
 * @param lowerLeftYOffset y-coordinate of lower left corner
 * @param edgeSize the edge size of the square
 * @return A square geometry with left corner at lowerLeftXOffset, lowerLeftYOffset
 */
public static Geometry makeSquareGeometry(Double lowerLeftXOffset, Double lowerLeftYOffset, Double edgeSize){
    GeometryFactory geometryFactory = new GeometryFactory();
    Coordinate[] corners = {
            new Coordinate(lowerLeftXOffset, lowerLeftYOffset),
            new Coordinate(lowerLeftXOffset, lowerLeftYOffset+edgeSize),
            new Coordinate(lowerLeftXOffset+edgeSize, lowerLeftYOffset+edgeSize),
            new Coordinate(lowerLeftXOffset+edgeSize, lowerLeftYOffset),
            new Coordinate(lowerLeftXOffset, lowerLeftYOffset)
    };
    Geometry square = geometryFactory.createPolygon(corners);
    square.setSRID(Subject.SRID);
    return square;
}
 
Example 29
protected Geometry convertGeoPointToGeometry( GeoPoint coordinates )
{
    if ( coordinates == null )
    {
        return null;
    }

    GeometryFactory gf = new GeometryFactory();
    com.vividsolutions.jts.geom.Coordinate co = new com.vividsolutions.jts.geom.Coordinate(
        coordinates.getLongitude(), coordinates.getLatitude() );

    return gf.createPoint( co );
}
 
Example 30
@Test
public void readGeometry() throws LayerException {
	GeometryFactory factory = new GeometryFactory(new PrecisionModel(), 4326);
	LinearRing shell = factory.createLinearRing(new Coordinate[] { new Coordinate(0, 0), new Coordinate(1, 0),
			new Coordinate(1, 1), new Coordinate(0, 1), new Coordinate(0, 0), });
	Polygon p = factory.createPolygon(shell, null);
	MultiPolygon expected = factory.createMultiPolygon(new Polygon[] { p });
	Assert.assertTrue(((CustomBean) layer.read("1")).getGeometry().equalsExact(expected));
}