<div dir="ltr"><div><div><div><div><div><div><div><p dir="ltr">Hi Even . Yes it is the message.<br>
</p><p dir="ltr">I speak wrongly of a crash, sorry.</p><p dir="ltr"><br></p><p dir="ltr">The space is a insidios error.</p><p dir="ltr">Because is no so easy to see it.</p><br></div>Infact when MapServer report me:<br><br>
 OGR error. GetLayer( select ogc_fid,text_id ,value ,subclasses ,extendedentity ,linetype ,entityhandle ,textstring ,filename ,size ,angle ,style ,strato ,desstrato ,tema ,destema ,classe ,desclasse ,layer ,descdbt ,descditta ,codctr ,area ,linea ,mod ,new,geometry from TEXT_LAYER_2D) failed for OGR connection `/home/vector/vettoriali/db_lavoro/zz_db_dbt2k_lavoro.sqlite'.<br>
<br></div>I dont notice the space in front.<br></div><div>Only after a debug session and some other test.<br>I start to try to reproduce it and notice the space in front.<br></div><br></div>I'm not so sure that is better to make mapserver ore tollerant (a trim() could be sufficient),<br>
</div>because will do this kind of error persistents.<br><br></div>But of course this is a classic user-error hard to see.<br>:)<br><br></div><div>A.<br><br></div><div><div class="gmail_quote">Il 06/lug/2014 15:40 "Even Rouault" <<a href="mailto:even.rouault@mines-paris.org" target="_blank">even.rouault@mines-paris.org</a>> ha scritto:<br type="attribution">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Le dimanche 06 juillet 2014 10:21:10, Andrea Peri a écrit :<br>
> Hi,<br>
><br>
> I notice that when , in the mapfile,<br>
> I define a DATA element<br>
> like this:<br>
><br>
> DATA " select field1, field2, field3 from TABLE1"<br>
><br>
> notice the space before the 'select' declaration.<br>
><br>
> The mapserver crash declaring to be unable to reach the data.<br>
<br>
Is the declaration of being unable to reach the data is something like the<br>
following ?<br>
<br>
<?xml version='1.0' encoding="UTF-8" ?><br>
<ServiceExceptionReport version="1.2.0" xmlns="<a href="http://www.opengis.net/ogc" target="_blank">http://www.opengis.net/ogc</a>"<br>
xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>"<br>
xsi:schemaLocation="<a href="http://www.opengis.net/ogc" target="_blank">http://www.opengis.net/ogc</a><br>
<a href="http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd" target="_blank">http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd</a>"><br>
  <ServiceException code="NoApplicableCode" locator="mapserv"><br>
msWFSGetFeature: WFS server error. FLTApplyFilterToLayer() failed<br>
msOGRFileOpen(): OGR error. GetLayer( SELECT NAME,UNIQUE_KEY,CAPITAL,POP_RANGE<br>
FROM popplace) failed for OGR connection `data/popplace.shp&#39;.<br>
  </ServiceException><br>
</ServiceExceptionReport><br>
<br>
If so, that's OK I guess. We could be more tolerant with leading spaces, but<br>
this isn't a crash, but an error message which gives some hint on where things<br>
are wrong.<br>
<br>
><br>
> The issue is the space in front of the select.<br>
><br>
> I don't know if this happened with all the formats.<br>
> Surely it happen with spatialite format (I use it).<br>
><br>
> I don't know if this is an issue to report or simply a wrong use of<br>
> data element.<br>
><br>
> Regards,<br>
><br>
> A<br>
<br>
--<br>
Geospatial professional services<br>
<a href="http://even.rouault.free.fr/services.html" target="_blank">http://even.rouault.free.fr/services.html</a><br>
</blockquote></div>
</div></div>