<blockquote><blockquote><p dir="ltr">For info, I think you could also have wrapped like this:</p>
<p dir="ltr">St_setsrid(<b>st_centroid</b><b>(</b><b>report_geom</b><b>), 4326) as </b><b>pt_</b><b>geom</b><br><br></p>
<p dir="ltr">On 8 May 2014 23:37, "Jason Mathis" <<a href="mailto:jmathis@redzonesoftware.com">jmathis@redzonesoftware.com</a>> wrote:<br>
><br>
> ah yes that works. Turns out you have to drop and create the view if I tried a replace i get the below message. <br>
><br>
>     ERROR:  cannot change data type of view column "pt_geom" from geometry to geometry(Point,4326)<br>
><br>
><br>
> But a new view shows up correctly. <br>
><br>
><br>
> Thanks!<br>
><br>
><br>
> On May 8, 2014 at 3:50:24 PM, Alexandre Neto (<a href="mailto:senhor.neto@gmail.com">senhor.neto@gmail.com</a>) wrote:<br>
>><br>
>> Hello Jason,<br>
>><br>
>> All you need to cast a geometry as other more restrict geometry type is:<br>
>><br>
>> st_centroid(report_geom)::geometry(POINT,4326)<br>
>><br>
>> Hope this helps<br>
>><br>
>><br>
>><br>
>> Alexandre Neto<br>
>><br>
>><br>
>> On Thu, May 8, 2014 at 9:49 PM, Jason Mathis <<a href="mailto:jmathis@redzonesoftware.com">jmathis@redzonesoftware.com</a>> wrote:<br>
>>><br>
>>> Hello,<br>
>>><br>
>>> I am fairly new to postgis so it would be great if someone could point me in the right direction on how to fix this issue. Or if its even fixable. <br>
>>><br>
>>> I have a table that stores polygons and multi polygons with a column:<br>
>>><br>
>>>     report_geom geometry(Geometry,4326)<br>
>>><br>
>>> I have a view that uses that column like:<br>
>>><br>
>>>     st_centroid(report_geom) as pt_geom<br>
>>><br>
>>> The issue is when you use the st_centroid is removes the srid and leaves it a plain geometry. Which can make it a bit inconvenient for use in arc and qgis apps. Is there a way to cast it to be a point with 4326? <br>

>>><br>
>>> Thanks all!<br>
>>><br>
>>> -jason <br>
>>><br>
>>><br>
>>><br>
>>> This transmission contains confidential and privileged information intended solely for the party identified above. If you receive this message in error, you must not use it or convey it to others. Please destroy it immediately and contact the sender at (303) 386-3955 or by return e-mail to the sender.<br>

>>><br>
>>><br>
>>> _______________________________________________<br>
>>> postgis-users mailing list<br>
>>> <a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
>>> <a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
>><br>
>><br>
>> _______________________________________________ <br>
>> postgis-users mailing list <br>
>> <a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a> <br>
>> <a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
><br>
><br>
> This transmission contains confidential and privileged information intended solely for the party identified above. If you receive this message in error, you must not use it or convey it to others. Please destroy it immediately and contact the sender at (303) 386-3955 or by return e-mail to the sender.<br>

><br>
><br>
> _______________________________________________<br>
> postgis-users mailing list<br>
> <a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
</p>
</blockquote>
</blockquote>