[mapserver-users] msOGRFileOpen

Eichner, Andreas - SID Andreas.Eichner at sid.sachsen.de
Thu Nov 3 01:34:44 PDT 2016


As mentioned in
http://mapserver.org/input/vector/mssql.html#option-1-connect-through-ogr
adding ";Tables=<table>(<geom_column>)" might help. You can try to add 
  OPTION MSSQLSPATIAL_USE_GEOMETRY_COLUMNS NO
at MAP level to avoid reading the "geometry_columns"-Table. I guess the SRID will be reported as -1 then and you need to define a PROJECTION block at the LAYER. You can use the DATA statement to define the SQL for your layer.

HTH

> -----Ursprüngliche Nachricht-----
> Von: Vogt, Robert (RCIS) [mailto:Robert.Vogt at rcis.com]
> Gesendet: Mittwoch, 2. November 2016 16:49
> An: Eichner, Andreas - SID; mapserver-users at lists.osgeo.org
> Betreff: RE: msOGRFileOpen
> 
> Yes, thank you! I figured that out(so many different configuration :))
> 
> I'm curious OGR doesn't seem to be able to find my SRID and it also looks
> like it pulls ALL fields...this seems inefficient
> 
> Is there a way to pass custom SQL to OGR and only include columns that are
> needed and the SRID?
> 
> -Bob
> 
> 
> 
> -----Original Message-----
> From: Eichner, Andreas - SID [mailto:Andreas.Eichner at sid.sachsen.de]
> Sent: Tuesday, November 01, 2016 12:30 PM
> To: Vogt, Robert (RCIS); mapserver-users at lists.osgeo.org
> Subject: AW: msOGRFileOpen
> 
> From http://www.gdal.org/drv_mssqlspatial.html and the linked page about
> ODBC driver connection string (http://msdn.microsoft.com/en-
> us/library/ms130822.aspx) it seems you need to use "UID" and "PWD" instead
> of "username" and "password"
> 
> HTH
> 
> > -----Ursprüngliche Nachricht-----
> > Von: mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org]
> > Im Auftrag von Vogt, Robert (RCIS)
> > Gesendet: Dienstag, 1. November 2016 14:36
> > An: mapserver-users at lists.osgeo.org
> > Betreff: [mapserver-users] msOGRFileOpen
> >
> > Good morning,
> >
> > I have successfully tested my connection string with "ogrinfo", now
> > however when I try to use that connection string in my MapFile I
> > receive this error...
> >
> > msDrawMap(): Image handling error. Failed to draw layer named 'myLayer'.
> > msOGRFileOpen(): OGR error. Open failed for OGR connection in layer
> > `myLayer'. Unable to initialize connection to the server for
> > MSSQL:Database=mydatabase;Server=myServer;user=myUser;password=XXXXXXX
> > XXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX SQL Server Driver][SQL
> > Server]Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'
> >
> > Any help is greatly appreciated!!
> >
> > _______________________________________________
> > mapserver-users mailing list
> > mapserver-users at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/mapserver-users


More information about the mapserver-users mailing list