[mapserver-users] VRT / CSV data sources are not displayed in a layer

Stefan Schantz SSchantz at BfS.de
Fri Jan 22 02:55:09 EST 2010


Hello Frank, hello Carlos
my CSV-file and my VRT-file looks like this:
 >
 > My CSV is
 > x-utm,y-utm,Wert
 >  742226.,  5374978., 0.00E+00
 >  743422.,  5375072., 0.00E+00
 >  744620.,  5375166., 0.00E+00
 > ...
 >
 > and my VTR is
 > <OGRVRTDataSource>
 >  <OGRVRTLayer name="boden">
 >      <SrcDataSource>/daten/csv/boden.csv</SrcDataSource>
 >      <GeometryType>wkbPoint</GeometryType>
 >      <GeometryField encoding="PointFromColumns" x="x-utm" y="y-utm"/>
 >  </OGRVRTLayer>
 > </OGRVRTDataSource>
 >
As you can see, I use absolute paths for the datasource. I also tried to 
use a wrong  relative path and in this case I got an error from the 
Mapserver, so I think the mapserver can find the csv-file with the 
absolute path .
Even if I add the source layer tag <SrcLayer>boden</SrcLayer> as Carlos 
told before , the result is negative and  I get a blank picture from 
the  Mapserver.
Any other idea?
Thanks
Stefan


Frank Warmerdam schrieb:
> Stefan,
>
> I would suspect that your .vrt file contains relative rather
> than absolute paths and that they are relative to a
> different working directory if used from MapServer.
> There is an attribute for the <SrcDataSource> that
> may address this.  It might help if you posted the
> VRT.
>
> 2010/1/20 Stefan Schantz <SSchantz at bfs.de>:
>   
>> Hello List,
>>
>> The following layer uses a CSV-file (together with a VRT-File (Virtual
>> Format) ) as datasource . When I try to visualize the layer, nothing is
>> shown (neither the data nor error messages; shp2img shows also nothing)
>>
>> LAYER
>>   NAME "boden"
>>   DEBUG on
>>   STATUS ON
>>   TYPE POINT
>> # DATA "/daten/csv/boden/boden" # Datenquelle Shapefile
>>   CONNECTION   "/daten/csv/boden.vrt"
>>   CONNECTIONTYPE OGR
>>
>>   PROJECTION
>>       "init=epsg:25832"
>>   END
>>         METADATA
>>       "WMS_TITLE"    "test"
>>       "WMS_SRS"   "EPSG:25832"
>>   "WMS_ABSTRACT"    "test"
>>       "WMS_FEATURE_INFO_MIME_TYPE" 'text/html'
>>   END
>>
>>       CLASS
>>          NAME "test"
>>          STYLE
>>               SYMBOL "circle"
>>               SIZE 15                 COLOR 90 90 90
>>          END
>>       END           END
>>
>>
>> But if I transform the CSV/VRT-file into a Shapefile  via ogr2ogr
>>
>> ogr2ogr -s_srs EPSG:25832 -t_srs EPSG:25832 -f "ESRI Shapefile" boden
>> boden.vrt
>>
>>
>> the layer displays the data.
>> What is wrong with my VRT/CSV-datasource in the mapfile?
>>
>> Thanks for any idea.
>>
>> Best regards
>> Stefan
>> _______________________________________________
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>
>>     
>
>
>
>   
-------------- next part --------------
<OGRVRTDataSource>
    <OGRVRTLayer name="boden">
        <SrcDataSource>/daten/csv/boden.csv</SrcDataSource>
	 <SrcLayer>boden</SrcLayer>
        <GeometryType>wkbPoint</GeometryType>
        <LayerSRS>EPSG:25832</LayerSRS>
        <GeometryField encoding="PointFromColumns" x="x-utm" y="y-utm"/>
    </OGRVRTLayer>
</OGRVRTDataSource>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: boden.csv
Type: application/vnd.ms-excel
Size: 82846 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-users/attachments/20100122/165d9d5f/boden-0001.xlb


More information about the mapserver-users mailing list