I have two shapefiles (blue_polyline.shp and red_polyline.shp). How to subtract blue line from red line and keep the different line(keep the red line in the third figure).
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
It depends on the license that you have. If you have ArcGIS Advanced license, then you can use Symmetrical Difference. Unfortunately, Union tool cannot be used because it works only with polygon geometry not polyline:
All input feature classes and feature layers must have polygon geometry.
If you don't have advanced license, and you have QGIS, then you can use Difference tool from
Vector -> Geoprocessing tools -> Difference in QGIS 2.14.15, as follows:
Difference polyline layer:
What you're looking for in ArcGIS is the
Erase tool in the data management toolbox. This tool is only available if you have an advanced license however...
If you don't have access to the
Erase tool, read the following workaround: Subtracting Polygons which also works with Polylines - just use a minor buffer on them first, in order to convert them to polygons.