Do not crash with M and Z shapefiles

These changes allows the script to read 3D and measured shapefiles 
without crashing. It simply skips the Z and M part of the shape. Consequently it still returns 2D features only.