Calculating building external wall from shapefile

Jump to solution
05-04-2016 10:36 AM
New Contributor II

Hi GIS-people 😉

I'm a master student and new on this forum. I appreciate any help of yours.

I have two data set (attached):

  • Shapefile of buildings containing the height of each building as well.
  • A parcel shape file. Several buildings are assigned to a single parcel.

I am interested in calculating the sum of the surface of external walls of buildings (m2) in each parcel. In other words, I want to know how square meters (m2) of external walls I have in each parcel. However, it is important for me to exclude those walls which are in common in between of buildings. For instance, if two buildings with the heights of 10 m and 6 m are attached from one side, the goal would be to include 4 m of the 10 m external wall and exclude the 6 m which both walls are attached with each other.

I hope I was successful in describing the question. Thanks for your responses in advance.



0 Kudos
1 Solution

Accepted Solutions
Esri Esteemed Contributor

OK, it seems there is a problem when using the the overlapping polygons. I thought there would be, since for instance this line (in cyan):

... is created twice. However this is what happens in the attribute table:

The LEFT_FID and RIGHT_FID will be the same, joining the same building height for left and right and the height difference "H_DIF" will be 0, so the surface will be 0.

In 3D the situation looks as follows (using the building polygons and extruding on the field HEIGHT):

In case we are interested in the surface of the walls of the green building we can define the minimum height (left or right) of the neighboring buildings as base height and use the height difference as extrusion:

This looks almost OK, but there is a part of the wall that should not have been included:

If you look at it in 2D you will see that it created 4 lines from the neighboring polygons (see cyan line):

Looking at the attributes of selected lines:

It learns us that it should ignore 3 of the 4 records and only include the one with the highest HEIGHTs. When there are two polygons with overlap composing a single building, the polygon with the highest HEIGHT should not start on the ground, but on the HEIGHT of the lowest polygon. Although this will complicate the analysis, it is possible to derive the surface of the exposed walls.

View solution in original post

18 Replies
Regular Contributor III

Do you have an identifier to identify the exterior walls?

Feature To Polygon—Help | ArcGIS for Desktop

0 Kudos
New Contributor II

I appreciate your quick response.

I don't know what that what you are saying is!

What I have is those two shape filed I have attached. I hope there is a solution for it...

0 Kudos
MVP Emeritus

Assuming that your data are in projected coordinates, have you calculated the area for the features as a first start?  The Calculate geometry tool can be used or tools in arctoolbox.  This may be the first time on geonet, but what is your experience with arcmap? You will get flooded with suggestions, but indicating your gis expertise would help others focus on the simple

0 Kudos
MVP Regular Contributor

This could be a little tricky.

My approach would be to intersect each building polygon with other near buildings. This will give you all shared walls with the height of each in an attribute table. Then one could turn all of the building polygons into lines and erase shared walls found with the intersect from that feature class or shapefile. One can use the field calculator to find the difference in height of the intersect feature. This, with the non-shared walls would give you the building blocks to find your area calculation. The tricky part is doing this for all buildings in your shapefile. As it would require each building to be selected and intersected with all of it's near buildings. Each intersect would create a new feature class that would all need to be merged together in the end. I would program a solution for this first part of your problem with python. But others may use model builder which does not require programming. 


Intersect—Help | ArcGIS for Desktop

Calculate Field examples—Help | ArcGIS for Desktop

Merge—Data Management toolbox | ArcGIS for Desktop

Feature To Line—Data Management toolbox | ArcGIS for Desktop

Python for ArcGIS | ArcGIS Resource Center

What is ModelBuilder?—ArcGIS Pro | ArcGIS for Desktop

Erase—Help | ArcGIS for Desktop

0 Kudos
New Contributor II

Oh wow, that's very kind of you for writing the script in phyton. This will be a miracle for my work...!


0 Kudos
Esri Esteemed Contributor

If you have access to an Advanced license you could do this in the following way:

  • Use "Polygon to Line" tool with the option IDENTIFY_NEIGHBORS to generate a line featureclass that allows you to identify shared walls. This will have fields for LEFT_FID and RIGHT_FID. Use these fields to join the table of the buildings to fill new fields with the height for the left building and right building (when LEFT_FID is -1 the wall is not shared)

Base on the attributes you can identify the situation of the wall (shared, not shared between parcels)

As mentioned before you can join the data of the buildings to the wall using the LEFT_FID and RIGHT_FID and calculate the height difference and wall surface:

To identify the parcel the building is in, use the label points of the building (inside):

and perform a spatial join of the points to the parcels. Use the ORIG_FID and the LEFT_FID and RIGHT_FID fields to join the parcel to the wall lines to avoid problems caused by these kind of situations:

In the table of the wall lines you can summarize by "Final_Parcel" to get the total amount of waal surface per parcel. I assigned the surface of the shared wall to the parcel where the highest building is located.

Find attached the (intermediate) results for a small area.

MVP Emeritus

Nice job Xander... I am going to move this to Geoprocessing​ so it doesn't get lost in the canyon of all things GIS

New Contributor II

Dear Xanders

thank you very much for the concrete solution. however, as I am not a

professional, i couldn't follow up with some of the steps... for example it

is mentioned to joining the table of buildings (building_height?) to the

table of 'polygon to line' , where the right_FID and left_FID are. right??

I do not see a common field among these two table where they can be joined.

i tried different ways, but non of them come close to what you shared as


BTW, how did you added the continuous building values in

building_:height_sel table?`


0 Kudos
Esri Esteemed Contributor

There are a number of fields in the different featureclasses that are called differently, but refer to the same object ID.On one hand you have the building polygons:

The Object ID in this featureclass is the field "OBJECTID_1". When you derive the wall lines (polygon to lines) you obtain this table:

The LEFT_ID refers to the value of the field OBJECTID_1 in the building polygon fc that is located on the left side of the line and the RIGHT_FID refers to the value of the field OBJECTID_1 in the building polygon fc that is located on the right side of the line:

Before you join you can add two fields, for instance:

  • Left_Height and
  • Right_Height

When you perform a join, you will do this from the attribute table of the lines:

... using first LEFT_FID and joining to the building height featureclass using the OBJECTID_1 field as common field:

With the join active you can use the field calculator to fill the field Left_Height with the values of the field "Building_Height_sel.HEIGHT" (the joined field from the Building Height featureclass with the height values).

Remove the join and perform a new join to obtain the values for the Right Height field (using the RIGHT_FID and OBJECTID_1 fields). Based on this you can calculate the

To obtain Height_dif you can substract both height fields. However, there are some things to consider:

  • in case LEFT_FID = -1, there is no building polygon on the left side of the line. Take Right_Height as height difference.
  • In the other cases, use Abs([Left_Height] - [Right_Height]). This will get the absolute value of the difference.

The Wall Surface can be obtained multiplying the Height_dif values with the Shape_Length values (I prefer working with fc's stored in a FGDB then with Shapefiles, since the FGDB fc will add and maintain fields like length and area).

The other part is to assign the surface to a parcel. For this we will need to know to which parcel we should assign the line. Remember that the line is often located on the border of two parcels. In the explanation below I assign the wall surface to the parcel where the highest building (of the two neighboring buildings) is located.

As mentioned in the previous post I converted the buildings to points using the inside option. These points are located in each building and have the same attributes (to be sure I created a field in the building height fc containing "Building " & [OBJECTID_1]).

You can perform a spatial join from these points to obtain the information of the parcel where the point (building) is located:

This will generate a new point fc with the attributes of the parcels:

You can use the OBJECTID_1 field as common field to join the PARCEL field using the LEFT_FID and RIGHT_FID to get the Left_Parcel and Right_Parcel of each wall line.

The Wall Situation field contains the case. It is either.

  • a wall that is not shared "Single Wall" (when left_Parcel is Null)
  • a wall between two building inside the same parcel "Inside single Parcel" (Left_Parcel = Right_Parcel)
  • a wall on the limit of two parcels (Left_Parcel <> Right_Parcel)

The Final_Parcel field can be defined by:

  • taking the Right_Parcel when it is a single wall or the wall is located in the same parcel
  • taking the Right_Parcel when Right_Height > Left_Height
  • taking the Left_Parcel when Left_Height > Right_Height

You don't have to include Left_Height = Right_Height, because the surface will be 0.

Hope this helps to understand the steps.

Kind regards, Xander