Coordinates

Objects in drawings are defined by the coordinates necessary to draw them. Coordinates are simply the numbers for each X and Y (and possibly Z) position that defines the object, the numbers getting their meaning from the coordinate system / projection that the drawing uses. The sequence of coordinates that defines an object is also called its geometry or, in older terminology, its metric.   Coordinates for objects are stored within a geometry data type, usually a geom data type, in records within the drawing's table.

 

 

 

Coordinates Define Objects in Drawings

i_coordinates_01.png

 

Consider a drawing that contains five objects: an area, a line and three points.

 

i_coordinates_02.png

 

The objects in the drawing are defined by the coordinate numbers that are used to draw them in a "connect the dots" fashion.   The coordinate numbers for each object are stored within the geom field in the record that stores data for that object.   The area, for example, is nothing more than a list of five coordinates within the geom that defines the area.   

 

3 7

2 9

3 10

5 9

5 8

 

We can see the coordinates of any object in a drawing by Alt-clicking the object to choose it for the Record panel of the Contents pane, and then clicking the Coordinates tab to display the list of coordinates that make up that object.

 

il_coordinates01_01.pngil_coordinates01_02.png

 

In the illustration above we have Shift-Alt-clicked on an area.  The Record panel immediately launches showing the Coordinates tab to show a list of coordinates for the object.  Each coordinate appears in the drawing as a box in blue preview color.  The coordinate for the row with a darker row handle in the Coordinates list appears as a larger box.

 

Based on the coordinate system in use, Manifold knows how to interpret a geom to make sense of the coordinate numbers it contains as an area, a line or a point as the case may be.  Manifold understands how to use the coordinate numbers for each object type, for example, knowing how to draw the area correctly to show what is the inside and what is the outside of the area.

 

By default, Manifold uses geoms to store the coordinates that define objects because the binary geom data type is compact, unambiguous and very efficient. A big, complicated area such as the one that might define the boundary of continental Canada, replete with endlessly convoluted shoreline, might consist of many tens of thousands of coordinates even at fairly low resolution.  Large areas at high resolution might consist of many millions of coordinates.

 

Manifold interprets coordinate numbers as spatial data by using the coordinate system for the drawing to know how those numbers should be interpreted.  By themselves the raw coordinate numbers describe only the relative position and shape of objects within the drawing.    If we do not have coordinate system information we would not know, for example, if the number 3 in the area's coordinates is supposed to be three centimeters or if it is three degrees of longitude. If the 3 is not degrees of longitude we do not know from the number by itself if it is supposed to represent an unprojected coordinate in a CAD drawing or if it is a number that has some meaning within some specific geographic coordinate system.

 

In Manifold the properties of the table which contains the geom tell Manifold the coordinate system within which the coordinates are to be interpreted. Between the table's properties and the coordinate information in the geom we have precise and complete information on the exact placement and shape of the object.   See the Drawings topic for illustrations.

Pathological Geometries

Nothing says that all geometries for all objects must always be sensible.  Especially when objects are created by programmatic processes the geometry created may be perfectly legal but might not be sensible.    Area objects, for example, might contain redundant coordinates or consist of coordinates that are placed in topologically crazy orders, for example, causing areas to overlap themselves.

 

Consider the area object shown in the first two illustrations below, with the coordinates that define it marked by square symbols. The blue square symbol marks a location where two coordinates exist, both exactly at the same place.

 

sc_autonorm_01.pngsc_autonorm_02.pngsc_autonorm_03.png

 

The area is defined by traversing the coordinates which mark the boundary of the area, as shown by the blue arrows in the second illustration above.   The outlying coordinate is redundant, because there is no area out there.  One of the two coincident coordinates at the location marked by the blue square is also redundant, since its only purpose is to send out or to catch the path out to the outlying, redundant coordinate.  If two redundant coordinates are removed the area becomes a normalized area that is not pathological, that is, it does not contain any crazy or unnecessary coordinates.

Notes

A simplification - This topic simplifies the nature of coordinates in a geom.  From the Editing Drawings topic we can see that in addition to the classic specification of points, lines and areas by coordinates that draw the object in connect-the-dots fashion Manifold can also specify lines and areas using curvilinear segments where the coordinate numbers specify circle arcs, ellipse arcs or splines.

 

See Also

Tables

 

Drawings

 

Editing Drawings

 

Projections

 

Coordinate System

 

Transform Templates - Geom - See the Normalize and Normalize Topology templates, as well as others that work with coordinates.

 

Example: Draw Lines, Areas and Points - Simple example of using basic mouse moves to add points, lines and areas to a drawing.

 

Example: Drawings use Geom Fields in Tables  - An essential discussion on how drawings are created from geom fields in tables, including how the drawing knows which coordinate system to use.

 

Example: Create a Geocoded Table from a Drawing - A partner example to Example: Create a Drawing from a Geocoded Table   A geocoded table has records with a latitude and longitude for each record.   This example starts with a table for a drawing of points where the geom field in the table contains geometry information for each point.   We extract the Y and X locations for each point  from the geom field to create latitude and longitude fields in the table for each record.

 

Example: Create a Drawing from a Geocoded Table - A partner example to Example: Create a Geocoded Table from a Drawing   A geocoded table has records with a latitude and longitude for each record.   This example starts with a table containing a list of cities with a latitude and longitude field for the location of each city.   We create a geom from the latitude and longitude fields using a template in the Transform panel and then we create a drawing that shows the cities as points.  This example shows all the infrastructure steps involved.