Re: [Qgis-user] PostGIS Query - DB Manager Not Recognizing Geom Column

2017-03-28 Thread Michael Treglia
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 
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
___
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

Re: [Qgis-user] PostGIS Query - DB Manager Not Recognizing Geom Column

2017-03-27 Thread Bernhard Ströbl

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

[Qgis-user] PostGIS Query - DB Manager Not Recognizing Geom Column

2017-03-27 Thread 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