[postgis-users] PostGIS view in qgis

Andreas Neumann a.neumann at carto.net
Mon Mar 9 09:13:23 PDT 2009


have you tried creating a sequence and then using nextval(sequence_name)
to get a primary key?

Andreas


On Mon, March 9, 2009 4:10 pm, Martin Fafard wrote:
> Eduin
>
> Thank you for the answer but it doesn't work. Since I create new objects
> from a view (polygonize), it seem to be impossible to create a unique id
> in this view for these objects. Someone else have ever aggregate geom in
> a view to see it in qgis or other viewer??
>
> Martin F
>
> Eduin Yezid Carrillo Vega a écrit :
>> If your postgresql version is 8.0 or less you can use OID fields as
>> key identifier.
>>
>> CREATE VIEW myview AS SELECT oid AS gid, the_geom FROM mytable;
>>
>> In postgresql 8.3 you can force oid creation if WITH OIDS is specified
>> when the table is created
>>
>>
>> Eduin Yesid Carrillo Vega
>> Ingeniero Civil, Esp. Sistemas de Información Geográfica
>> Centro de Investigación y Desarrollo en Información Geográfica
>> Instituto Geográfico Agustín Codazzi - IGAC
>> Cr 30 48-51
>> Tel +57 1 3694000  ext 4593
>> Bogotá D.C., Colombia
>>
>>
>>
>> On Mon, Mar 9, 2009 at 2:43 AM, Marc Jansen <jansen.marc at gmx.de> wrote:
>>
>>> HI Martin,
>>>
>>>
>>> Martin Fafard schrieb:
>>>
>>>> Hi
>>>>
>>>> I polygonize linestrings in a view to see the result in qgis. But qgis
>>>> need gid. How can I create the gid column after an aggregate function
>>>> in a
>>>> view?
>>>>
>>> AFAIK you can't. Maybe a table (created by your query) with a serial /
>>> primary key helps.
>>>
>>> --Marc
>>>
>>>
>>>
>>>
>>>> Martin F
>>>> _______________________________________________
>>>> postgis-users mailing list
>>>> postgis-users at postgis.refractions.net
>>>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>>>
>>>>
>>> _______________________________________________
>>> postgis-users mailing list
>>> postgis-users at postgis.refractions.net
>>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>>
>>> No virus found in this incoming message.
>>> Checked by AVG - www.avg.com
>>> Version: 8.0.237 / Virus Database: 270.11.9/1990 - Release Date:
>>> 03/08/09 17:17:00
>>>
>>>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>


-- 
Andreas Neumann
http://www.carto.net/neumann/
http://www.svgopen.org/




More information about the postgis-users mailing list