Digitizing II: Rooms at CPH
Introduction
For this lab, you'll be digitizing a portion of the CPH campus for use in a CPH online map. You'll want to take your time and carefully digitize the features. To make sure the digitizing is done well, you'll be working in groups of two and then QAQCing each others work. We'll be digitizing in the same way you did for your island so part of this process is already familiar to you. However, we'll need to carefully digitize on top of a raster to have high quality data.
For 2023:
Previous classes have digitized a large amount of data for the campus but only a subset of the rooms inside the buildings. The goal this semester will be to add the rooms in buildings that are of the most interest to students. I'm assuming these are the buildings that contain class rooms.
QAQC
Go to the web page for the websites that are maintained by the Institute for Spatial Analysis Mapping and Modeling (ISAMM). Scroll down and click on the "New CPH Map". This is a map of campus that contains a lot of spatial data, most of which was contributed by CPH students.
Eventually, we want to have all the rooms on campus digitized but that is a lot of rooms. For this semester, the goal is to make sure we have all of the floors that contain rooms that are used for teaching. First, we need to determine which buildings and which floors have been covered. There is a spreadsheet that documents this but we probably should not fully trust a spreadsheet from two years ago that was updated in a quick, 1 week lab. So we'll assign a building or two (based on size) to pairs of students and then check the status of buildings against the existing CPH map. The spreadsheet is named "FloorplanList.gsheet" and is on GoogleDrive at:
G:\Shared drives\Graham Lab\Projects\HSU Web Map
Our first step is to go through the buildings in the spreadsheet and make sure that all the buildings that typically have classes are labeled as having classes (i.e. have "Yes" in the "Has Classes" column. Then, your team should add your name next to one of the buildings and check it on the map. If all the floors rooms look good, indicate that it is "
QAQCed" in the "Room Status" column and then you'll want to start digitizing the rooms for the building.
As you digitize the rooms, make sure to update the "Rooms" sheet in the spreadsheet file.
Please add notes on anything that is amiss and your name as the QAQCer.
Georeferencing an Image
If you need to digitize the rooms for a floor of building, you'll need a PDF of the layout of the floor. There are some PDFs of the building layouts in the Graham Lab folder:
https://drive.google.com/drive/folders/1P0CfJFxe5Zw840hmwCtTq6Iig9Lr7o8X?usp=drive_link
You can also download layouts from the Facilities Link website. Please note that there is a specified format for the file names which is <BuildingName><BuildingLetter>-<FloorNumber>.<Extension>. In other words, the layout for Art A, floor 1 would be "ArtA-1.pdf". Not that G and B are used sometimes as floor numbers.
A PDF is not much good to use in a GIS application so we'll need to convert it to a JPG and then georeference it to the earth.
- Open the PDF in Acrobat and zoom to make the layout as large as possible on your screen.
- Use the SnipIt tool to take a screen shot and save it as a JPG image with an appropriate name (e.g. ArtA-1.jpg)
- Drag and drop the JPG image into a map in ArcGIS Pro.
- Right now the image does not have a defined spatial reference system so it will appear off the coast of Africa.
- Right click on the image and select Properties. Then select "Source" and then "Spatial Reference". It should appear as "Unknown..." (shivers should run down your spine!).
- Load the 3" Arcata Data so you have a high accuracy dataset to georeference to.
- In the Analysis tab, open the Tools panel (which will be called Geoprocessing).
- Search for Define Projection
- Select the Define Projection tool and project the JPG file to match the 3" Arcata Data (State Plane)
- Now examine where your file is located on your map. We fix this by georeferencing the image to the earth.
- Go to the web and search for "arcgis pro georeferencing". This will take you to the help pages from Esri on georeferencing.
- The steps below will take you through the process a bit faster but remember the pages above in case you need them in the future.
- Zoom into the building your are going to digize floors for (i.e. were the layout should appear).
- Make sure to select the layout image rather than the 3" Arcata data for the next steps.
- In the Imagery tab, click on "Georeference"
- Click on the layout raster and click "Fit to Display". The layout raster should appear in your display over the location it needs to be georeferenced to, however, the fit will be very rough.
- Click on the Appearance tab and change the Transparency so you can see the building through the layout (about 50%).
- Click on "Add Control Points".
- Click on a building corner in your layout image (called "source" in ArcGIS terms) and make the layout hidden and click on the corresponding building corner in the Arcata image. When you make the layout visible, you should see the image shift.
- If you have a very rectangular building, you might be able to georeference it with just 4 corners. However, it typical takes 6 to 12.
- If you need to pan the map while georeferencing, hold down the "C" key and you'll see the mouse cursor become a hand. Then you can press and pan the map.
- Georeferencing can be done with a number of different mathematical functions and these are available in the "Transformations" menu. Since these images are for buildings with straight lines, you might want to stay with the 1st Order Polygon.
- When you feel good about the georeferencing, select "Save". You will then have a georeferenced raster file you can load into a GIS.
Don't worry if you need to do this several times. Get a feel for the number of points that are needed and feel free to just number the files (e.g. "ArtB-1_1.tif", "ArtB-1_2.tif") as needed.
Digitizing
- Create a polygon shapefile for the rooms in one of the floors for your building and name the shapefile with "<building>_<floor>.shp". For the first floor of the Forestry Building, this would be "Forestry_1.shp". For Natural Resources second floor, this would be "NaturalResources_1.shp". Please remove the spaces from the building names and use underscores to separate the floor number from the name. Just use "B" for floors that are basements.
- Digize each of the rooms in the floor. Trace over the inside inner edge of the wall of the room. Trace across openings like doors.
- Add a "name" attribute to the shapefile for the of the name of the room and then add the room name to the appropriate attribute. Examples include:
- 104
- 101B
- 108
- Add a "descript" attribute to the shapefile for any additional description information you'd like to include. This might include:
- Womens restroom
- Crop room
- Lecutre hall
- Optional: When done, save the data to the Working folder in:
- 2023 GSP 510 -> HSUData -> 2_Working -> Buildings -> <BuildingName>
- Where <BuildingName> is the name of your building
- Optional: Next, create a polyline shapefile and name it "Entrances". Add the entrances to the building. We are planning on using an arrow that points into the building where the entrances are so please digitize from about 5 meters (15 feet) from the building toward the entrance and perpendicular to it.
- Save this shapefile into the <BuildingName> folder
- Each group should be able to finish at least two floors but some buildings are simpler than others so you may be able to create more. However, reworking data is often as hard as doing it right the first time so please make sure you digitizing accurate.
- Finally, make sure to add the appropriate meta-data to your files. Using the ArcGIS Pro meta-data editor, make sure all the red "x"s are gone by filling in appropriate values for the meta data.
Metadata
The following steps will guide you through completing the "required" metadata from Esri and adding documentation for attributes including their units .
- In ArcGIS Pro, first make sure that you have closed all editing sessions and stopped georeferencing.
- Select the "Project" tab and then "Options".
- Scroll down to "Metadata" and select it.
- Select one of the ISO191115 "Metadata styles". This style includes fields form the International Standards Organization (IS0) version of FGDC metadata specification but it is in an Esri format. If you are ever required to provide true ISO or FGDC metadata, you'll need to do a conversion..
- Go to the Catalog in ArcGIS Pro. Note that there are options for metadata available when you right click on a layer in the Table of Contents but these are for metadata about the layer which I have never seen used. To edit the metadata for a feature layer (shapefile or raster), we need to use Catalog.
- Right click on the shapefile for the rooms in Catalog and select "Edit Metadata". You should see a window appear with the contents of the ISO metadata file on the left and red "x"s next to the elements that are required. Notice that the required items are also listed at the top of the panel for the currently selected element and the boxes where information is required are in red.
- In the "Overview" section:
- Add appropriate text to the boxes that are in red (i.e. "Title" should have a good title for the dataset and the "Description" should describe how it was created and for what purpose).
- As you enter the information and then move the next box to enter more data, the red should disappear. From here, your goal is to get rid of the red!
- In "Topics & Keywords", just select an appropriate "Topic Category".
- In "Citation", you'll need to click on the arrow next to "Dates" and then enter one or more dates.
- In the "Metadata" section:
- In "Details" select the language used for the metadata.
- In "Contacts", click on "New Contact" and enter your information.
- I do not require this but in a professional situation, you'll want to open "Contact Information" and provide appropriate information for them to contact you or another organizational representative.
- In the "Resource" section:
- In "Details", select the language used in the attributes.
- In "Extents", click on "New Extent". Typically you'll want to include a geography bounding box as this is a universal way to describe the location of the data and it will not change if the data is projected to another spatial reference.
- Click on "New Bounding Box".
- Click on the "Map" tab and make sure that the box showing the current coordinate at the bottom of the map is in decimal degrees. If not, right click on the arrow next to it and select "Decimal Degrees".
- Right click in the map near one of the corners of an imaginary bounding box that would surround your data and select "Copy Coordinate".
- Return to the metadata editor and paste the coordinate into "West". You'll need to remove the degree symbol and the "N" and "W" characters, convert the longitude to a negative number, and copy the coordinate value into the appropriate text box. Repeat this for the corner opposite the first one in your bounding box.
- At this point, all the red "x"s should be gone but we still need to add a description of our attributes and especially the units for the attribute values.
- Select "Fields" in the "Resource" section and then add a "New Entity and Attributes Details".
- A shapefile may have different types of features such as roads and trails. These are referred to as "entities" in the FGDC specification. For this shapefile, you can just have one entity, "Rooms". Since we only have rooms in this dataset "Definition" and "Definition Source" are really more than we need for this project so just enter "CPH Web Map Project" for both.
- For each attribute that you added (i.e. you do not have to add FID, Shape, or Id):
- Add a "New Attribute"
- The "Label" is the name of the attribute.
- The "Definition" and "Definition Source" can both be something like "CPH Web Map Project"
- The "Type" will be one of: Long, Text, Float, Double, Short, Long, or Date.
- The Width should be 254 or "Text" and blank for the other types but the editor will not allow a blank field so just add 1.
- Add a "New Range Domain" for any attribute values that you need to include units (i.e. area, length). This step is only needed if you added measured values to the dataset.
- The "Minimum" and "Maximum" fields have to be numbers with the minimum being less than the maximum. For attributes like area, just enter 0 for the minimum and a really large number for the maximum (it would be great if the editor supported "Infinity" but it does not).
- Enter the appropriate "Units" (e.g. "meters", "feet", etc.).
Deploying (Optional)
We'll need to project the data to Web Mercator and then store the data in the web map folder and link it to the website.
- Open QGIS.
- Drag and drop your data into QGIS.
- Right click on the layer and select "Export-> Save Features As".
- Select "GeoJSON" or geographic JavaScript Object Notation as the file type. This is the main file format for vector spatial data on the web and is increasing in popularity in other areas.
- Save the file to your lab folder with the name matching the room and floor as above and ending in ".geojson".
- Click on the world icon to the right of the CRS pop up.
- Enter "web" in the search field.
- Select WGS_1984_Web_Mercato_Auxillary_Sphere and click "OK".
- Click OK
- Go to the folder were you saved your geojson file and open it in Notepad.
- The GeoJSON file is contains very similar data to a shapefile but in a different format and all in one file. Also, it is a text file which makes it slower for computers to read and write but much easier for humans to read.
- The "type" is the type of file as GeoJSON files can contain just one "Point" or an entire "FeatureCollection"
- FeatureCollections have an array of features and each feature has properties (attributes in GIS) and a geometry.
- The properties are organized in a JSON object (see W3Schools for more info) where each entry has a "key" and a "value". The keys are the names of the attributes and the values are the values for the attributes.
- The geometry can be a number of different types but each contains arrays of coordinates with the points that make up the geometry. The different types of geometries are defined by the Well-known text representation of geometry (or WKT). Don't worry if you have not heard of it, very few folks outside of the GIS open source world have.
- In addition, the JSON file can have additional entries:
- Name: typically matches the name of the file
- crs: Coordinate reference system (aka spatial reference system). There are a number of accepted formats for this but many of the have EPSG codes which are well defined.
- Since the geojson file is just one file, you can turn it in without zipping it.
Additional Resources
Creating Reports in MS-Word