[Portugal] Re: Portugal Digest, Vol 17, Issue 23

stelmo at sapo.pt stelmo at sapo.pt
Tue Aug 18 15:33:45 EDT 2009


Olá

Sem ter muita certeza (uma vez que setrata de ligação ao MSSQL e não  
POSTGIS) mas acho que na linha

DATA "geometry from lic_2004"

Há que ter o comando : using unique GID

Em que GID é o campo chave da tabela.

Stelmo

>    2. erro na conec??o ao sql server (Lisete Vieira)

> Message: 2
> Date: Tue, 18 Aug 2009 16:19:59 +0100
> From: Lisete Vieira <lisetelvieira  gmail.com>
> Subject: [Portugal] erro na conec??o ao sql server
> To: portugal  lists.osgeo.org, lusogis  yahoogrupos.com.br
> Message-ID:
> 	<a13556a30908180819h153c17ebxa759ec5d5240464a  mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Boa tarde,
> Tenho uma duvida ao tentar usar SQL server no MAPSERVER.
>
> Consigo efectuar a connection mas no parametro DATA dá o seguinte erro:
>
>   Warning: [MapServer Error]: msDrawMap(): Failed to draw layer named
> 'Lic_2004'. in C:\ms4w\apps\WebGis_PHP\htdocs\codigo.php on line 40 Warning:
> [MapServer Error]: msMSSQL2008LayerOpen(): Could not parse the layer data in
> C:\ms4w\apps\WebGis_PHP\htdocs\codigo.php on line 40 Warning: [MapServer
> Error]: msMSSQL2008LayerParseData(): No primary key defined for table, or
> primary key contains more that one column Error with MSSQL2008 data
> variable. You specified 'lic_2004'.
> Standard ways of specifiying are :
> (1) 'geometry_column from geometry_table'
> (2) 'geometry_column from (<sub query>) as foo using unique <column name>
> using SRID=<srid#>'
>
> Make sure you utilize the 'using unique <column name>' and 'using with
> <index name>' clauses in.
>
> For more help, please see http://www.mapdotnet.com
>
> mapmssql2008.c - version of 2007/7/1. in
> C:\ms4w\apps\WebGis_PHP\htdocs\codigo.php on line 40 Warning: [MapServer
> Error]: msMSSQL2008LayerRetrievePK(): Error executing MSSQL2008 statement
> (msMSSQL2008LayerRetrievePK():SELECT convert(varchar(50), sys.columns.name)
> AS ColumnName, sys.indexes.name FROM sys.columns INNER JOIN sys.indexes
> INNER JOIN sys.tables ON sys.indexes.object_id = sys.tables.object_id INNER
> JOIN sys.index_columns ON sys.indexes.object_id =
> sys.index_columns.object_id AND sys.indexes.index_id =
> sys.index_columns.index_id ON sys.columns.object_id =
> sys.index_columns.object_id AND sys.columns.column_id =
> sys.index_columns.column_id WHERE (sys.indexes.is_primary_key = 1) AND (
> sys.tables.name = N'lic_2004') in C:\ms4w\apps\WebGis_PHP\htdocs\codigo.php
> on line 40 Fatal error: Call to a member function saveWebImage() on a
> non-object in C:\ms4w\apps\WebGis_PHP\htdocs\codigo.php on line 42
>
> Como posso aceder a uma tabela em em SQL de forma a ficar visivel a
> geometria no map server?
>
> Criei a seguinte Layer:
> LAYER
>  METADATA
>         "DESCRIPTION" "TESTE DE LIGAÇÃO A BD"
>     END
>     CONNECTIONTYPE PLUGIN
>  PLUGIN "C:/ms4w/Apache/specialplugins/msplugin_mssql2008.dll"
>  CONNECTION "server=***;uid=***;pwd=***;database=SIG; Integrated
> Security=false"
>  DATA "geometry from lic_2004"
>  NAME "Lic_2004"
>     STATUS ON
>     TRANSPARENCY 100
>     TYPE POLYGON
>     UNITS METERS
>     CLASS
>       STYLE
>         COLOR 210 200 190
>         OUTLINECOLOR 195 212 157
>       END
>     END
> END
>
>  Dá o erro acima indicado.
>
> Obrigado
> Lisete Vieira
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:  
> http://lists.osgeo.org/pipermail/portugal/attachments/20090818/98e03ea6/attachment-0001.html
>
> ------------------------------
>
> _______________________________________________
> Portugal mailing list
> Portugal  lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/portugal
>
>
> End of Portugal Digest, Vol 17, Issue 23
> ****************************************
>



More information about the Portugal mailing list