[postgis-users] About IsValud() in postgis 0.9.x and 1.0.0RC4. Error?

ksa-nil5 ksa-nil5 at yandex.ru
Sat Mar 26 05:15:14 PST 2005


Hi, all.

I have found some problem. I have two databases. One on PostgreSQL 8.0.0rc5 and postgis 1.0.0rc4. And another on PostgreSQL 7.4 and postgis 0.9.0.
I try next queries on 7.4 and 0.9.0:

ogc2=# select version();
                               version
----------------------------------------------------------------------
 PostgreSQL 7.4 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2.3
(1 row)

ogc2=# select postgis_full_version();
                                        postgis_full_version
-----------------------------------------------------------------------------------------------------
 POSTGIS="0.9.0" GEOS="2.0.1" PROJ="Rel. 4.4.8, 3 May 2004" USE_STATS DBPROC="0.0.1" RELPROC="0.0.1"
(1 row)

ogc2=# select * from spatial_ref_sys where srid = 300004;
  srid  |  auth_name   | auth_srid |                                                                                      srtext                                                                                      |                           proj4text
--------+--------------+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------
 300004 | MapInfo File |    300004 | GEOGCS["unnamed",DATUM["MIF 0",SPHEROID["WGS 84 (MAPINFO Datum 0)",6378137.01,298.257223563],TOWGS84[0,0,0,-0,-0,-0,0]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]] | +proj=longlat +ellps=WGS84 +towgs84=0,0,0,-0,-0,-0,0 +no_defs
(1 row)

ogc2=# select isvalid('SRID=300004;MULTILINESTRING(SRID=300004;(38.0272 56.6408,38.0275 56.6367,38.0274 56.6311,38.0267 56.6305,38.0115 56.6287,38.0109 56.6292,38.0019 56.6433,38.0021 56.6437,38.0036 56.6439,38.013 56.6447,38.014 56.646,38.014 56.6472,38.0137 56.6508,38.0129 56.6533,38.0109 56.6589,38.0087 56.664,38.0066 56.6662,38.0057 56.6676,38.0045 56.6684))');
 isvalid
---------
 t
(1 row)



================
And the same queries on 8.0.0rc5 and 1.0.0rc4

test_export=# select version();
                                  version
---------------------------------------------------------------------------
 PostgreSQL 8.0.0rc5 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2.3
(1 row)

test_export=# select postgis_full_version();
                                          postgis_full_version
---------------------------------------------------------------------------------------------------------
 POSTGIS="1.0.0RC4" GEOS="2.1.1" PROJ="Rel. 4.4.9, 29 Oct 2004" USE_STATS DBPROC="0.2.1" RELPROC="0.2.1"
(1 row)

test_export=# select * from spatial_ref_sys where srid = 300001;
  srid  |  auth_name   | auth_srid |                                                                                      srtext                                                                                      |                           proj4text
--------+--------------+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------
 300001 | MapInfo File |    300001 | GEOGCS["unnamed",DATUM["MIF 0",SPHEROID["WGS 84 (MAPINFO Datum 0)",6378137.01,298.257223563],TOWGS84[0,0,0,-0,-0,-0,0]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]] | +proj=longlat +ellps=WGS84 +towgs84=0,0,0,-0,-0,-0,0 +no_defs
(1 row)

test_export=# select isvalid('SRID=300001;MULTILINESTRING(SRID=300001;(38.0272 56.6408,38.0275 56.6367,38.0274 56.6311,38.0267 56.6305,38.0115 56.6287,38.0109 56.6292,38.0019 56.6433,38.0021 56.6437,38.0036 56.6439,38.013 56.6447,38.014 56.646,38.014 56.6472,38.0137 56.6508,38.0129 56.6533,38.0109 56.6589,38.0087 56.664,38.0066 56.6662,38.0057 56.6676,38.0045 56.6684))');
ERROR:  parse error - invalid geometry


So, I receive an error.
As you can see, I have tested *SAME* geometries in *SAME* spatial reference systems.

Why 0.9.0 tells that the geometry is valid, but 1.0.0rc4 tells that the geometry is invalid?

Sergey Karin



More information about the postgis-users mailing list