Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#768 closed defect (invalid)

Probe_geometry_columns() don't work correctly

Reported by: aperi2007 Owned by: robe
Priority: medium Milestone: PostGIS 2.0.0
Component: postgis Version: master
Keywords: Cc:

Description

Hi, the probe_geometry_column seem don't work correctly.

I try this code sql:

drop table if exists caricamento._csr_map_crop_multiline; -- _csr_map_crop is a multipolygon table create table caricamento._csr_map_crop_multiline as select a.gid,a.idmappa,ST_Boundary(a.geom) from caricamento._csr_map_crop as a where ST_IsValid(a.geom)=true; SELECT Probe_Geometry_Columns();

the result seem ok because no error is given. But opening the geometry_columns table there isn't the "_csr_map_crop_multiline" table.

I try this on a debain 32bit with postgis 200 trunk and with postgres 9.0.2

More information:

executing the sql I have reported a good number of self-intersection. But I don't think that self-intersection are relate to this problem.

... W (183): Self-intersection at or near point 1.70284e+06 4.84765e+06

W (184): Self-intersection at or near point 1.70402e+06 4.85107e+06 W (185): Self-intersection at or near point 1.68837e+06 4.85484e+06 W (186): IllegalArgumentException: Invalid number of points in LinearRing found 3 - must be 0 or >= 4 W (187): Self-intersection at or near point 1.69997e+06 4.8436e+06 W (188): Self-intersection at or near point 1.67601e+06 4.85714e+06 W (189): Self-intersection at or near point 1.67035e+06 4.87667e+06 W (190): Self-intersection at or near point 1.67163e+06 4.87903e+06

... W (260): Self-intersection at or near point 1.62796e+06 4.84335e+06

W (261): Self-intersection at or near point 1.69071e+06 4.84526e+06 W (262): IllegalArgumentException: Invalid number of points in LinearRing found 3 - must be 0 or >= 4 W (263): IllegalArgumentException: Invalid number of points in LinearRing found 3 - must be 0 or >= 4 W (264): Self-intersection at or near point 1.70798e+06 4.85299e+06 W (265): Self-intersection at or near point 1.59653e+06 4.87314e+06 W (266): Self-intersection at or near point 1.63454e+06 4.87679e+06 W (267): Self-intersection at or near point 1.68673e+06 4.84699e+06 W (268): Self-intersection at or near point 1.69834e+06 4.89465e+06

...

Regards.

Change History (6)

comment:1 by robe, 14 years ago

Owner: changed from pramsey to robe

Andrea,

I found some deprecated calls in this function and others and fixed these at r6597. Let me know if that resolves your issue.

comment:2 by aperi2007, 14 years ago

I try again

drop table if exists caricamento._csr_map_crop_multiline; create table caricamento._csr_map_crop_multiline as select a.gid,a.idmappa,ST_Boundary(a.geom) from caricamento._csr_map_crop as a where ST_IsValid(a.geom)=true; SELECT Probe_Geometry_Columns();

no error see-ing but the result is:

probed:9 inserted:0 conflicts:9 stale:0

This report don't is correct because the geometry_colums has just 9 tables, and the table just created "_csr_map_crop_multiline" will be the #10.

So the Probe function seem to ignore the "_csr_map_crop_multiline" from insert into the geometry_columns.

However I don't sure this is an error. Perhaps the problem is in the Populate_Geometry_Columns() ?

comment:3 by robe, 14 years ago

Sorry missed a spot. Should be fixed at r6609.

comment:4 by aperi2007, 14 years ago

I tested r6609. Unfortunately it seem still don't work correctly.

This is what is happened:

#select f_table_schema
'.' f_table_name as tables from public.geometry_columns;

-->Results: tables caricamento._am_com_arc caricamento._am_com_region_am_com caricamento._pcca_spt_arc caricamento._pcca_spt_polygon caricamento._pcca_spt_labelpoint caricamento._csr_map_crop caricamento._world_borders caricamento._v_linee_elementari_250 caricamento._v_suolo_250

#drop table if exists caricamento._csr_map_crop_multiline;

#create table caricamento._csr_map_crop_multiline as select a.gid,a.idmappa,ST_Boundary(a.geom) from caricamento._csr_map_crop as a where ST_IsValid(a.geom)=true;

#select Probe_geometry_columns();

Results:

probed:9 inserted:0 conflicts:9 stale:0

#select f_table_schema
'.' f_table_name as tables from public.geometry_columns;

-->Results: tables caricamento._am_com_arc caricamento._am_com_region_am_com caricamento._pcca_spt_arc caricamento._pcca_spt_polygon caricamento._pcca_spt_labelpoint caricamento._csr_map_crop caricamento._world_borders caricamento._v_linee_elementari_250 caricamento._v_suolo_250

comment:5 by robe, 14 years ago

Resolution: invalid
Status: newclosed

Andrea,

For some reason I got confused and thought you were talking about populate_geometry_columns(). Unless I'm mistaken, probe_geometry_columns will only added entries to geometry_columns table if your table has srid and geometry dimension constraints where as populate_geometry_columns will add by inspecting you data and also add constraints to your table if its missing contraints.

Given that you created your table with a create as statement, you don't have contraints on the table. So I'm going to mark this as invalid and close it out.

Feel free to reopen if you feel I'm mistaken and it worked with this set in 1.5.

comment:6 by aperi2007, 14 years ago

Hi, robe.

You have reason ! I'm afraid for this avoidable mistake.

Note: See TracTickets for help on using tickets.