#4209 closed defect (fixed)
Issues using pgsql2shp with a postgis table with null geometries
Reported by: | gabrimonfa | Owned by: | pramsey |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.4.8 |
Component: | postgis | Version: | master |
Keywords: | Cc: |
Description
The table has 7120 rows, 50 have null geometries and some of them are at the beginning of the table. Server is PostgreSQL 9.5 with postgis version "2.2 USE_GEOS=1 USE_PROJ=1 USE_STATS=1".
Desired behaviour
The shape is created with all the rows, null geometries in the table are null geometries in the shapefile.
Or it would be possible to add a null handling policy as in shp2pgsql.
Actual behaviour
pgsql2shp 2.4.4 (ubuntu 18.10 package)
The exported shapefile has 7070 rows (as the number of rows with not null geometry in original table), but apparently they are the first 7070 rows, some rows with not null geometry are missing.
All is working correctly if I use a "where geom is not null" clause.
pgsql2shp 2.5.0 (package from apt.postgresql.org in ubuntu 18.04)
Segmentation fault
All is working correctly if I use a "where geom is not null" clause.
pgsql2shp 3.0.0 trunk from svn
Segmentation fault
Program received signal SIGSEGV, Segmentation fault. geometry_type_from_string (str=0x5555557d21f8 "", type=type@entry=0x7fffffffd9bb "", z=z@entry=0x7fffffffd9bc, m=m@entry=0x7fffffffd9bc) at g_util.c:203 203 tmpstr[i - tmpstartpos] = dump_toupper(str[i]);
All is working correctly if I use a "where geom is not null" clause.
Change History (8)
comment:1 by , 6 years ago
comment:2 by , 6 years ago
Table creation:
CREATE TABLE public.ticket_4209 ( id integer NOT NULL, geom public.geometry(Polygon) ); COPY public.ticket_4209 (id, geom) FROM stdin; 1 \N 2 \N 3 0103000000010000000500000000000000000000000000000000000000000000000000F03F0000000000000000000000000000F03F000000000000F03F0000000000000000000000000000F03F00000000000000000000000000000000 \.
Command invocation:
pgsql2shp -f /tmp/test.shp -h host -u user -P password -g geom dbhame "SELECT * FROM public.ticket_4209"
comment:3 by , 5 years ago
Milestone: | → PostGIS 2.4.8 |
---|
Could you attach a link to data file, or some SQL to synthetically generate a table that demonstrates the behaviour?