Discussion:
How to move polygons? (by new point or vector)
Maciej Skorczewski
2007-02-06 14:20:44 UTC
Permalink
Hi all!

is there any postgis function who can move polygon on some vector?


I store lot of polygons in database , user should move it in another
place. Is it posible to do?


for ex. i show new point of map and then i punt selected polygon in this
palce.

maciek
Uwe Seher
2007-02-06 14:41:18 UTC
Permalink
Hi group!

I am creating 3d- polylines from a lot of points, which are stored in a
table. These points represent the gps-paths of seismic measuring and have
an id that references the single profile. This work quite good. To create
the geometries i use the followimg statement:

linefrommultipoint(collect(geomfromewkt(((((('SRID = 31468; Point('::text
|| t3.x_coord::text) || ' '::text) || t3.y_coord::text) || ' '::text) ||
t3.z_coord::text) || ')'::text))) AS geom

Now the question: Some geometries aren't created, when there are more
then ~1300 points in one profile. Is there a upper boundary for points in
a line? Is there a workaround for that?

Thank you
Uwe Seher
_____________________________________
ingenieurbüro kauppert

nebeniusstr. 34
d-76137 karlsruhe

fon +49 721 3548969-3
fax +49 721 3548969-5

email ***@ib-kauppert.de
web www.ib-kauppert.de
_____________________________________
Mark Cave-Ayland
2007-02-06 15:43:02 UTC
Permalink
Post by Uwe Seher
Hi group!
I am creating 3d- polylines from a lot of points, which are stored in a
table. These points represent the gps-paths of seismic measuring and have
an id that references the single profile. This work quite good. To create
linefrommultipoint(collect(geomfromewkt(((((('SRID = 31468; Point('::text
|| t3.x_coord::text) || ' '::text) || t3.y_coord::text) || ' '::text) ||
t3.z_coord::text) || ')'::text))) AS geom
Now the question: Some geometries aren't created, when there are more
then ~1300 points in one profile. Is there a upper boundary for points in
a line? Is there a workaround for that?
Thank you
Uwe Seher
Hi Uwe,

If you think you have found a bug, please submit a .sql file contain a
set of SQL commands that we can run to reproduce the problem. Also,
which versions of PostgreSQL/PostGIS are you using?


Kind regards,

Mark.
Marc Compte
2007-02-06 14:50:02 UTC
Permalink
Hi maciek,

I am trying to guess a way to do so and I haven't really check it
myself, anyone correct me if I am wrong.

I believe you can use the translate function ( =>
Translate(geometry,float8,float8,float8)) to move a geometry. If I'm not
wrong X and Y are not the final coordinates but the distance the polygon
needs to move to get to your new coordinates.

In that case you could do something like:

1. User clics on the map. You should be able to get the coordinates of
that particular point (Xpoint, Ypoint).
2. Calculate the centroid of the polygon to be moved using PostGIS's
function => Centroid(geometry). This returns a point identifying the
center of your polygon (Xcentroid, Ycentroid).
3. Calculate the distance on each of the axis between point and centroid
DistanceX=Xpoint-Xcentroid
DistanceY=Ypoint-Ycentroid
4. Move the polygon to the new location using
Translate(geometry,DistanceX,DistanceY,0)

Hope this helps a bit,

Marc
Post by Maciej Skorczewski
Hi all!
is there any postgis function who can move polygon on some vector?
I store lot of polygons in database , user should move it in another
place. Is it posible to do?
for ex. i show new point of map and then i punt selected polygon in
this palce.
maciek
_______________________________________________
postgis-users mailing list
http://postgis.refractions.net/mailman/listinfo/postgis-users
Maciej Skorczewski
2007-02-07 08:51:01 UTC
Permalink
thx Marc

i will try this.


maciek.

Loading...