<div dir="ltr">Correcção:<div><br></div><div><p>ALTER TABLE<span style="font-family:arial,sans-serif;font-size:12.727272033691406px"> geoffreo</span></p><p><span style="font-family:arial,sans-serif;font-size:12.727272033691406px"> ALTER COLUMN "thegeom_ffreo" type </span><span style="font-family:arial,sans-serif;font-size:12.727272033691406px">geometry(MultiPolygon, 27493)</span></p>
<p><span style="font-size:12.727272033691406px;font-family:arial,sans-serif"> USING St_Multi(</span><span style="font-size:12.727272033691406px;font-family:arial,sans-serif">thegeom_ffreo</span><span style="font-size:12.727272033691406px;font-family:arial,sans-serif">);</span></p>
<div class="gmail_extra"><br><br><div class="gmail_quote">2014-06-23 18:41 GMT+01:00 Alexandre Neto <span dir="ltr"><<a href="mailto:senhor.neto@gmail.com" target="_blank">senhor.neto@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><p>Boa tarde Pedro,</p><p>Por esta, também já passei :-)</p><p dir="ltr">Tens de usar o st_multi() no parâmetro USING para converter as tuas geometrias em multi-geometrias. Acho que também deves explicitar o SRID dentro do geometry type</p>
<p>ALTER TABLE<span style="font-family:arial,sans-serif;font-size:12.727272033691406px"> geoffreo</span></p><p><span style="font-family:arial,sans-serif;font-size:12.727272033691406px"> ALTER COLUMN "thegeom_ffreo" type </span><span style="font-family:arial,sans-serif;font-size:12.727272033691406px">geometry(MultiPolygon, 27493)</span></p>
<p><span style="font-size:12.727272033691406px;font-family:arial,sans-serif"> USING(St_Multi(</span><span style="font-size:12.727272033691406px;font-family:arial,sans-serif">thegeom_ffreo</span><span style="font-size:12.727272033691406px;font-family:arial,sans-serif">));</span></p>
<p><span style="font-size:12.727272033691406px;font-family:arial,sans-serif"><br></span></p><p><span style="font-family:arial,sans-serif;font-size:12.727272033691406px">Cumprimentos,</span><br></p><p><span style="font-family:arial,sans-serif;font-size:12.727272033691406px">Alexandre Neto</span><br>
</p></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-06-23 18:10 GMT+01:00 Fred Lehodey <span dir="ltr"><<a href="mailto:lehodey@gmail.com" target="_blank">lehodey@gmail.com</a>></span>:<div><div class="h5">
<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Mais rápido:</span><div style="font-family:arial,sans-serif;font-size:13px">- fazer o alter para type geometry</div><div style="font-family:arial,sans-serif;font-size:13px">
- fazer o update com st_multi</div><div style="font-family:arial,sans-serif;font-size:13px">- fazer novo alter para geometry(multipolygon)</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
Fred</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-06-23 17:56 GMT+01:00 Fred Lehodey <span dir="ltr"><<a href="mailto:lehodey@gmail.com" target="_blank">lehodey@gmail.com</a>></span>:<div>
<div><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Olá,<div>- pode adicionar uma coluna geom_temp de type multipolygon</div>
<div>- update <span style="font-family:arial,sans-serif;font-size:13px">geoffreo</span><span style="font-family:arial,sans-serif;font-size:13px"> set geom_temp= st_multi(</span> <span style="font-size:13px;font-family:arial,sans-serif">thegeom_ffr)</span></div>
<div><span style="font-size:13px;font-family:arial,sans-serif">- drop </span><span style="font-family:arial,sans-serif;font-size:13px">thegeom_ffr</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">- rename geom_temp to </span><span style="font-family:arial,sans-serif;font-size:13px">thegeom_ffr</span></div>
<div><br></div><div><span style="font-family:arial,sans-serif;font-size:13px">Abr.</span></div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 23, 2014 at 5:44 PM, Pedro <span dir="ltr"><<a href="mailto:pedro.ferro@gmail.com" target="_blank">pedro.ferro@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Viva,<br>
<br>
Tenho uma coluna que está como poligono e preciso de alterá-la para<br>
multipoligono.<br>
Pensava que seria assim:<br>
/alter table geoffreo alter column "thegeom_ffreo" type<br>
geometry(MultiPolygon);/<br>
<br>
mas dá-me o erro:<br>
/ERROR: Geometry type (Polygon) does not match column type (MultiPolygon)/<br>
<br>
sabem como devo fazê-lo?<br>
<br>
obrigado,<br>
Pedro<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/Postgis-alterar-coluna-de-polygon-para-multipolygon-tp5147362.html" target="_blank">http://osgeo-org.1560.x6.nabble.com/Postgis-alterar-coluna-de-polygon-para-multipolygon-tp5147362.html</a><br>
Sent from the QGIS-pt mailing list archive at Nabble.com.<br>
_______________________________________________<br>
QGIS-pt mailing list<br>
<a href="mailto:QGIS-pt@lists.osgeo.org" target="_blank">QGIS-pt@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/qgis-pt" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/qgis-pt</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div></div></div><br></div>
<br>_______________________________________________<br>
QGIS-pt mailing list<br>
<a href="mailto:QGIS-pt@lists.osgeo.org" target="_blank">QGIS-pt@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/qgis-pt" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/qgis-pt</a><br>
<br></blockquote></div></div></div><br></div>
</blockquote></div><br></div></div></div>