[postgis-users] Writing to PostGIS with OGR

Frank Warmerdam warmerdam at pobox.com
Tue Feb 14 08:50:51 PST 2006


Philippe Wüger wrote:
> Hello
> 
> I'm trying to write to a PostGIS table with OGR, but it doesn't work. I 
> wrote a class in C++ which would iterate over all points (contained in 
> (Multi)LineString objects) in a table/layer and set a new z-Coordinate. 
> When I look at the points after running the program, the z-Coordinates 
> are still the old value.

Philippe,

I don' see an obvious error in what you have done, but there is quite
a bit going on.  You should verify that SetZ() is getting called as
expected, and that SetFeature() is being called as expected.

You might want to enable OGR debug output.   In your code you should
be able to do:

   CPLSetConfigOption( "CPL_DEBUG", "ON" );

in your initialization or just set CPL_DEBUG=ON in the environment
ahead of time.

If you can boil the problem down to something very simple.

eg.
   SQL to create a simple table with just one record in it.
   A minimal OGR C/C++ program that reads a feature, modifies it and
   sets it without effect.

then I could try and work out the problem at my end.

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




More information about the postgis-users mailing list