<div dir="ltr"><div><p style="margin:0px 0px 0px 0px;font:13.0px Arial"><span style="letter-spacing:0px"><font class="Apple-style-span" face="arial, helvetica, sans-serif">Hello everyone,</font></span></p>
<p style="margin:0px 0px 0px 0px;font:13.0px Arial;min-height:15.0px"><font class="Apple-style-span" face="arial, helvetica, sans-serif"><span style="letter-spacing:0px"></span><br></font></p>
<p style="margin:0px 0px 0px 0px;font:13.0px Arial"><span style="letter-spacing:0px"><font class="Apple-style-span" face="arial, helvetica, sans-serif">I have a question please and hope someone can help. I have a table with the following structure:</font></span></p>

<p style="margin:0px 0px 0px 0px;font:13.0px Arial;min-height:15.0px"><font class="Apple-style-span" face="arial, helvetica, sans-serif"><span style="letter-spacing:0px"></span><br></font></p>
<p style="margin:0px 0px 0px 0px;font:13.0px Courier"><span style="letter-spacing:0px"><font class="Apple-style-span" face="arial, helvetica, sans-serif" color="#3333ff"><b>CREATE TABLE table1 (</b></font></span></p>
<p style="margin:0px 0px 0px 0px;font:13.0px Courier"><span style="letter-spacing:0px"><font class="Apple-style-span" face="arial, helvetica, sans-serif" color="#3333ff"><b>    "id" integer DEFAULT nextval('id_seq'::regclass) NOT NULL,</b></font></span></p>

<p style="margin:0px 0px 0px 0px;font:13.0px Courier"><span style="letter-spacing:0px"><font class="Apple-style-span" face="arial, helvetica, sans-serif" color="#3333ff"><b>    name character varying,</b></font></span></p>

<p style="margin:0px 0px 0px 0px;font:13.0px Courier"><span style="letter-spacing:0px"><font class="Apple-style-span" face="arial, helvetica, sans-serif" color="#3333ff"><b>    geom geometry,</b></font></span></p>
<p style="margin:0px 0px 0px 0px;font:13.0px Courier"><span style="letter-spacing:0px"><font class="Apple-style-span" face="arial, helvetica, sans-serif" color="#3333ff"><b>    geom_kml text,</b></font></span></p>
<p style="margin:0px 0px 0px 0px;font:13.0px Courier"><span style="letter-spacing:0px"><font class="Apple-style-span" face="arial, helvetica, sans-serif" color="#3333ff"><b>    CONSTRAINT enforce_dims_geom CHECK ((st_ndims(geom) = 2)),</b></font></span></p>

<p style="margin:0px 0px 0px 0px;font:13.0px Courier"><span style="letter-spacing:0px"><font class="Apple-style-span" face="arial, helvetica, sans-serif" color="#3333ff"><b>    CONSTRAINT enforce_geotype_geom CHECK (((geometrytype(geom) = 'POLYGON'::text) OR (geom IS NULL))),</b></font></span></p>

<p style="margin:0px 0px 0px 0px;font:13.0px Courier"><span style="letter-spacing:0px"><font class="Apple-style-span" face="arial, helvetica, sans-serif"><font class="Apple-style-span" color="#3333ff" style="font-weight:bold">    CONSTRAINT </font><font class="Apple-style-span" color="#ff0000"><b>enforce_srid_geom</b></font><font class="Apple-style-span" color="#3333ff" style="font-weight:bold"> CHECK ((st_srid(geom) = (-1)))</font></font></span><span class="Apple-style-span" style="font-weight:bold;color:rgb(51,51,255);font-family:arial,helvetica,sans-serif;font-size:small">);</span></p>
<p style="margin:0px 0px 0px 0px;font:13.0px Courier"><span class="Apple-style-span" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></span></p>
<p style="margin:0px 0px 0px 0px;font:13.0px Courier"><span style="letter-spacing:0px"><font class="Apple-style-span" face="arial, helvetica, sans-serif">So the table has a geom column and a column to store the KML text besides name and id. I want the geom field to store a polygon from the KML column. So first I inserted id, name, and KML as text and geom as NULL. Than I ran the below update SQL statement:</font></span></p>

<p style="margin:0px 0px 0px 0px;font:13.0px Courier;min-height:16.0px"><font class="Apple-style-span" face="arial, helvetica, sans-serif"><span style="letter-spacing:0px"></span><br></font></p>
<p style="margin:0px 0px 0px 0px;font:13.0px Arial"><span style="letter-spacing:0px"><font class="Apple-style-span" face="arial, helvetica, sans-serif" color="#3333ff"><b>Update table1 set geom = st_geomfromkml('<Polygon><outerBoundaryIs><LinearRing><coordinates>39.788212,21.424540 ........ 39.788212,21.424540</coordinates></LinearRing></outerBoundaryIs></Polygon>');</b></font></span></p>

<p style="margin:0px 0px 0px 0px;font:13.0px Arial;min-height:15.0px"><font class="Apple-style-span" face="arial, helvetica, sans-serif"><span style="letter-spacing:0px"></span><br></font></p>
<p style="margin:0px 0px 0px 0px;font:13.0px Courier"><span style="letter-spacing:0px"><font class="Apple-style-span" face="arial, helvetica, sans-serif">But an error appears that this conflicts with <font class="Apple-style-span" color="#ff0000"><b>enforce_srid_geom</b></font> constraint. I removed it and I was able to update the geom column but it really does not make sense. The geom I am trying to insert does not conflict with the constraints. I created the kml polygon in Google Earth and the srid for that is -1. Please help :)</font></span></p>

<p style="margin:0px 0px 0px 0px;font:13.0px Arial;min-height:15.0px"><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font></p>
<p style="margin:0px 0px 0px 0px;font:13.0px Arial;min-height:15.0px"><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font></p>
<p style="margin:0px 0px 0px 0px;font:13.0px Garamond;color:#3264f5"><span style="letter-spacing:0px"><b><font class="Apple-style-span" face="arial, helvetica, sans-serif">---------------------------------------------------------------------------</font></b></span></p>

<p style="margin:0px 0px 0px 0px;font:13.0px Garamond;color:#3264f5"><span style="letter-spacing:0px"><b><font class="Apple-style-span" face="arial, helvetica, sans-serif">Ahmad Aburizaiza</font></b></span></p>
<p style="margin:0px 0px 0px 0px;font:13.0px Garamond;color:#3264f5"><span style="letter-spacing:0px"><b><font class="Apple-style-span" face="arial, helvetica, sans-serif">PhD student at George Mason University</font></b></span></p>

<p style="margin:0px 0px 0px 0px;font:13.0px Garamond;color:#3264f5"><span style="letter-spacing:0px"><b><font class="Apple-style-span" face="arial, helvetica, sans-serif">Geography and Geoinformation Science Department</font></b></span></p>

<p style="margin:0px 0px 0px 0px;font:13.0px Garamond;color:#3264f5"><span style="letter-spacing:0px"><b><font class="Apple-style-span" face="arial, helvetica, sans-serif">Fairfax, VA, USA</font></b></span></p>
<p style="margin:0px 0px 0px 0px;font:13.0px Garamond;color:#3264f5"><span style="letter-spacing:0px"><b><font class="Apple-style-span" face="arial, helvetica, sans-serif">Tel : +1-703-981-0354</font></b></span></p></div>
<div><span style="letter-spacing:0px"><b><br></b></span></div></div>