[postgis-users] New tests for PostGIS binairy from CVS 17 august 2004

TECHER Jean David davidtecher at yahoo.fr
Tue Aug 17 05:11:10 PDT 2004


Hi guys

I compiled postgresql from CVS of 17 august 2004 for postgresql and postgis
too...

I compiled with GEOS 1.0.0, PROJ 4.4.7, AsSVG()

I made some test from PostgreSQL from CVS 20040817 not from pginstaller of
pgfoundary

I not yet released the zip file...Next time...


>From a DOS prompt

	I... CREATE A POSTGIS DATABASE

C:\WINDOWS\system32>createdb testgis
CREATE DATABASE

C:\WINDOWS\system32>createlang plpgsql testgis

C:\WINDOWS\system32>cd c:\postgres75_win32_postgis_082

C:\postgres75_win32_postgis_082>psql -d testgis -c "\i share/postgis.sql"
.....Lot of CREATE FUNCTION

C:\postgres75_win32_postgis_082>psql -d testgis -c "\i
share/spatial_ref_sys.sql"
....Lots of INSERT

All works fine...OK


	II...TRY TESTS FROM README.postgis + AsSVG funtion

I tryed SQL from README.postgis + AsSVG():

 CREATE TABLE geom_test ( gid int4, geom geometry,name varchar(25) );
  INSERT INTO geom_test ( gid, geom, name )
    VALUES ( 1, 'POLYGON((0 0 0,0 5 0,5 5 0,5 0 0,0 0 0))', '3D Square');
  INSERT INTO geom_test ( gid, geom, name )
    VALUES ( 2, 'LINESTRING(1 1 1,5 5 5,7 7 5)', '3D Line' );
  INSERT INTO geom_test ( gid, geom, name )
    VALUES ( 3, 'MULTIPOINT(3 4,8 9)', '2D Aggregate Point' );
  SELECT * from geom_test WHERE geom && 'BOX3D(2 2 0,3 3 0)'::box3d;
  INSERT INTO SPATIAL_REF_SYS
    ( SRID, AUTH_NAME, AUTH_SRID, SRTEXT ) VALUES
    ( 1, 'EPSG', 4269,
      'GEOGCS["NAD83",
        DATUM[
          "North_American_Datum_1983",
          SPHEROID[
          "GRS 1980",
          6378137,
          298.257222101
        ]
      ],
      PRIMEM["Greenwich",0],
      UNIT["degree",0.0174532925199433]]'
    );

  CREATE TABLE geotest (
    id INT4,
    name VARCHAR(32)
    );

  SELECT AddGeometryColumn('testgis','geotest','geopoint',1,'POINT',2);

  INSERT INTO geotest (id, name, geopoint)
    VALUES (1, 'Olympia', GeometryFromText('POINT(-122.90 46.97)',1));
  INSERT INTO geotest (id, name, geopoint)
    VALUES (2, 'Renton', GeometryFromText('POINT(-122.22 47.50)',1));

  SELECT name,AsText(geopoint),assvg(geopoint) FROM geotest;


It gave me:


C:\postgres75_win32_postgis_082>psql -d testgis -f
c:\postgis_validation\test1.s
ql
CREATE TABLE
INSERT 43956 1
INSERT 43957 1
INSERT 43958 1
psql:c:/postgis_validation/test1.sql:8: NOTICE:  postgis_gist_sel called
psql:c:/postgis_validation/test1.sql:8: NOTICE:   No statistics, returning
defau
lt estimate
 gid |                       geom                       |   name
-----+--------------------------------------------------+-----------
   1 | SRID=-1;POLYGON((0 0 0,0 5 0,5 5 0,5 0 0,0 0 0)) | 3D Square
   2 | SRID=-1;LINESTRING(1 1 1,5 5 5,7 7 5)            | 3D Line
(2 rows)

psql:c:/postgis_validation/test1.sql:23: ERROR:  duplicate key violates
unique c
onstraint "spatial_ref_sys_pkey"
CREATE TABLE
psql:c:/postgis_validation/test1.sql:30: NOTICE:  Invalid schema name -
using cu
rrent_schema()
CONTEXT:  SQL query "SELECT  AddGeometryColumn('', $1 , $2 , $3 , $4 , $5 ,
$6 )
"
PL/pgSQL function "addgeometrycolumn" line 4 at select into variables
                         addgeometrycolumn
--------------------------------------------------------------------
 public.geotest.geopoint SRID:1 TYPE:POINT
 geometry_column fixed:0
(1 row)

INSERT 43968 1
INSERT 43969 1
  name   |       astext        |          assvg
---------+---------------------+-------------------------
 Olympia | POINT(-122.9 46.97) | cx="-122.9" cy="-46.97"
 Renton  | POINT(-122.22 47.5) | cx="-122.22" cy="-47.5"
(2 rows)


	III. ...LOADING SHAPEFILES AND CREATE INDEX  from shp2pgsql

>From my own shapefiles, I did

createdb diren_geostat
createlang plpgsql diren_geostat
psql -d diren_geostat -c "\i
c:/postgres75_win32_postgis_082/share/postgis.sql"
psql -d diren_geostat -c "\i
c:/postgres75_win32_postgis_082/share/spatial_ref_sys.sql"

shp2pgsql -s 27582 -D
"C:\donnees_sig\statcom2\statcom\myshapefiletemp\APB_LR.shp" apb_lr
diren_geostat | psql diren_geostat
psql -d diren_geostat -c "create index apb_lr_index_spatial on apb_lr using
gist(the_geom gist_geometry_ops)"


shp2pgsql -s 27582 -D
"C:\donnees_sig\statcom2\statcom\myshapefiletemp\znieff_lr_type2.shp"
znieff_lr_type2 diren_geostat | psql diren_geostat
psql -d diren_geostat -c "create index znieff_lr_type2_index_spatial on
znieff_lr_type2 using gist(the_geom gist_geometry_ops)"

vacuumdb diren_geostat

All works fine too... :-)

		IV... AsSVG and others functions

All works fine :)


C:\postgres75_win32_postgis_082>
TECHER JEAN DAVID
- Responsable Informatique 01MAP -
e-mail:davidtecher at yahoo.fr
Tél: 06 85 37 36 75
Site PostGIS: http://techer.pascal.free.fr/postgis/index.htm






More information about the postgis-users mailing list