<\/HEAD>
We<\/SPAN> regularly receive requests from users for a dataset containing housing typology.<\/SPAN> We have recently investigated this further and although we have no plans in the short term to create a nationwide dataset,<\/SPAN> I would like to show you how you could create such a dataset yourself using our BAG data.<\/SPAN><\/P> <\/SPAN><\/P>This analysis consists of several steps. We will look at surrounding buildings to determine whether a building is detached and if not, how many adjacent neighboring buildings it has to determine whether it is an end terrace or mid-terrace house. But the BAG<\/A><\/SPAN> of course does not only contain residential spaces, so we will use the residential objects to get more clarity here. We will also use these residential objects to distinguish buildings with multiple residential objects, such as apartments. At the end of this blog, I will provide an overview of links with more information.<\/SPAN><\/P> <\/SPAN><\/P>First, we start by downloading the BAG data. You can download this monthly from our
Datasets group<\/A><\/SPAN> in ArcGIS Online. The reason I use the file geodatabase here and not the daily service is because I am going to edit the attributes. Analyses on a feature service are possible, but edits (such as in attributes) are not.<\/SPAN><\/P> <\/SPAN><\/P>Step 1: Identifying buildings without residential function<\/SPAN><\/STRONG><\/P>From the BAG file geodatabase, I made a
clip<\/A><\/SPAN> of the buildings and residential objects in the municipality of Best<\/SPAN>, North Brabant. Although the name already indicates that this is the 'best' location for a test dataset, it is also the village where I grew up myself. This makes verifying the outcome of the analysis much easier.<\/SPAN><\/P> <\/SPAN><\/P>We are interested in buildings with residential object(s) with usage purpose 'Residential function'. Residential objects can have multiple usage purposes. In our BAGv2 data (see also my earlier blog<\/A><\/SPAN>) we have split these usage purposes into separate attributes, making it easier to perform analyses on them. Each column indicates with a 1 or a 0 whether the usage purpose is present or not in this residential object.<\/SPAN><\/P> <\/SPAN><\/P>
<\/SPAN><\/P>And we will make use of that. So first I make a
attribute selection<\/A> <\/SPAN><\/SPAN>on the residential objects:<\/SPAN><\/P>

I export<\/>A this selection to a new feature class Verblijfsobject_Best_Woning<\/>E, because we will also use it later.<\/>P
Next, I add a new field to my Building feature class called 'Housing type'. Here I will later store the result of my analysis. This field will consist of the following categories:<\/>
Detached house<\/>
End terrace house<\/>
Mid terrace house<\/>
Apartment<\/>
No house<\/>
<\/>
We start with the last category. With a location selection<\/>, I select all buildings that do not have residential objects with usage purpose 'Residential function'. You do this by selecting the buildings that do intersect with a residential object with residential function, but checking 'Invert spatial relationship', which reverses the selection.<\/>

Then I use the Calculate Field tool<\/> to fill this new Housing type attribute for these buildings with the value 'No house'.<\/>

Next, we also export these features to a new dataset and remove these features from our Buildings dataset. Many of the buildings that are not houses are garages or sheds. This type of building often borders an end terrace or detached house. Our next step is to perform an analysis of the number of adjacent buildings on which we base the housing typology. If we left these features in the dataset, these houses would be incorrectly categorized as mid terrace or end terrace houses. We will add these buildings without residential function back into the dataset later.
Step 2: Identifying the number of adjacent buildings with residential function
To identify the number of adjacent buildings, we use the Frequency tool. This tool also produces a table as a result.


With this table we can add the frequency of the number of neighboring buildings to the Panden dataset by linking the src_OBJECTID of the frequency table to the OBJECTID of the Panden dataset.
This information gives us insight into which buildings have two or more neighbors, these are terraced houses. We select these buildings by attribute and use the Calculate Field tool again to assign them the value 'Tussenwoning'. We do the same for corner houses; these houses have one neighbor.

Step 3: Identifying apartments and detached houses
It sounds logical that buildings without adjacent houses would automatically be detached houses (these buildings have a Frequency of "<Null>"), but unfortunately this is not the case. Apartment buildings are designated as one building in the BAG, after which multiple residential objects (the apartments themselves) are added. So for buildings without neighbors, we need to determine how many residential objects are housed in the building. If there are multiple, we classify the building as an apartment. These do not necessarily have to be detached houses, for example, a terraced house can also contain apartments.
Esri Inc has already written a technical article about this and there are different ways to count points in a polygon. I use here the Spatial Join tool with the Verblijfsobject_Best_Woning feature class. Some detached buildings can, for example, contain both a shop and a residence, but in my opinion this would still be a detached house since we are only interested in the classification of the residence.

The Spatial Join tool counts how many residential objects with housing classification are located within a single building. We select buildings with a Join_Count greater than 1 and then classify these as "Apartment" using the Calculate Field tool. Since these also include non-detached buildings, previously designated terraced or corner houses will be overwritten as apartments.
Of all residences, we have now identified corner houses, terraced houses, and apartments. The houses that are not yet classified are detached houses. To check this, I select all houses with Woningtype <Null> (in other words, houses not yet classified) and all houses with a Join_Count of 1 and a Frequency of <Null>. Both selections yield the same numbers so far, so the figures are correct up to now. Using the Calculate Field tool, I fill in "Detached house" for Woningtype for this selection.
Step 4: Merging the datasets
We now have two datasets, one with residences and one with buildings that do not contain residences. To get an overview of all buildings in the BAG, I merge these again using the Append tool, after which I have the final product in hand: a dataset containing classification by housing type.

Considerations
Of course, nothing is ever as simple as it seems and there are some things to consider here as well. First of all, possible "errors" in the underlying data. It is important to know that source holders are responsible for updating the data and that if, for example, a building is missing, this affects the outcome of the analysis. A missing building can incorrectly indicate a terraced house as a corner house and an adjacent corner house will then be classified as a detached house. Below I have created an example of such a situation (does not correspond to reality). Therefore always check the source data. If its content is incorrect, please contact content@esri.nl.content@esri.nl

Secondly, there is the definition of a detached house. I chose to only look at whether a house borders another house, but a house can also border a building with another residential function. Because these are mainly sheds or garages in my research area, I chose not to include these buildings. It depends on your own objectives regarding what information you want to extract from the data which choice you will make here.
Definitions are also the subject of my third point to consider. When is something an apartment? Suppose there is a row of buildings where the ground floor is a shop and the upper floor(s) is used as housing. Are those homes then apartments or terraced houses? At this moment I have designated these as terraced houses since I only counted residential objects with residential purpose, but you could make a different choice here.
Challenge
This analysis is a first step towards creating a complete dataset with housing classifications. How would you design follow-up steps to distinguish corner houses from semi-detached houses? And what considerations would be relevant for you to include? I am very curious about your ideas!
Houdoe and have a nice weekend!
Relevant links:
BAG information (Kadaster)
Esri Nederland Datasets group in ArcGIS Online
Blog about the BAGv2
Clip tool
Copy Features tool
Select by attribute
Select by location
Calculate Field tool
Polygon Neighbours tool
Frequency tool
Spatial Join tool
Append tool