[postgis-users] mulitpolygon with type set to geometry(Geometry, 4326)

James David Smith james.david.smith at gmail.com
Fri May 9 01:21:28 PDT 2014


For info, I think you could also have wrapped like this:

St_setsrid(*st_centroid**(**report_geom**), 4326) as **pt_**geom*

On 8 May 2014 23:37, "Jason Mathis" <jmathis at redzonesoftware.com> wrote:
>
> ah yes that works. Turns out you have to drop and create the view if I
tried a replace i get the below message.
>
>     ERROR:  cannot change data type of view column "pt_geom" from
geometry to geometry(Point,4326)
>
>
> But a new view shows up correctly.
>
>
> Thanks!
>
>
> On May 8, 2014 at 3:50:24 PM, Alexandre Neto (senhor.neto at gmail.com)
wrote:
>>
>> Hello Jason,
>>
>> All you need to cast a geometry as other more restrict geometry type is:
>>
>> st_centroid(report_geom)::geometry(POINT,4326)
>>
>> Hope this helps
>>
>>
>>
>> Alexandre Neto
>>
>>
>> On Thu, May 8, 2014 at 9:49 PM, Jason Mathis <jmathis at redzonesoftware.com>
wrote:
>>>
>>> Hello,
>>>
>>> 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.
>>>
>>> I have a table that stores polygons and multi polygons with a column:
>>>
>>>     report_geom geometry(Geometry,4326)
>>>
>>> I have a view that uses that column like:
>>>
>>>     st_centroid(report_geom) as pt_geom
>>>
>>> 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?
>>>
>>> Thanks all!
>>>
>>> -jason
>>>
>>>
>>>
>>> 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.
>>>
>>>
>>> _______________________________________________
>>> postgis-users mailing list
>>> postgis-users at lists.osgeo.org
>>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>>
>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at lists.osgeo.org
>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
>
> 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.
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20140509/764f636e/attachment.html>


More information about the postgis-users mailing list