The Center template appears in the template list when a geometry field, of type geom, geommfd, or geomwkb, has been picked in the Transform pane. It creates centroids.
Center |
Compute the centroid of objects using:
Launch the template by choosing a geometry field and then double-clicking the Center template. When the template launches we can specify options.
|
Center : circle |
Create a point at the center of the minimum circle that encloses each line or area object in the source field and put in the Result destination. Copy points from source field to target field. See the Center and Centroids topic.
With the focus on the Objects Drawing, in the Transform pane we choose the Geom field and then the Center template.
We choose circle for the Center option, and the Tgeom field (a geometry field we have in the table to use for temporary results) as the Result destination. Press Transform.
Our Temp Objects Drawing shows the contents of the Tgeom geometry field. We show it as a layer above the source drawing to illustrate how the Center template using the circle option creates points at the center of the minimum enclosing circle for each object. Points are passed through unmodified.
|
Center : inner (area) |
Create a point at the "center" of each area object in the source field, adjusting the location of the point so that it always falls within the area, and put into the Result destination. Save NULL for any lines and points. See the Center and Centroids topic.
With the focus on the Objects Drawing, in the Transform pane we choose the Geom field and then the Center template.
We choose inner (area) for the Center option, and the Tgeom field (a geometry field we have in the table to use for temporary results) as the Result destination. Press Transform.
Our Temp Objects Drawing shows the contents of the Tgeom geometry field. We show it as a layer above the source drawing to illustrate how the Center template using the inner (area) option creates points within each area at the approximate center of the area. Geom values for lines and points in the table are set to NULL.
|
Center : weight (area) |
Create a point at the balance point of each area object in the source field and put in the target field. Save NULL for any lines and points. See the Center and Centroids topic.
With the focus on the Objects Drawing, in the Transform pane we choose the Geom field and then the Center template.
We choose weight (area) for the Center option, and the Tgeom field (a geometry field we have in the table to use for temporary results) as the Result destination. Press Transform.
Our Temp Objects Drawing shows the contents of the Tgeom geometry field. We show it as a layer above the source drawing to illustrate how the Center template using the weight (area) option creates points within each area at the balance point of each area. Geom values for lines and points in the table are set to NULL.
|
Curvilinear segments - As a practical matter, most people doing GIS will use straight line segments for lines and areas. Few GIS systems do a good job of supporting curved segments, so there is much less data published using curved segments. Manifold's ability to work with curved segments allows us to use that data within Manifold in a limited way, at least for display and interactive editing.
However, most processing tools in Manifold, such as Transform templates and various Geom SQL functions, do their work by first converting a curvilinear segment into a straight line segment between the same two start and finish coordinates. That will often lead to weird or otherwise unexpected results. To avoid such problems, first convert curvilinear segments into equivalent constellations of straight line segments at whatever resolution is desired, using the Clean transform template with the convert curves to lines operation option and the number of linear segments desired to approximate the curve in the Curve limit parameter. See the Curved Segments discussion in the Drawings topic.
Example: Join Districts to Building Footprints - Given a map of a city with a drawing layer containing the footprints of buildings as polygonal areas, and a second drawing layer containing districts in the city as polygonal areas, we use the Join dialog to add a new attribute field to each building giving the district in which it is located. We consider first the simple case where district boundaries always fall between buildings, so buildings are always only in one district. Next, we deal with the case where buildings can straddle district boundaries, so parts of the same building can be in different districts. In that case we use the Transform pane to quickly build centroids for building footprints, and then we use the centroids to guide the spatial join.