[prev in list] [next in list] [prev in thread] [next in thread] 

List:       qgis-user
Subject:    Re: [Qgis-user] PostGIS Query - DB Manager Not Recognizing Geom Column
From:       Michael Treglia <mtreglia () gmail ! com>
Date:       2017-03-28 12:59:32
Message-ID: CAPKp32t94wpxWtdOExeKnKbRi11x0jbzoanEDy6+Yiry_n-vXA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Ah, this makes perfect sense - I figured that I needed to define the
geometry type, just wasn't quite figuring out how. Nice and simple solution!
Thanks so much,
Mike

On Tue, Mar 28, 2017 at 1:40 AM, Bernhard Ströbl <bernhard.stroebl@jena.de>
wrote:

> Hi,
> you need to explicitly state the geometry type and SRS in you view
> definition like this:
> CREATE OR REPLACE VIEW test.testbuff as
> SELECT gid, area_id,
> st_buffer(testshape.geom, 100)::geometry(Polygon,your_srs_code)
> as geom2 FROM test.testshape where testshape.area_id=100;
>
> could be Polygon or Multipolygon depending on the input, your_srs_code
> should be the same as testshape's
>
> QGIS can analyze geometry columns and detect the type (and probably SRS),
> however only relations with geometry fields defined in this way are listed
> in geometry_columns.
>
> Bernhard
>
>
> Am 27.03.2017 um 23:42 schrieb Michael Treglia:
>
>> Hi All,
>>
>> I'm running a PostGIS query to create a view, buffering a polygon -
>> viewing the result in DB Manager, the associated icon, rather than being
>> polygons, is a question mark, and in the info tab for the layer, I see
>> the warning ' There is no entry in geometry_columns!'
>>
>> That said, the layer actually displays fine in QGIS, and in the list of
>> fields, the appropriate column is labeled as Type 'geometry'.
>>
>> Thus, is this really a problem? And if so, any easy fixes? A sample
>> query is below:
>>
>> CREATE OR REPLACE VIEW test.testbuff as
>> SELECT gid, area_id, st_buffer(testshape.geom, 100)
>> as geom2 FROM test.testshape where testshape.area_id=100;
>>
>>
>> Thanks for any suggestions!
>> Mike
>>
>>
>> _______________________________________________
>> Qgis-user mailing list
>> Qgis-user@lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>>
>
>
> __________ Information from ESET Mail Security, version of virus signature
> database 15160 (20170328) __________
>
> The message was checked by ESET Mail Security.
> http://www.eset.com
>
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

[Attachment #5 (text/html)]

<div dir="ltr">Ah, this makes perfect sense - I figured that I needed to define the \
geometry type, just wasn&#39;t quite figuring out how. Nice and simple \
solution!<div>Thanks so much,</div><div>Mike</div></div><div \
class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 28, 2017 at 1:40 AM, \
Bernhard Ströbl <span dir="ltr">&lt;<a href="mailto:bernhard.stroebl@jena.de" \
target="_blank">bernhard.stroebl@jena.de</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">Hi,<br> you need to explicitly state the geometry type and \
SRS in you view definition like this:<span class=""><br> CREATE OR REPLACE VIEW \
test.testbuff as<br> SELECT gid, area_id,<br></span>
st_buffer(testshape.geom, 100)::geometry(Polygon,your_sr<wbr>s_code)<span \
class=""><br> as geom2 FROM test.testshape where testshape.area_id=100;<br>
<br></span>
could be Polygon or Multipolygon depending on the input, your_srs_code should be the \
same as testshape&#39;s<br> <br>
QGIS can analyze geometry columns and detect the type (and probably SRS), however \
only relations with geometry fields defined in this way are listed in \
geometry_columns.<br> <br>
Bernhard<div><div class="h5"><br>
<br>
Am 27.03.2017 um 23:42 schrieb Michael Treglia:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex"><div><div class="h5"> Hi All,<br>
<br>
I&#39;m running a PostGIS query to create a view, buffering a polygon -<br>
viewing the result in DB Manager, the associated icon, rather than being<br>
polygons, is a question mark, and in the info tab for the layer, I see<br>
the warning &#39; There is no entry in geometry_columns!&#39;<br>
<br>
That said, the layer actually displays fine in QGIS, and in the list of<br>
fields, the appropriate column is labeled as Type &#39;geometry&#39;.<br>
<br>
Thus, is this really a problem? And if so, any easy fixes? A sample<br>
query is below:<br>
<br>
CREATE OR REPLACE VIEW test.testbuff as<br>
SELECT gid, area_id, st_buffer(testshape.geom, 100)<br>
as geom2 FROM test.testshape where testshape.area_id=100;<br>
<br>
<br>
Thanks for any suggestions!<br>
Mike<br>
<br>
<br></div></div>
______________________________<wbr>_________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" \
target="_blank">Qgis-user@lists.osgeo.org</a><br> List info: <a \
href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" \
                target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/qgis-user</a><br>
                
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" \
rel="noreferrer" target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/qgis-user</a><br>
 <br>
</blockquote>
<br>
<br>
<br>
__________ Information from ESET Mail Security, version of virus signature database \
15160 (20170328) __________<br> <br>
The message was checked by ESET Mail Security.<br>
<a href="http://www.eset.com" rel="noreferrer" \
target="_blank">http://www.eset.com</a><br> <br>
<br>
______________________________<wbr>_________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" \
target="_blank">Qgis-user@lists.osgeo.org</a><br> List info: <a \
href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" \
                target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/qgis-user</a><br>
                
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" \
rel="noreferrer" target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/qgis-user</a></blockquote></div><br></div>



[Attachment #6 (text/plain)]

_______________________________________________
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic