Covered Topics:
- Multipoint Shape File
- Federal and State ArcGIS Basemaps
- Nearest Neighbor
- Pairwise Comparision
The April meeting was held at Interim CDA. Thanks again for their generous use of their conference room.
Multipoint Shape File
Clifford came in with a multipoint layer sourced from a shape file that wasn’t working with the shp2osm.py script he found. He need to make it into a single point layer. The group worked together to determine that he could open the shape file in QGIS and then use the Multipart to Single Part option from the Geometry Tools sub-menu on the Vector menu.
Federal and State ArcGIS Basemaps
Stu had a follow-up to last month’s basemap topic. Mappingsupport.com has published a basemap clearing house for Federal and State Esri ArcGIS servers. More details are available in Stu’s Basemaps & Map Services document.
Nearest Neighbor
Stu demonstrated a plugin he had found to perform the nearest neighbor analysis, NNJoin.
- The nearest neighbor analysis identifies with feature in the join layer is closest to each feature in the input layer and calculates the distance between them.
- Remember that the distance in a geographic projection computing the distance in degrees produce problimatic results.
- Layers must be in the same projection for this to work.
- Stu used data in Alaska
- Input layer is points (bore holes)
- Join layer is polygons (lakes)
- Will operate on selected points and selected polygons if there are active selections.
- Outputs to an layer in memory without the option to specify writing it to disk.
- To save the output when the tool is done, you can save the resulting layer or join it to your initial point layer and copy the resulting data to a new field.
- You can specify the name of your distance field in the output layer.
- Input layer can be generalized to centroid if it isn’t already single point geometry.
*_ Join_ layer can be generalized to an existing spatial index.
- Data Management Tools -> Create Spatial Index
- Clifford experimented with the spatial index.
- He first used the tool on address points and building polygons from his Bothel project.
- With out spatial index setting it took less than 5 minutes
- He created spatial index on the buildings and choose to use the indexing and it took much longer. This is the opposite of what we expected.
- You can specify the the same layer for both input and join to find nearest neighbors within one layer.
Pairwise Comparision
Stu wanted to consider a related problem not addressed by NNJoin, distance from each feature to every other feature or pairwise comparision.
- May use with two layers or within a single layer.
- Distance Matrix is built in to QGIS.
- Multiple output algorithms to choose from:
- Default gives a unique record for each pair of features and produces x^2 results from x features.
- The second option produces a result with 1 row for each feature and a column for each feature producing a matrix style result.
- Warning: shape files can only have 255 fields and so presents a limit to how many features can be processed with this option.
- Multiple output algorithms to choose from:
- Watch out! This will make exceedingly large outputs with relatively small inputs.
- Stu discussed how it is not possible to use anything but points with Distance Matrix.
- Paul lead a discussion of how we can emulate Distance Matrix with NNJoin by selecting each feature in the_join_ layer and run the tool separately for each single feature. Then appending them all resulting layers together to match the default output algorithm.
- Clifford pointed out that you could name the distance field uniquely on each iteration and produce an output like the second ouput algorithm.
If anyone has corrections or additions they would like to make to these notes please let Paul McCombs know, or submit a pull request on github