Select to view content in your preferred language

Snap points to lines by stratum

3376
6
Jump to solution
07-04-2016 05:00 AM
LeneKjær
New Contributor II

I have a rasterlayer with stratified landcover (4 different classes) and have created random points (study sites) in each strata class (using R). My problem is now that I want to snap these points to the nearest road but make sure that the strata is still the same. So not only snap to nearest line, but nearest line, that falls within a similar stratum as the point. I know of the near tool, but I cannot see that this tools makes sure that the strata stays the same for the snapped point. I have the strata raster layer, a shape file with the different points and a polyline layer with roads. Does anyone have any ideas – is this even possible in ArcMap or do I need to consult R again? I have ArcMap 10.1 with a standard license.

0 Kudos
1 Solution

Accepted Solutions
JayantaPoddar
MVP Esteemed Contributor

Check if the following workflow suits your requirement. Please read the complete workflow before proceeding.

1. Convert the above classified raster to polygon http://pro.arcgis.com/en/pro-app/tool-reference/conversion/raster-to-polygon.htm

2. Add a new field to the polygon layer (Attribute Table), fill the values of appropriate LandUse Class.

3. Intersect the road layer (Polyline) with the above polygon layer. Keep the Join_Attributes parameter as "ALL" and Output_Type parameter as "LINE". http://desktop.arcgis.com/en/arcmap/10.3/tools/analysis-toolbox/intersect.htm

So, the intersected line feature will also have the attributes of the polygon layer.

4. Use Spatial Join on the Point layer, keeping the polygon layer as the Join_Features. http://pro.arcgis.com/en/pro-app/tool-reference/analysis/spatial-join.htm

This should create a new point layer with the attribute values of both the layers.

5. Use Definition query on the Road Layer as well as the Point Layer to filter them based on each LandUse class at a time. Example Expression:  "LU_CLASS" = 'Waterbody'

6. With the definition query intact, snap the points to the Road Layer using snappoints. of GME (Free extension available for both ArcGIS and R)  http://www.spatialecology.com/gme/images/SpatialEcologyGME.pdf (Page 140)

You can download it from http://www.spatialecology.com/gme/gmedownload.htm

7. Repeat Step 5 and 6 for all the LandUse Classes.

8. Merge the resulting point features to get a new point layer consisting of all the snapped points. http://pro.arcgis.com/en/pro-app/tool-reference/data-management/merge.htm

Note: a) Keep same projection system for all the features.

b) Keep the Snap Distance high enough to allow all the points to get snapped (if required) at Step 6.

Hope it helps!!!



Think Location

View solution in original post

6 Replies
DanPatterson_Retired
MVP Emeritus

well I would consult R, since you only have a standard license and there is no capabilities to snap to rasters

LeneKjær
New Contributor II

Ok, I am looking into it right now, but have not been able to find anything yet. Thanks for your advice 🙂

0 Kudos
JayantaPoddar
MVP Esteemed Contributor

Check if the following workflow suits your requirement. Please read the complete workflow before proceeding.

1. Convert the above classified raster to polygon http://pro.arcgis.com/en/pro-app/tool-reference/conversion/raster-to-polygon.htm

2. Add a new field to the polygon layer (Attribute Table), fill the values of appropriate LandUse Class.

3. Intersect the road layer (Polyline) with the above polygon layer. Keep the Join_Attributes parameter as "ALL" and Output_Type parameter as "LINE". http://desktop.arcgis.com/en/arcmap/10.3/tools/analysis-toolbox/intersect.htm

So, the intersected line feature will also have the attributes of the polygon layer.

4. Use Spatial Join on the Point layer, keeping the polygon layer as the Join_Features. http://pro.arcgis.com/en/pro-app/tool-reference/analysis/spatial-join.htm

This should create a new point layer with the attribute values of both the layers.

5. Use Definition query on the Road Layer as well as the Point Layer to filter them based on each LandUse class at a time. Example Expression:  "LU_CLASS" = 'Waterbody'

6. With the definition query intact, snap the points to the Road Layer using snappoints. of GME (Free extension available for both ArcGIS and R)  http://www.spatialecology.com/gme/images/SpatialEcologyGME.pdf (Page 140)

You can download it from http://www.spatialecology.com/gme/gmedownload.htm

7. Repeat Step 5 and 6 for all the LandUse Classes.

8. Merge the resulting point features to get a new point layer consisting of all the snapped points. http://pro.arcgis.com/en/pro-app/tool-reference/data-management/merge.htm

Note: a) Keep same projection system for all the features.

b) Keep the Snap Distance high enough to allow all the points to get snapped (if required) at Step 6.

Hope it helps!!!



Think Location
LeneKjær
New Contributor II

Thank you very much - I will look at it tomorrow as I do not have ArcGis at home. One concern I have though, is that 1 polyline can cross several polygons/raster pixels with different land cover classes, but I think 1 line can only have one class? And some roads are very long, so this will not work for me. But I will look at it.

I was also thinking of converting both the point layer and polyline layer to rasters, creating values for cover class + point or line - then extract only those pixel with both coverclass and point/lineh. Then I can make some distance calculations - but not sure how I end up snapping points?

0 Kudos
LeneKjær
New Contributor II

The above method seems to do what I want - but the snappoints method seems to snap all points of all landuse classes even though I did do a definition query on both files in ArcMap. So I may have to create sepearate files for each landuse class. I will try this and get back to you. Thanks a lot!

0 Kudos
LeneKjær
New Contributor II

I could NOT get GME to work properly, but once I had the new point layer with the attribute values of both the layers and the intersected road layer and separated all files in land cover classes, Icould just use the snap tool in ArcMap - so it works! Thank you so much for your help, I very much appreciate it.