Example: Overlay Containing

To explore the use of Overlay templates in the Transform dialog we consider a quick tutorial example, using 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.    


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


In this example we will transfer the name of a French region, called a Province in this example, to the points that represent cities which fall within each province.   If we've always wondered whether the city of Nevers was located in Bourgogne or in Centre, assigning a province to each city will let us know.




We begin with a map that has two drawing layers, a drawing called Provinces that shows the regions of France as area objects, and a drawing called Cities that shows some of the larger cities in France as point objects.  In the above illustration we have double-clicked the Cities tab to hide that layer.




When we open the Provinces Table we see it has two fields, a Province field of type nvarchar that gives the name of the region, and a Geom field of type geom that stores the geometry of the area.




If we double-click the Provinces layer tab to hide that drawing and then double-click the Cities layer tab to show that layer, we see the points in the Cities drawing.




Opening the Cities Table we see it also has two fields, a City field of type nvarchar that gives the name of the city, and a Geom field of type geom that stores the geometry of the point.   The data set came from the US military, so some of the city names such as Alencon also have the name of the airport appended, Valframbert airport in the case of Alencon.


Our task is to modify the Cities Table so it gains an additional field, Provinces, which will provide the name of the region which contains each city.




We double-click the Provinces layer to turn it back on (not required, but it helps to see what we are doing), and then we click on the Cities layer tab to make the Cities drawing the active drawing.


We choose Edit - Transform to launch the Transform dialog.   The dialog automatically launches with the active drawing layer as the target drawing and the Geom field as the target field.




We choose the Overlay Containing template, leave the default choice of the Provinces drawing as the Overlay and then we click on the Options button.





The Transform Options dialog allows us to specify the name for the resulting modified components and also allows us to specify which fields we want to transfer.


We do not need the mfd_id or Geom fields from the overlay drawing so we will click those fields to highlight them and then change the Transfer option to apply to those highlighted fields from copy to ignore




We press OK to apply the changes made to the transform options.





We press the Add Component button to create new components in the Project pane which incorporate the modifications we want to make to the target drawing.


Two new components are created: a Cities Table Overlay Containing table and a drawing to show the contents of that table called Cities Table Overlay Containing Drawing.




Opening the table we see it contains a new field with the region for each city.  The new field is called Ov Province to indicate it came from a field originally called Province and is the result of an Overlay.




The drawing of city points has not changed appearance since the overlay only transfers fields and makes no changes to the geometry of the objects.


So in which region is Nevers located?    We click on the Cities Table Overlay Containing table and then choose Edit - Find to launch the Find dialog.




Enter Nevers, press Next and then click on the table and press the Home key to scroll to that previewed record.



We can see from the table that Nevers is in Bourgogne.



Tech Tip:  The Home key is particularly useful in tables because it will always move the cursor to the first field and also will scroll the table so that the current cell is in view.   For example, if we use Edit - Find to find a record to scroll to that record we press the Home key to quickly bring it into view.



Multiple records - Some of the illustrations of tables show more than one record for various regions.   Why is that?  GIS data will often use multiple records for each area that makes up a particular region.   For example, the region of Bretagne (known in England as Brittany) includes many islands, each of which is a separate area object in this data.


Old Data - The illustrations in this topic use data from the US military, which show the regions of France as they were before 1 January 2016, when a law passed in 2014 took effect that reduced the number of regions in France from 22 to 13.  Centre is the same it was with just a change of name.   Nevers is still in what was Bourgogne, which expanded in 2016 to join with Franche-Comté to become Bourgogne-Franche-Comté.


Provinces vs. Regions - The drawing is called Provinces and not Regions because it was clipped out of a larger data set showing provincial boundaries for the entire world.  Around the world sub-national divisions such as US states or French regions are called many different things, but the word provinces seems to have become a reasonably generic word that militaries and others engaged in mapping often use.   State is rarely used because in many cultures it is a synonym for country and thus does not capture the notion of the administrative sub-units of a given country.


Centre vs. Centre-Val de Loire  - The region referred to as Centre in this topic was called Centre until 2015, when the new name of Centre-Val de Loire took effect, perhaps in an effort to boost tourism to the genuinely wonderful valley of the Loire river, home to what is perhaps the largest concentration of classic chateaux anywhere in the world.  To this day everyone still calls the region Centre.  


Bourgogne / Burgundy -  Bourgogne is the French name for the region Brits and other English speakers call Burgundy.   It is justifiably famous for its wines, as also are the other big wine-exporting appellations such as Bordeaux.   But the locals in France will often choose Chinon from the valley of the Loire or some other local wine that is not so widely exported or well-known outside of France.


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 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.


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.