Opened 14 years ago

Closed 14 years ago

#3564 closed defect (fixed)

Sortshp makes invalid shapefile from 3D-polygon source file

Reported by: jratike80 Owned by: warmerdam
Priority: normal Milestone: 6.0 release
Component: Command Line Utilties Version: unspecified
Severity: normal Keywords: shape sortshp
Cc:

Description

It looks like sortshp utility creates a somehow invalid sorted shapefile as an output if the input file is a 3D Polygon shapefile. I can repeat the error in my environment which is Windows 2003 Server and sortshp from GDAL 1.7.0dev (FWTools 2.4.2).

How to test:

  • Take a 3D Polygon shapefile
  • do sortshp
  • try to convert the sorted shapefile with ogr2ogr

Change History (1)

comment:1 by warmerdam, 14 years ago

Keywords: shape sortshp added
Milestone: 6.0 release
Resolution: fixed
Status: newclosed

I have made the following changes in trunk (r10592,r10953):

  • sortshp.c now sets error reporting to stderr (for msSetError())
  • sortshp.c now checks msSHPCreate and msDBFCreate return values.
  • mapshape.c's msSHPCreate() now issues an error if an attempt is made to create z/m type shapefiles with USE_POINT_Z_M is not enabled.
  • mapshape.c's msSHPWrite now correctly writes Z/M shapes if requested and enabled - they were being written corrupted.

I should note that error checking in mapshape.c seems ... lacking, and that support for z/m shapefiles in mapserver has clearly not been tested much.

Note: See TracTickets for help on using tickets.