Mike,<div>Thanks!<br><br><div class="gmail_quote">On Wed, Oct 27, 2010 at 1:17 AM, Mike Toews <span dir="ltr"><<a href="mailto:mwtoews@gmail.com">mwtoews@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Ah, you are looking for this:<br>
<br>
<a href="http://postgis.refractions.net/docs/ST_Transform.html" target="_blank">http://postgis.refractions.net/docs/ST_Transform.html</a><br>
<br>
So you need to cast your object as a polygon, set the SRID to your<br>
projected coordinate system (I'm just guessing SRID=29181 for your<br>
example <a href="http://spatialreference.org/ref/epsg/29181/" target="_blank">http://spatialreference.org/ref/epsg/29181/</a> .. look up the<br>
SRID for your original data). Then it can be transformed into long/lat<br>
coords:<br>
<br>
SELECT ST_Transform(ST_SetSRID('BOX(743295.3125 7182512.5,744414.75<br>
7183817.5)'::box2d::geometry, 29181), 4326);<br>
<font color="#888888"><br>
-Mike<br>
</font><div><div></div><div class="h5"><br>
On 26 October 2010 20:01, Wagner Santos <<a href="mailto:wagner.desenv@gmail.com">wagner.desenv@gmail.com</a>> wrote:<br>
> Mike,<br>
> Yes, I mean georeferenced (sorry for my English). I made a cast to text and<br>
> converted to postgis geometry, but I couldn't use ST_SetSRID.<br>
> I would like to tranfer a polygon to correct position. I have a<br>
> Polygon "BOX(743295.3125 7182512.5,744414.75 7183817.5)" and I like to<br>
> transfer it to "BOX(-54.515022277832 -25.4530487060547,-54.5029907226562<br>
> -25.4447135925293)".<br>
> I tried ST_Affine but I don't know the correct parameters, I tried ST_Scale<br>
> but I had the same problem. My idea was transform and set srid.<br>
><br>
> On Tue, Oct 26, 2010 at 11:44 PM, Mike Toews <<a href="mailto:mwtoews@gmail.com">mwtoews@gmail.com</a>> wrote:<br>
>><br>
>> Hi Wagner,<br>
>><br>
>> I'm not sure what you mean by "geo" and "non-geo" .. you mean<br>
>> georeferenced, like longitude/latitude?<br>
>><br>
>> For points, you can keep thing binary and just use ST_MakePoint(x,y).<br>
>> And to assign a coordinate system, use it with ST_SetSRID:<br>
>><br>
>> SELECT ST_SetSRID(ST_MakePoint(p[0], p[1]), 4326)<br>
>> from (<br>
>>  select point '(-123.112793, 49.246293)' as p<br>
>> ) as foo;<br>
>><br>
>> I'm not sure how to do similar binary conversions for path and<br>
>> polygon, or other types. You might have to cast to text, and wrangle<br>
>> it into some form of WKT, then pass it to ST_SetSRID(text, integer) to<br>
>> make a geometry object for PostGIS.<br>
>><br>
>> -Mike<br>
>><br>
>><br>
>> On 26 October 2010 18:17, Wagner Santos <<a href="mailto:wagner.desenv@gmail.com">wagner.desenv@gmail.com</a>> wrote:<br>
>> > I created a Postgis Geometry from Postgres Polygon converting them  from<br>
>> > string and using linefromtext to create a geometry but this information<br>
>> > isn't geo.<br>
>> > I have non geo points and I want to convert to my correct position and<br>
>> > set<br>
>> > SRID, for example P(70 72) to P(-54 -25), how can I do this?<br>
>> > Thanks!<br>
>> ><br>
>> > On Tue, Oct 26, 2010 at 1:18 PM, Wagner Santos <<a href="mailto:wagner.desenv@gmail.com">wagner.desenv@gmail.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> Hello,<br>
>> >> I'm new with postgis and I have a legacy database with Postgres<br>
>> >> Polygon, I<br>
>> >> want to convert this to a Postgis Geometry. Is there a way?<br>
>> >> I try to do with replace string and linefromtext with sucess, but I<br>
>> >> think<br>
>> >> doesn't better solution because I can't set a valid SRID.<br>
>> >> Thanks!<br>
>> ><br>
>> > _______________________________________________<br>
>> > postgis-users mailing list<br>
>> > <a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
>> > <a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
>> ><br>
>> ><br>
>> _______________________________________________<br>
>> postgis-users mailing list<br>
>> <a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
>> <a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
><br>
><br>
> _______________________________________________<br>
> postgis-users mailing list<br>
> <a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
> <a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
><br>
><br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</div></div></blockquote></div><br></div>