#2120 closed defect (invalid)
shp2pgsql mishandles geometry column
Reported by: | arencambre | Owned by: | pramsey |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.0.2 |
Component: | postgis | Version: | 2.0.x |
Keywords: | Cc: | aren@… |
Description
Running shp2pgsql on the attached SHP produces the attached SQL file. The only switch I used was -s 3081.
The geometry column is mishandled for two reasons:
- Type is varchar. Should be geometry.
- Even if varchar was correct, it's making a varchar with length 255, which is far to small to contain some of the values for that column in the SQL INSERT commands.
This is happening with 2.0.1.
Attachments (2)
Change History (5)
by , 12 years ago
Attachment: | cities within Dallas County.zip added |
---|
by , 12 years ago
Attachment: | cities.sql added |
---|
comment:1 by , 12 years ago
comment:2 by , 12 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
There is nothing wrong here. The issue is with your data file.
If you look at the dbf file you've got, you'll see that it indeed does have a column called the_geom and it infact does have text that looks like the wkt output of a geometry.
The geometry data is always kept in the .shp file and never has a name. shp2pgsql when the -g is not spec ified defaults to calling it geom.
Note:
See TracTickets
for help on using tickets.
Additionally, the AddGeometryColumn statement in the SQL says that the geometry column name is geom when in fact it is the_geom.