[mapserver-users] ogr csv layer in mapserver
Murat Beyhan
beyhan at deprem.gov.tr
Tue Mar 6 00:41:26 PST 2012
The problem solved by giving full path of csv file in map file as
follows than it works thanks
<SrcDataSource>/var/www/html/dynamic/kyh_sta_ogr.csv</SrcDataSource>
thanks again
Murat
On Tue, 2012-03-06 at 09:56 +0200, Murat Beyhan wrote:
> Dear all,
>
> I used gdal 1.7.2 and mapserver 5.2.1
>
> I try to draw layer which data csv file as follows
>
> filename : kyh_sta_ogr.csv
>
> "ID","STA_ID","Latitude","Longitude"
> 1,0104,37.02403,35.80947
> 2,0118,37.02100,35.19100
> .
> .
> .
>
>
> then I use ogr for reading data from that file as follows and map file
> also here
>
>
>
> LAYER
> NAME "kyh_vrt_ogr"
> CONNECTIONTYPE OGR
> CONNECTION '<OGRVRTDataSource>
> <OGRVRTLayer name="kyh_sta_ogr">
> <SrcDataSource>kyh_sta_ogr.csv</SrcDataSource>
> <GeometryType>wkbPoint</GeometryType>
> <LayerSRS>WGS84</LayerSRS>
> <GeometryField encoding="PointFromColumns" x="Longitude"
> y="Latitude"/>
> </OGRVRTLayer>
> </OGRVRTDataSource>'
> DATA kyh_sta_ogr
> STATUS default
> TYPE POINT
> CLASS
> NAME "kyh"
> SYMBOL "cpoint"
> SIZE 1
> COLOR 0 0 0
> END
> END
>
> Please let me inform what is wrong in my code and why always trouble to
> draw ogr layer in mapserver.
> mapserver gives following error message
>
> msDrawMap(): Image handling error. Failed to draw layer named
> 'kyh_vrt_ogr'. msOGRFileOpen(): OGR error. Open failed for OGR
> connection in layer `kyh_vrt_ogr'. Failed to open datasource
> `kyh_sta_ogr.csv'.
>
>
>
> but command
> ogrinfo -ro -al kyh.vrt
> as follows:
>
> ogrinfo -ro -al kyh.vrt
> INFO: Open of `kyh.vrt'
> using driver `VRT' successful.
>
> Layer name: kyh_sta_ogr
> Geometry: Point
> Feature Count: 327
> Layer SRS WKT:
> GEOGCS["WGS 84",
> DATUM["WGS_1984",
> SPHEROID["WGS 84",6378137,298.257223563,
> AUTHORITY["EPSG","7030"]],
> TOWGS84[0,0,0,0,0,0,0],
> AUTHORITY["EPSG","6326"]],
> PRIMEM["Greenwich",0,
> AUTHORITY["EPSG","8901"]],
> UNIT["degree",0.0174532925199433,
> AUTHORITY["EPSG","9108"]],
> AUTHORITY["EPSG","4326"]]
> ID: String (0.0)
> STA_ID: String (0.0)
> Latitude: String (0.0)
> Longitude: String (0.0)
> OGRFeature(kyh_sta_ogr):1
> ID (String) = 1
> STA_ID (String) = 0104
> Latitude (String) = 37.02403
> Longitude (String) = 35.80947
> POINT (35.809469999999997 37.024030000000003)
>
> OGRFeature(kyh_sta_ogr):2
> ID (String) = 2
> STA_ID (String) = 0118
> Latitude (String) = 37.02100
> Longitude (String) = 35.19100
> POINT (35.191000000000003 37.021)
>
>
>
>
> Murat BEYHAN
>
> Jeofizik Y.Müh.
> T.C. Başbakanlık
> Afet ve Acil Durum Yönetimi Başkanlığı
> Deprem Dairesi Başkanlığı
> Eskişehir Yolu 12. Km.
> Lodumlu/ANKARA
> Tel: 312 2872680-1556
> email:beyhan at deprem.gov.tr
>
>
>
>
Murat BEYHAN
Jeofizik Y.Müh.
T.C. Başbakanlık
Afet ve Acil Durum Yönetimi Başkanlığı
Deprem Dairesi Başkanlığı
Eskişehir Yolu 12. Km.
Lodumlu/ANKARA
Tel: 312 2872680-1556
email:beyhan at deprem.gov.tr
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
More information about the MapServer-users
mailing list