Changes between Initial Version and Version 1 of Ticket #2124
- Timestamp:
- Dec 30, 2007, 8:07:16 AM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #2124
- Property Keywords shape added
- Property Status new → assigned
- Property Component Utilities → OGR_SF
-
Ticket #2124 – Description
initial v1 1 1 I discovered a bug in shapelib and how it handles Z and M data. 2 2 What I did was converting a Polygon shapefile to PolygonZ using: 3 {{{ 3 4 OGR2OGR.exe -f "ESRI Shapefile" countriesZ.shp countries.shp -lco SHPT=PolygonZ 4 5 }}} 5 6 At the shapefile page, there is this warning: "Shapefiles with measure values are not supported". 6 7 7 8 The thing is that you cannot create a shapefile with Z values without also having measure values. Its either XY, XYM or XYZM (see the spec). I confirmed this with files created using ArcCatalog, and sure enough that's how it is (In ArcCatalog you can choose to only have Z values in the file, but it really creates a Z+M file). 8 9 9 10 The problem is that the shapetype header is set to 15 (=PolygonZ*) so a shapefile reader will think there are both Z and M values in the file. Shapereaders that ignores Z and M doesn't have a problem, but if they are read, they are either incorrect or will risk getting a EOF exception. 11 10 12 *The same thing of course goes for points and polylines. 11 13 12 14 Technically what OGR really creates with the above command is PolygonM, but with an incorrect shapetype value. So the quickest fix would be to change the shapetype to 25 (generally add 10) and change the warning to "Shapefiles with Z values are not supported" (although adding support for both Z and M would of course be the best, and still fairly straighforward).