How can I snap a polygon to a line? For example, I have a polygon which represents some meadows to snap over a line which represents a road.
You'd go about it like you did when you snapped to points in this post
All you have to change is that instead of choosing to snap to vertexes you would snap to segments (or both, depending on your goal).
I think you can utilize ArcGIS to solve you issue, as it has a tool named Snap which would take into consideration of your input layer and reference layers and would move only the input layer on the basis of tolerance provided.
With this tool you will have to provide an input layer and a reference layer on the basis of which you can move the input layer. In the you will have option to choose whether to snap on the vertex, End Point or Edge, Just make sure you have a copy of the layer as it actually alters the Original layer, Please keep the Tolerance level low as you don't want to distort the data.