Tuesday, July 17, 2012

First Impressions with 3DcityDB for PostGIS

Hi.

By some previous work with 3DcityDB and CityGML, and also by an email of a collegue Hugo.L, i was tempted to test both PotsGIS 2.0 and 3DCityDB for PostGIS.

I will skip the installation of Postgres and PostGIS on my MAc and jump straight into the review of the  product.

Impressions:

After following the Tutorial document which required to create a DB using whatever you like and enable it to PostGIS, next steps require additional scripts, however they are created for windows  or at least the
CREATE_DB.bat

which calls

CREATE_DB.SQL

The first one I  tried to UNIXify or macify it :

#/bin/sh                                                                                                                        
echo batchfile that calls CREATE_DB.sql
export PGPORT=5432                                                                                                             
export PGHOST=localhost                                                                                                        
export PGUSER=postgres                                                                                                         
export CITYDB=3dcitydb                                                                                                         
export PGBIN=/usr/local/pgsql/bin                                                                                              
echo  creating the 3D City Database
$PGBIN/psql -d $CITYDB -f CREATE_DB.sql -h $PGHOST -p $PGPORT

however i had no success as I am not hardcore with scripting, 


batchfile that calls CREATE_DB.sql
/psql: No such file or directory/pgsql/bin

however I ran the script by manually like this

$ /usr/local/pgsql/bin/psql -d 3dcitydb -f CREATE_DB.sql -h localhost -p 5432 -U postgres


after which i was prompted for the following

Please enter a valid SRID (e.g., 3068 for DHDN/Soldner Berlin):                28992
Please enter the corresponding SRSName to be used in GML exports (e.g., urn:ogc:def:crs,crs:EPSG::3068,crs:EPSG::5783):                          urn:ogc:def:crs:28992

28992                                    for the Dutch EPSG or SRS number
urn:ogc:def:crs:28992,       well, I just came with that to see what happens

and after endless SQL functions executed, the following errors appeared


CREATE FUNCTION
psql:PL_pgSQL/GEODB_PKG/MATCHING/MERGE.sql:215: ERROR:  invalid byte sequence for encoding "UTF8": 0xe46e64
psql:PL_pgSQL/GEODB_PKG/MATCHING/MERGE.sql:301: ERROR:  invalid byte sequence for encoding "UTF8": 0xe46e64
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
psql:PL_pgSQL/GEODB_PKG/MATCHING/MERGE.sql:646: ERROR:  invalid byte sequence for encoding "UTF8": 0xe46e64
CREATE FUNCTION
CREATE FUNCTION


I checked my database and is UTF8 encoded so, I checked the sql, and such lines correspond to  extra spaces after the $$ symbol, so maybe as UNIX scripting dislikes spaces i remove them, but no success as that is no unix script.

After some tests with different editors, I tried opening my MERGE.sql with JEdit and after reloading as UTF8 showed a UTF8 ERROR somewhere in line 258 , 159 and 593

    -- building furniture (in rooms) --bei lod r in f ge�ndert

so i removed the offending character and now it ran flawlessly

Future experiences will  follow.

SE ya!





No comments: