Opened 5 years ago

Closed 5 years ago

#4591 closed task (fixed)

Upgrade shapelib

Reported by: strk Owned by: dfuhry2
Priority: medium Milestone: PostGIS 3.1.0
Component: postgis Version: master
Keywords: Cc:

Description

New code is better :) See https://github.com/OSGeo/shapelib/pull/3 which was contributed by a PostGIS user initially as a pull request for our copy: https://git.osgeo.org/gitea/postgis/postgis/pulls/40

Change History (8)

comment:1 by robe, 5 years ago

Owner: changed from pramsey to dfuhry2

comment:2 by pramsey, 5 years ago

I just tried to copy in upstream, but it broke us :(

 ./shp2pgsql ../regress/loader/Point
Shapefile type: Point
Postgis type: POINT[2]
SET CLIENT_ENCODING TO UTF8;
SET STANDARD_CONFORMING_STRINGS TO ON;
BEGIN;
CREATE TABLE "." (gid serial);
ALTER TABLE "." ADD PRIMARY KEY (gid);
SELECT AddGeometryColumn('','.','geom','0','POINT',2);
COMMIT;
ANALYZE ".";

Almost like it's not bothering to iterate on the file.

comment:3 by pramsey, 5 years ago

Just checked in debugger, it's iterating, but it thinks every record is deleted due to a DBF file marker.

comment:4 by Paul Ramsey <pramsey@…>, 5 years ago

In 00eb4b4/git:

Update the shapelib copy to the latest.
References #4591.
Required two changes to pass regression.

  • Modify dbfopen.c so that DBFIsRecordDeleted() does not test iShape >= psDBF->nRecords unless psDBF->nRecords > 0.
  • Add DBFSetWriteEndOfFileChar(state->dbf, 0) to pgsql2shp-core.c after dbf opening, since apparently we did not write the EOF marker in earlier versions.

comment:5 by Paul Ramsey <pramsey@…>, 5 years ago

In 42dd04bb/git:

Fix CI failure in SADFWrite,
References #4591

comment:6 by Algunenano, 5 years ago

I think this broke Windows build: https://trac.osgeo.org/postgis/ticket/4603

comment:7 by robe, 5 years ago

Milestone: PostGIS 3.0.1PostGIS 3.1.0
Version: 3.0.xmaster

We didn't change shapelib yet in 3.0. Given the invasiveness of it, I say we keep it at 3.1 and don't backport it.

comment:8 by pramsey, 5 years ago

Resolution: fixed
Status: newclosed

I think this is done, new bugs can get new tickets.

Note: See TracTickets for help on using tickets.