Use atleast 4 unique vertices per quad and dont use "shared vertices" between quads.
In your case it looks like the vertices are not shared but the uv coordinates dont match with the vertices due to wrong indexing. shared vertices can be spotted along the edges to the next quad, because interpolation would occur between shared edges, e.g. going from one texture into the other. its called vertex blending, in your case it doesnt look like vertex blending.
Each vertex (indexed vertex) must have a uv coordinate that matches the corners of your texture inside the big texture atlas. You are asking to implement a texture atlas based terrain with hard edges and without vertex blending. Please read about uv mapping, vertex coloring, vertex blending, texture atlas. it really helps to know the techniques in detail.
Thats how you can solve your problem:
- Generate a big image that contains all your little snippets for the terrain with atleast 2 pixels space between every texture island or sprite. The image must be power of two. 256x256, 512x512, 1024x1024, etc. is power of two. Its more efficient and some gpus have limitations with non power of two textures.
- draw your terrain on a sheet of paper by drawing all triangles independently and assigning a uv coordinate for every triangle. That sheet is your reference of expected output and you can use it for debugging (its because you need to match uv coordinates for every quad / triangle pair)
- Dont use "shared vertices" between quads if you want hard looking edges between quad tile geometry and textures to get a classic 2d look. it means that every quad is independent and consists of its own unique 4 vertices, normally a quad is 6 vertices because you actually draw 2 triangles, but you can get away with "sharing" vertices inside the quad by using the center 2 vertices twice inside index buffer but not outside with the next quad!
if you use indexing to save some vertices you have to use DrawIndexed method and not regular draw! You can read about the difference when looking for vertex input layout, jagged vertex buffers, etc.