ogrinfo show x y columns as strings

Frank Warmerdam fwarmerdam at GMAIL.COM
Fri May 6 15:55:45 EDT 2005


On 5/6/05, Richard Duivenvoorde <rdmailings at duif.net> wrote:
> duh, I think I tried all combinations now :-0
> 
> all info I could google or find was about ODBC vrt's. IF it's possible
> maybe it's an idea to put a vrt and csv file in the helpfile of
> http://www.gdal.org/ogr/drv_vrt.html as an non odbc example?

Richard,

Try:

<OGRVRTDataSource>
  <OGRVRTLayer name="testpoints">
    <SrcDataSource relativeToVRT="1">testpoints.csv</SrcDataSource>
    <SrcLayer>testpoints</SrcLayer>
    <GeometryType>wkbPoint</GeometryType>
    <LayerSRS>epsg:28992</LayerSRS>
    <GeometryField encoding="PointFromColumns" x="x" y="y"/>
  </OGRVRTLayer>
</OGRVRTDataSource>

I generally avoid using the directory name for the datasource as it will
only be recognised as a csv datasource if at least half the files in it
are .csv files.   The above worked fine for me:
Had to open data source read-only.
INFO: Open of `richards.ovr'
using driver `VRT' successful.

Layer name: testpoints
Geometry: Point
Feature Count: 2
Extent: (100000.000000, 400000.000000) - (110000.000000, 411000.000000)
Layer SRS WKT:
PROJCS["Amersfoort / RD New",
    GEOGCS["Amersfoort",
        DATUM["Amersfoort",
            SPHEROID["Bessel 1841",6377397.155,299.1528128,
                AUTHORITY["EPSG","7004"]],
            AUTHORITY["EPSG","6289"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.01745329251994328,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","4289"]],
    PROJECTION["Oblique_Stereographic"],
    PARAMETER["latitude_of_origin",52.15616055555555],
    PARAMETER["central_meridian",5.38763888888889],
    PARAMETER["scale_factor",0.9999079],
    PARAMETER["false_easting",155000],
    PARAMETER["false_northing",463000],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AUTHORITY["EPSG","28992"]]
text: String (0.0)
x: String (0.0)
y: String (0.0)
OGRFeature(testpoints):1
  text (String) = test
  x (String) = 100000
  y (String) = 400000
  POINT (100000 400000)

OGRFeature(testpoints):2
  text (String) = test2
  x (String) = 110000
  y (String) = 411000
  POINT (110000 411000)

PS. I have updated the drv_vrt.html to mention that datasources other
than odbc are supported.  I didn't add any extra examples though.

Best regards,
Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the mapserver-users mailing list