[Gdal-dev] FW: ogr: create? new geometries
Nico Hardebol
harj at geo.vu.nl
Tue Jul 8 08:48:05 EDT 2003
Hello,
It's my first time to this list, I'm a geology/geophysics student and
getting experience in GIS and programming c++.
I want to transform/displace geometries with which I don't mean reproject
data into a different coordinate system, but to apply plate tectonic
rotations to geometries that represent tectonic plates.
I've written - as starting point - a small script with the use of the
Shapelib library by which an individual polygon is rotated and want to
extend this into a routine by which a bunch of geometries are rotated along
several rotation poles with the use of queries on their attributes
ultimately with postgis functionality).
I must admit I'm yet not an experienced programmer, but I'm investing lately
with the use of several GIS related api's.
I considered the ogr simple feature library to be a more convenient solution
since different object types can be more proper managed.
But is it possible to fetch the coordinates of the several geometry types
(not only points - C++ class Point::GetX() but also for Polygon and
Polyline.
And can new geometries be built?
something like:
transform (Ingeom, OUTgeom)
{ ......
Xin=Ingeom->GetX();
Yin=Ingeom->GetY();
Xout=transform(Xin);
Yout=transform(Yin);
OUTgeom(Xout, Yout, ......); whatever...
}
Within the shapelib this could be easily done with the use of:
SHPReadObject(), SHPCreateObject() and SHPCreate()....
but within ogr I can only find OGRGeometryFactory in which new geometries
objects can be created from well known bin/txt. But no double arrays of X
and Y coord. can be offered from which a new geometry is built - true?
Possibly I'm missing something important, I can imagine that this type of
functionaly is not included since may major problems with spatial
relationships / topology arises.
Do I have to build a new geometry with the use of creatFromWKB/WKT() - but
then I can't find a c++ api with some basic functions to build (opengis
OLE/COM specifications?).
OR do you advice me to keep it simple and continue with shapelib - without
the great advantages of ogr (e.a. reading several file formats / postgis
PostgreSQL functionality).
thanking in advance,
Nico
More information about the Gdal-dev
mailing list