I just ran this:<div><div><b>SELECT ST_AsEWKT(the_geom)</b></div><div><b>FROM gis."gz_2010_48_160_00_500k"</b></div><div><b>LIMIT 1;</b></div><div><br></div><div>Here's what I get:</div><div><b>"POLYGON((-94.940569 29.330815,-94.93334 29.329038,-94.930971 29.327708,-94.929679 29.32634,-94.938834 29.320412,-94.946644 29.323065,-94.946988 29.326066,-94.94085 29.330469,-94.940569 29.330815))"</b><br>

<br>So it appears that SRID is in fact not embedded?</div><div><br></div><div>This PostGIS dataset was imported from a SHP using Quantum GIS's SPIT. SPIT did not set a value for <b>the_geom</b> in <b>public.geometry_columns</b>--I believe it can, but I didn't specify any options to do that.</div>

<div><br></div><div>I added a row for the <b>the_geom</b> field using the code recommended in the PostGIS online instructions:</div><div><div><b>INSERT INTO geometry_columns(f_table_catalog, f_table_schema, f_table_name, f_geometry_column, coord_dimension, srid, "type")</b></div>

<div><b>SELECT '', 'gis', 'gz_2010_48_160_00_500k', 'the_geom', ST_CoordDim(the_geom), ST_SRID(the_geom), GeometryType(the_geom)</b></div><div><b>FROM gis.gz_2010_48_160_00_500k LIMIT 1;</b></div>

</div><div><br></div><div>And when I do that, the SRID in the table is <b>-1</b>, so yes, I have to manually change to <b>4326</b>.</div><div><br></div><div>So maybe ST_Transform doesn't reference the <b>public.geometry_columns</b> table after all? Seems like it ought to if the SRID isn't contained in the geometry object.</div>

<div><br></div><div>By the way, the original SHP is <b>EPSG:4269 - NAD83</b> per Quantum GIS. (Oops, I was using 4326 previously, but not sure that explains the errors.)</div><div><br></div><div>Aren<br><br><div class="gmail_quote">

On Sun, Feb 19, 2012 at 8:54 AM, Stephen Woodbridge <span dir="ltr"><<a href="mailto:woodbri@swoodbridge.com">woodbri@swoodbridge.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

SRID=-1 means that the geometry SRID is unknown or has no SRID. This is NOT synonym got 4326.<br>
<br>
Also, every geometry has an SRID embedded in it. If all you did is change the value in the public.geometry_columns table then you have NOT changed the geometry's SRID and the SRID of the geometry is the only thing that is looked at by the ST_* functions.<br>


<br>
-Steve<br>
<br>
<br>
On 2/19/2012 3:10 AM, <a href="mailto:pcreso@pcreso.com" target="_blank">pcreso@pcreso.com</a> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Does this work?<br>
<br>
*UPDATE gis."gz_2010_48_160_00_500k"*<br>
*SET "the_geom_3081" = ST_Transform((ST_Setsrid(the_<u></u>geom, 4326),3081);*<div class="im"><br>
<br>
ie:: is the problem finding the srid from geometry_columns or finding it<br>
but ST_Transform() fails even when given the srid?<br>
<br>
Even if there is a bug, this may work for you until fixed?<br>
<br>
Brent Wood<br>
<br></div><div class="im">
--- On *Sun, 2/19/12, René Romero Benavides /<<a href="mailto:ichbinrene@gmail.com" target="_blank">ichbinrene@gmail.com</a>>/* wrote:<br>
<br>
<br>
    From: René Romero Benavides <<a href="mailto:ichbinrene@gmail.com" target="_blank">ichbinrene@gmail.com</a>><br>
    Subject: Re: [postgis-users] Bogus unknown geometry error from<br>
    ST_Transform<br>
    To: <a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.<u></u>refractions.net</a><br>
    Date: Sunday, February 19, 2012, 8:37 PM<br>
<br>
    El 18/02/2012 11:29 p.m., Aren Cambre escribió:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
    ST_Transform is returning a bogus error of*Input geometry has<br>
    unknown (-1) SRID*.<br>
<br>
    Here's the query:<br>
    *UPDATE gis."gz_2010_48_160_00_500k"*<br>
    *SET "the_geom_3081" = ST_Transform(the_geom, 3081);*<br>
<br>
    I said "bogus" because the database's *public.geometry_columns*<div class="im"><br>
    table has valid values for these two columns, and neither has SRID<br>
    of -1:<br></div>
    *34281;"''";"gis";"gz_2010_48_<u></u>160_00_500k";"the_geom";2;<u></u>4326;"POLYGON"*<br>
    *34276;"''";"gis";"gz_2010_48_<u></u>160_00_500k";"the_geom_3081";<u></u>2;3081;"POLYGON"*<div class="im"><br>
<br>
    What gives?<br>
<br>
    Aren<br>
<br>
<br>
    ______________________________<u></u>_________________<br>
    postgis-users mailing list<br></div>
    <a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.<u></u>refractions.net</a>  </mc/compose?to=<a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@<u></u>postgis.refractions.net</a>><br>


    <a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.<u></u>net/mailman/listinfo/postgis-<u></u>users</a><br>
</blockquote><div class="im">
    I thought a SRID of -1 was a synonym for the default one (4326). But<br>
    don't take my word for it, I'm beginning with postgis.<br>
    --<br>
    <a href="http://sharingtechknowledge.blogspot.com/" target="_blank">http://sharingtechknowledge.<u></u>blogspot.com/</a><br>
<br>
    -----Inline Attachment Follows-----<br>
<br>
    ______________________________<u></u>_________________<br>
    postgis-users mailing list<br>
    <a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.<u></u>refractions.net</a><br></div>
    </mc/compose?to=<a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@<u></u>postgis.refractions.net</a>><br>
    <a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.<u></u>net/mailman/listinfo/postgis-<u></u>users</a><div class="im"><br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.<u></u>refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.<u></u>net/mailman/listinfo/postgis-<u></u>users</a><br>
</div></blockquote><div class="HOEnZb"><div class="h5">
<br>
______________________________<u></u>_________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.<u></u>refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.<u></u>net/mailman/listinfo/postgis-<u></u>users</a><br>
</div></div></blockquote></div><br></div></div>