[postgis] OGR and PostGIS

Frank Warmerdam warmerdam at pobox.com
Tue Jun 19 12:04:03 PDT 2001


Folks, 

I have a C++ library called 'OGR Simple Features' which provides a
moderately abstracted way of interacting with a variety of GIS vector
formats, including DGN, MapInfo binary, MapInfo .mid/.mif, Shapefiles, 
Tiger, NTF, S-57, SDTS and some others. 

I am now working on integrating OGR with PostGIS.  I have successfully
built and installed PostGIS 0.1 on PostgreSQL 7.1.2 on Linux (Debian). 

I have run the provided tests, and got a few variations.  Are these of
any concern?   Note that the "make test" script doesn't seem to preclean
the output files, so I wasted a few minutes with that. 

diff.log:
376,378c376,378
<        geom        
< -------------------
<  POINT(Infinity 0)
---
>      geom     
> --------------
>  POINT(inf 0)
382,384c382,384
<         geom        
< --------------------
<  POINT(-Infinity 0)
---
>      geom      
> ---------------
>  POINT(-inf 0)
672c672
<    884
---
>    880
740c740
< INSERT 18857599 1
---
> INSERT 20649 1
793c793
<     72080 |    72080
---
>     72076 |    72076

Also, I tried the example inserts from the README.postgis, and had some
problems with the first polygon geometry:

This insert:

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');

Resulted in this from a select *:

   1 | POLYGON((0 0 0,0 5.31146529464635e-315 0,5.31146529464635e-315 5.31146529464635e-315 0,5.31146529464635e-315 0 0,0 0 0)) | 3D Square

Note that the other two geometries worked just fine. 

Finally, I have integrated the ability into OGR to read PostGIS tables.
They are identied as any table with a field that has the type "Geometry".
This is now working fine for read access, and I will start work on creating
new geometric tables from OGR. 

What is the best way for my OGR library to determine if a PostgeSQL
instance has the PostGIS extensions loaded?  Should I access the types
table, and look for a Geometry type?

Anyone interested in looking at OGR can find it at:

  http://gdal.velocet.ca/projects/opengis/

Best regards,
 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

To unsubscribe from this group, send an email to:
postgis-unsubscribe at yahoogroups.com

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 





More information about the postgis-users mailing list