Example: Combining Selections using the Select Panel

In this example we use selections to solve a one-off problem casually that would be more difficult to solve rigorously with SQL.   The objective in the example's scenario is to visit a point of tourist interest while travelling from Chartres to Tours, in France.    We will use the Transform panel as well as the Select panel.


In this example we have a database of archaeological sites in France ranging from Neolithic times onward, with information on each site and its location, as seen in the table below.




The table includes a field indicating the rank of the site that combines factors such as importance, state of preservation and so on.  Higher ranked sites would be a greater priority to visit in the field for a tourist or researcher.




When the table's records are seen as a drawing layer in a map, as above, using an imageserver layer that shows a Bing street map as a background map allows us to immediately see where the various sites are located.     The map above shows a zoomed in view with Chartres at the upper right and the outskirts of the city of Tours to the lower left with the thin line of a secondary road, the N10, running diagonally between them from Chartres to Bonneval, Chateaudun, Cloyes-sur-le-Loir, Vendome, Chateau-Renault and then finally Tours, just out of sight beyond the lower border.  


Our task in this example is to prepare for an automobile excursion from Chartres to Tours.  If there are any particularly outstanding archaeological sites very close to our route we would like to stop and to visit them.  In particular, we would like to visit any outstanding dolmens along the way.   A dolmen is a relic from Stone Age times, in particular the Neolithic, with most having been erected approximately five to six thousand years ago.   Because of time constraints on our journey we can only consider sites very close to our route.




The classic spatial SQL approach to this task would be to obtain a drawing that shows the road network as line objects and to then use spatial SQL to find those records that are dolmens with a high rank which are within some maximum distance of the road line that represents the N10.   However, it can take time to locate a suitable road network and then to pull out only that part of the N10 over which we will travel.


A simpler approach is to create a new drawing, which we call Buffer, drop it into the map, and then draw a line along our route.   We then create a buffer and grab all of the Sites points within some reasonable distance, doing everything with interactive, point and click commands.   In the illustration above, we have already drawn a line in the Buffer drawing.  


We click on the Buffer layer to make it the active layer, and then in the Contents pane we choose the Transform panel.




We click the Buffer template and in the Distance box we choose Value from the drop-down menu and then enter 1500.   That is a distance of 1500 meters as indicated by the m for meters.   We press Update Field.




The Buffer transform converts the black line into a buffer area that extends on all sides 1500 meters from where the line used to be.  In the illustration above we have used the Style panel to apply a yellow fill color to areas in the Buffer layer, and the Layers panel to set 50% opacity for the Buffer layer.


We now will create a layer with just those Sites points that fall within the buffer area.   We click on the Sites layer tab to make it the active layer.




In the Transform panel we enter Overlay into the Filter box to reduce the long list of transforms to only those with "Overlay" in their names, and then we choose the Overlay Topology, Intersect template.   The only other drawing in the map is the Buffer drawing, so the panel automatically loads that layer as the Overlay.   We press Add Component.    


We don't bother to set any options, so the new layer the system will create, which contains all the site points that are found within, that is, which intersect, the buffer area, will have a ponderous, default name, but that is OK.




We double-click the Sites layer tab to turn it off, and then we drop the new Sites Table Overlay Topology, Intersect Drawing layer into the map.   As promised, the default name is, indeed, ponderous, but we really do not care since we will never have to keyboard it.  We just drag it and drop it into the map.   The new drawing contains a copy of all of the Site points that intersected the buffer.   They are shown in default, gray formatting since this is a new drawing and we have not styled it.


There are still many dots in that layer, some of which may represent dolmens and perhaps some of which are even dolmens with a high rank.   We do not know which, if any, of those dots are dolmens or if any have high interest, but these are the sites we feel are close enough to our route to visit if they are the locations of  interesting dolmens.


We have already made some progress in spatial selection by narrowing down our search to a few locations near our route from thousands of points that are listed in the Sites table.



We next open the Sites Table Overlay Topology, Intersect table in a window.   That is the table that lists all of the points that fell within the buffer zone.     In the Contents pane we choose the Select panel.




In the Template tab we enter text to reduce the long list of templates to only those which contain "text" (case not significant) in their names, and then we choose the Text Contains template.  We choose Value from the drop down field for the Search for box and we search within the Name field for records that contain the text Dolmen.  Press the Replace Selection command button at the bottom of the dialog to select those records.




The records appear in red selection color.




The records also automatically appear in red selection color in the drawing layer as well.   




Next, in the Select panel we choose the Greater or Equal template, choosing Expression in the Compare to box, to select records with a value of 8 or greater in the Rank field.    We want to intersect that resulting selection with the selection that now exists, to give us only those dolmen from the existing selection that also have a rank of 8 or greater.




We get that combination by switching the command button to Intersect with Selection and pressing it, which intersects the Greater or Equal preview with the existing, prior selection to create a new selection in the table that is the intersection of both.  




The result is a selection in the table that consists of those records which are dolmens with a rank of 8 or greater.   The illustration above shows the table just after we have pressed the Intersect with Selection button.   We can see that there is a selection in the table consisting of  a dolmen with rank 9 that is near our route.  




The drawing also shows the selected object, in this case, only one point, in red selection color.   It is slightly overlapped by a nearby, non-selected point.


We can clean up the display by getting rid of points that are not selected.




To do that we first press Ctrl-I to invert the selection, or, to do the same thing with a menu choice we can choose Edit - Select Inverse.   That inverts the selection so that all the other points in the layer are selected.   We can then press Delete or choose Edit - Delete to delete those points, leaving only the one point of interest.




We Style the layer to increase the size of points and to use a bright green fill color for points.  Out of thousands of possible sites we can see that we picked out the one site of interest along our route.


We turn off the Buffer layer and then zoom into the map to take a closer look.




With the map zoomed in we can see the dolmen is located immediately by the side of a country road perhaps thirty seconds of travel from the route we will be driving.  A must see!




We zoom even further and add a Google satellite imageserver layer to get a photographic, overhead aerial view.  


The dolmen we have found turns out to be indeed a fine dolmen, located by the side of a road just seconds away from the traffic circle on the N10 near Saint-Hilaire-la-Gravelle.    We see it below in a photograph posted by a hobbyist.  




Every day, people drive between Chartres and Tours around the traffic circle nearby without knowing that but a few seconds away stands a fine Neolithic monument, an emissary from the Stone Age that has awed residents for thousands of years.    We too might have passed had we not utilized the power and convenience of transforms and selections to find this gem, hidden in plain sight, along our route.


We use dolmens as the plural for dolmen.  Some writers prefer a plural form without an s at the end.


This example was contributed by a hobbyist as a real-life use of Manifold.  Many people living in Europe have a hobby of visiting Neolithic and other archaeological remains that are scattered all throughout Europe.   Some make it a point when travelling to bring along maps of interesting sites to visit that are near the route of travel.   See photos of more dolmens in the Example: Layout Properties  topic.   See also the Example: Create Maps topic for a look at cromlechs, also monuments from the Neolithic.


The database of archaeological relics used in this example is based on the same database used in the Hunting Neolithic Relics YouTube video and the  Select and Transform in a Neolithic Relics Database YouTube Video in the Manifold Sales YouTube video channel.   Watch the videos to see Manifold technology in action.  


Methods like those in this example can be used for many analogous tasks in business, government, military, environment, and social welfare activities.   Those analogous tasks share the common objective that from a long text list we want to pick out items that have the right characteristics in the right location, and we don't want to get buried in extra work to be able to say in a formal way what is "the right location."  We don't want to hunt for road networks in vector form and learn how to use them; we just want to pick out by eye what leaps out to us as "the right location" based on a map background that we can add in seconds.


A key step in this example was drawing a line along our proposed route, and then making a buffer from that line to grab all of the points that fell within the buffer.   An even more casual approach would be to use a mouse-based selection tool, like box selection, to select points along the route.   But even with selection tools such as polygonal lasso tools to select areas, that involves a significant amount of eye and mouse coordination that rapidly becomes very tedious with many points or long routes.


The approach we show in this example is much easier because without worrying about accuracy we just draw a line along our route.  It works even if the route is illustrated, as in this example, by a raster image layer.    The extra steps of using the Buffer transform and then the Overlay Topology, Intersect transform are so easy (do not make a big deal out of them... they are really easy... one step!) that it is far quicker to just sketch a line along the route of interest and use the approach in this example than it is to try to lasso with the mouse points that are near the route.     


This example also shows how a flexible, casual approach can be effective in spatial data work.  There are many tasks, such as the precise computation of property tax owed on a given parcel, where there is no substitute for rigorous, exactly precise computations integrating complex rules.  But in other cases a less rigorous approach of using a mouse to pick items that seem "close enough" in a drawing combined with selection criteria in a table that also "seem right" can be the best way to do the job.  Especially during the creative process of making "what if" explorations, never underestimate the value of "seems right" intuition.

See Also





Contents Pane


Contents - Select


Contents - Transform




Example: Select a Range of Records in a Table - We can select or deselect a range of records between any two records in a table window using fast and easy mouse commands.


Example: Mouse Selection in a Drawing Window - Using the mouse to select objects in a drawing window.   This could be a drawing layer in a map or simply in a drawing window.


SQL Example: Using Selection Query Functions - How to manipulate selections within a query.


Example: Using the Select Panel Template Tab -  A sequence of actions using Select panel templates.


Example: Using the Select Panel Saved Tab - How to save selections and then use them later.


Example: Construct JSON String using Select and Transform - Use the Select panel and Transform panel 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.