Example: Overlay Topology Intersect

In this example we use the Overlay Topology, Intersect template in the Transform dialog to trim a drawing of points so that all points which do not fall within areas in a second drawing are deleted.   The drawing of points we trim will become the US cities drawing that is used in the Example: Overlay Contained topic.


Overlay Topology templates alter objects in the drawings upon which they work, in contrast to Overlay templates which alter fields in the drawings upon which they work.


Our task in this example is to create a map that shows cities in the "lower 48" states of the US, a region often referred to by the abbreviation CONUS, for "Continental United States."   The region is a convenient one for examples because it fits on rectangular computer monitors without excessive white space to cover the great geographic extent of various US colonial holdings, territories, not-quite-states and so on.


We already have a drawing that shows the lower 48 US states as areas.   We have imported a drawing of US cities published as a shapefile by the National Atlas of the United States, a US government web site.   Our task is to trim that drawing to remove all cities that fall outside of the lower 48 states.


Looking at the two drawings together as layers in a map we see that there are many city points outside of the lower 48 states, spanning the entire world, from Alaska to distant settlements on Aleutian islands on the other side of the +/- 180 meridian that conventionally marks the end of West and the beginning of East.   There are also clumps of dots from US colonial holdings in the Caribbean in the Virgin Islands and Puerto Rico, dots for Hawaii and, of course, many dots for cities in Alaska.




Zooming in we see how most dots fall within the lower 48 states.



We would like to trim the citiesx020 drawing so that only dots that fall within the lower 48 states are left, as seen above.   But even that is not quite enough.


If we zoom in some more we can see that the data sets do not quite match.




In particular, the US states drawing is a simplified representation of US states that shows only the main areas of states.  It does not include islands and other small areas on which may be located towns.    As seen above, some dots representing towns and cities do not fall within state areas.  We will delete those as well.




Opening the cities table, we hide most of the fields to provide a more legible display.   Each city has a name.   From the names we see above we can guess that the ordering of the names in the drawings table begins with Alaska.   



Opening the states table we see that it includes a field with the name of the state.   We will transfer that field as part of the Intersect operation.


Clicking the citiesx020 drawing tab in the map to make it the active drawing, we choose Edit - Transform to launch the Transform dialog.   It launches automatically pre-loaded with the Geom field for the citiesx020 drawing as the Target field.  




We choose Overlay Topology, Intersect as the template.   The Overlay box automatically loads with US states since that is the only other drawing in the map.


We would like to specify which fields to transfer as part of the intersect, so we will click on the Options button to launch the Transform Options dialog.




We first will shorten the names to be used for the new components to be created by the template as the default suggestions are too long for our taste.  Note that the dialog shows all the many fields from the citiesx020 drawing that we did not display in the table.




Next we will click on the mfd_id and Geom fields from the overlay drawing to highlight them.   We can then change their Transfer rule from the default copy to ignore.    We are not interested in copying areas from the US states drawing; we just want to use those areas to clip the points in the cities drawing.




Changing the Transfer rule to ignore means those fields will not be transferred into the components created by the template.


We MUST leave at least one field to be transferred from the overlay drawing for the template to work.   In this case we will choose the STATE field to be copied over so that will add the name of the state in which it is located to each city point.   If later on we decide we do not need that field in the new table it is easy to delete from the table's schema.




We double-check our work and then press OK to confirm the changes we made to the options.




Back in the Transform dialog we press Add Component to create a new component that is the result of the template.  We then click Close.


Two new components, a table and a drawing to show that table's objects, are created in the Project pane using the names we specified in the Options dialog.


If we double-click the citiesx020 tab to turn off display of that layer and then we drag and drop the new citiesx020 Intersect drawing into the map we can see that the offshore points which do not fall within any state area have been deleted.



Opening the new citiesx020 Intersect drawing in its own window and doing a Zoom to Fit we can see that all points outside the lower 48 US states have been deleted.   Our task has been accomplished.




As part of the intersect operation we copied over a STATE field from the US states drawing to the newly created table.  Opening the new citiesx020 Intersect Table table, and then hiding all the fields in which we are not interested,  we can see that the STATE field has been brought over automatically from the US states drawing that we used as the overlay drawing.  In the new table it has been renamed o_STATE to indicate it is the result of the overlay topology operation.   


The values in the o_STATE field have been automatically matched so that city points which fall within the area of a given state receive the value of that state's name in their o_STATE field.  In that respect, an Overlay Topology, Intersect operation has the same effect on transferred fields as does the "fields only" Overlay Intersecting operation.



CONUS means Continental - The region shown in our map of the "lower" 48 US states is referred to by the US government (including the US military) using the acronym CONUS.  By US Federal law the acronym CONUS means the "Continental United States" and refers to the lower 48 US states plus the District of Columbia but excluding Hawaii, excluding various overseas colonies of the US and excluding Alaska.      


Some people, perhaps embarrassed at the implied geographic illiteracy of implying that the mighty Alaskan peninsula is not an integral part of the continent of North America, will say the acronym means "Contiguous United States."  Endless web sites will repeat nonsense such as ""Many people assume that acronym stands for CONtinental U.S. when it really stands for CONtiguous U.S."   Not so.   


Visiting the Code of Federal Regulations (CFR) at 45 CFR chapter 300, Part 300-3 "Glossary of Terms," section 300-3.1  we read the definition "Continental United States (CONUS) - the 48 contiguous States and the District of Columbia."  By law, as far as the US Code of Federal Regulations defines acronyms, Alaska is not a part of the continental United States.   Various style guides issued by the US military and US government bureaucracies also confirm that the acronym CONUS does indeed means Continental United States.  


What is that empty vertical lane in the data?  - Looking at the new citiesx020 Intersect drawing we see what appears to be a vertical lane from East Texas up to the Northern border where few cities are located.  Why would there be such an empty region in the US?


Expanding the window to get a better look at the data we can see that the apparently empty vertical lane is just a consequence of how points are averaged out for display when too many of them are in the data to fit into all the pixels that are available in a given region of the monitor.


The illustration below is a reduced view of a window that spans most of the monitor, and there is no such empty vertical strip in the data.   But we can see what appear to be horizontal lines of towns and cities running across the Great Plains.




Those horizontal lines of towns and cities are genuinely in the data.  If we zoom in we can see them even better.   They are the result of settlement patterns as the European population of the United States expanded Westward following the lines of railroads.   


Settlements naturally were founded and survived along the East to West railroad routes.   Many of those original railroads are long gone but their routes remain visible in the lines of towns and cities on the Great Plains.   Some additional lines can also be made out along the routes of railroads through the mountain passes and deserts of the "basin and range" geography further West.


See Also

Transform Dialog


Transform Options


Transform Templates


Transform Templates - Drawings


Transform Templates - Geom


Transform: Overlay


Transform: Overlay Topology


Example: Two Drawings from the Same Table - Take a table with a geom field that is visualized by a drawing.  Add a second geom field to the table and create an rtree index on that field so it can be visualized by a drawing.   Copy the first drawing, paste it and adjust the pasted copy so it uses the second geom field. Demonstrate how to use the Transform dialog to show "live" modifications in the second drawing compared to the first drawing.


Example: Copy one Column into Another Column with Transform - How to use the Transform dialog to copy the contents of one column in a table into another column, but only for selected records.  Uses the Products table from the Nwind example data set.  


Example: Transform Field Values using an Expression in the Transform Dialog -  How the Expressions tab of the Transform Dialog may be used to change the values of fields.   We include an example of changing the price of selected products and using two different Transform dialogs open at the same time for two different table windows.


Example: Overlay Contained -  A frequent use of overlays is to sum the values of many points that fall within an area and to transfer that sum to a new field for an area.  In this example we take a drawing that has cities in the US with a population value for each city.  We use Overlay Contained  to sum the population of each city within a state and to transfer that sum to a total population for the state.


Example: Overlay Containing - One of the most common uses of overlays is to transfer fields from areas to points that are contained in those areas.    Tasks such as transferring a census block group number or zip code number from a drawing of areas to points that fall within each area are extremely common.   In this example we transfer the name of a French region  to the points that represent cities which fall within each region.


Example: Transfer Options and Merge Areas - Using the Merge Areas Transform dialog template, an exploration of the difference between using Copy and Sum for transfer options.


Example: Union Areas - Combine multiple area objects into a single area.   A drawing of French regions shows some regions as more than one area.  We would like each region to be one area so the table of regions has one record per region.


Example: Construct JSON String using Select and Transform - Use the Select and Transform dialogs to manually construct a JSON string using values from other fields in a table. Shows how we can manipulate text to build desired contents in a field.


Example: Edit a Drawing with Transform Dialog Templates -  In this example we open a drawing and edit objects in the drawing using the Transform dialog Template tab.   Includes examples of using the Add Component button and also the Edit Query button.


Example: Use a Transform Dialog Expression to Create Buffers in a Drawing - Use the Expression tab of the Transform Dialog to create three different sizes of buffers for different lines in a drawing and then automatically create a query which does the same thing.  Includes examples of using the Add Component button and also the Edit Query button.


Example: Clip Areas with a Transform Dialog Expression - Use the Expression tab of the Transform dialog to clip areas in a drawing to fit within horizontal bounds.   Includes examples of using the Add Component button and also the Edit Query button.


Example: Smooth Lines with a Transform Dialog Expression - Use the Expression tab of the Transform dialog to make lines smoother in a drawing so that longer lines are smoothed more.  Includes examples of using the Edit Query button to show how different queries are created automatically depending on if we want to update a field or to add a new component.