<div dir="ltr"><div><div><br><br><br></div>You can try to analyze a bit to understand better<br></div>(for the following I consider your table doesn't contains too much data)<br><div><br>with the_data AS (<br><div style="margin-left:40px">
SELECT the_geom, ST_ISValid(the_geom) AS is_valid, ST_IsValidReason(the_geom)<br>FROM ft_potencial<br></div>)<br></div><div>SELECT *, ST_AsText(ST_MakeValid(the_geom)) AS corrected_geom, ST_AsText(the_geom) AS original_geometry, detail.*<br>
</div><div>FROM the_data, <code class=""><b class="">ST_IsValidDetail</b>(</code><var>the_geom</var><var class=""></var><code>) AS detail</code><br>WHERE is_valid = false<br></div><div>AND GeometryType(the_geom) ILIKE '%POLYGON%'<br>
</div><div><br></div><div> My guess : you have an invalid no-area polygon, so the makevalid function transform it into a line<br><br></div><div>Cheers,<br>Rémi-C<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
2014-05-16 18:14 GMT+02:00  <span dir="ltr"><<a href="mailto:islanis@infomed.sld.cu" target="_blank">islanis@infomed.sld.cu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
"Ivan Santiago" <<a href="mailto:isantiago@ogp.pr.gov" target="_blank">isantiago@ogp.pr.gov</a>> escribió:<div class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello:<br>
<br>
Run<br>
SELECT PostGIS_full_version();<br>
TO know if your installation has GEOS 3.3.0 or above.<br>
</blockquote></div>
I get this<br>
<br>
<br>
"POSTGIS="2.0.0 r9605" GEOS="3.3.3-CAPI-1.7.4" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.9.0, released 2011/12/29" LIBXML="2.7.8" LIBJSON="UNKNOWN" TOPOLOGY RASTER"<div class="HOEnZb">
<div class="h5"><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
---------------------------<br>
Iván Santiago<br>
GIS Specialist<br>
Information Technologies<br>
Office of Management and Budget<br>
787.725.9420 x 2378<br>
Calle Cruz 254<br>
PO Box 9023228<br>
San Juan, PR 00902-3228<br>
<a href="http://gis.pr.gov" target="_blank">http://gis.pr.gov</a><br>
<br>
<br>
-----Original Message-----<br>
From: <a href="mailto:postgis-users-bounces@lists.osgeo.org" target="_blank">postgis-users-bounces@lists.<u></u>osgeo.org</a> [mailto:<a href="mailto:postgis-users-bounces@lists.osgeo.org" target="_blank">postgis-users-bounces@<u></u>lists.osgeo.org</a>] On Behalf Of <a href="mailto:islanis@infomed.sld.cu" target="_blank">islanis@infomed.sld.cu</a><br>

Sent: Friday, May 16, 2014 11:24 AM<br>
To: <a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
Subject: [postgis-users] problem with st_makevalid and (LineString)<br>
<br>
Hello people, i got a problem where i have no idea what can i do.<br>
<br>
I have this table<br>
<br>
CREATE TABLE ft_potencial<br>
(<br>
   id_dw_ft_potencial integer NOT NULL,<br>
   id_dw_tipo integer NOT NULL,<br>
   id_dw_mes integer NOT NULL,<br>
   id_dw_municipio integer NOT NULL,<br>
   id_dw_date integer NOT NULL,<br>
   potencial real NOT NULL,<br>
   area real NOT NULL,<br>
   the_geom geometry(Polygon,4326),<br>
   CONSTRAINT ft_potencial_pkey PRIMARY KEY (id_dw_ft_potencial, id_dw_tipo, id_dw_mes, id_dw_municipio, id_dw_date)<br>
)<br>
WITH (<br>
   OIDS=FALSE<br>
);<br>
<br>
and i want to clean  the errors that it has using the function ST_MakeValid in this way<br>
<br>
update ft_potencial set the_geom=ST_MakeValid(the_<u></u>geom);<br>
<br>
but it always return this error<br>
<br>
ERROR:  Geometry type (LineString) does not match column type (Polygon)<br>
<br>
********** Error **********<br>
<br>
ERROR: Geometry type (LineString) does not match column type (Polygon) Estado SQL:22023<br>
<br>
<br>
what can i do to fix or clean the geometry without problems.<br>
<br>
please help.<br>
thanks<br>
<br>
------------------------------<u></u>------------------------------<u></u>----<br>
This message was sent using IMP, the Internet Messaging Program.<br>
<br>
<br>
--<br>
<br>
Este mensaje le ha llegado mediante el servicio de correo electronico que ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema Nacional de Salud. La persona que envia este correo asume el compromiso de usar el servicio a tales fines y cumplir con las regulaciones establecidas<br>

<br>
Infomed: <a href="http://www.sld.cu/" target="_blank">http://www.sld.cu/</a><br>
<br>
______________________________<u></u>_________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-<u></u>bin/mailman/listinfo/postgis-<u></u>users</a><br>
______________________________<u></u>_________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-<u></u>bin/mailman/listinfo/postgis-<u></u>users</a><br>
<br>
</blockquote>
<br>
<br>
<br>
------------------------------<u></u>------------------------------<u></u>----<br>
This message was sent using IMP, the Internet Messaging Program.<br>
<br>
<br>
<br>
--<br>
<br>
Este mensaje le ha llegado mediante el servicio de correo electronico que ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema Nacional de Salud. La persona que envia este correo asume el compromiso de usar el servicio a tales fines y cumplir con las regulaciones establecidas<br>

<br>
Infomed: <a href="http://www.sld.cu/" target="_blank">http://www.sld.cu/</a><br>
<br>
______________________________<u></u>_________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-<u></u>bin/mailman/listinfo/postgis-<u></u>users</a></div></div></blockquote></div><br></div>