Problem with OGR connection for XY point layer
Murat BEYHAN
beyhan at DEPREM.GOV.TR
Mon Feb 5 22:48:46 PST 2007
Dear Gaston,
The point which you would like to se on the map should be define as double
field type in the table for MySql.
May be this can be help you.
regards...
Murat
On Mon, 5 Feb 2007 22:34:54 -0300, Gaston Izaguirre wrote
> Hi all,
>
> I'm using MS4W 1.5.5 on WinXP SP2 (mapserver 4.8.4, PHP 4.4.3,
> php_mapscript_48.dll, GDAL to 1.3.2).
> I'm trying to connect to a SQL server 2000 through an OGR Virtual
> Format driver to obtain X,Y coordinates plus other ancillary data
> from a View that I defined in the database. The data base is updated
> constantly with new coordinates, so the number of rows can change,
> actually there are about 20 points.
>
> The syntax of my .OVF file is:
>
> <OGRVRTDataSource>
> <OGRVRTLayer name="puntos">
>
<SrcDataSource>ODBC:mi_usuario/mi_password at mi_DSN,mi_vista_de_la_bd</SrcDataSource>
> <SrcLayer>mi_vista_de_la_bd</SrcLayer>
> <!-- <FID>Poul_id</FID> -->
> <GeometryType>wkbPoint</GeometryType>
> <LayerSRS>WGS84</LayerSRS>
> <!-- <LayerSRS>EPSG:4326</LayerSRS> -->
> <GeometryField encoding="PointFromColumns" x="Poul_longitud"
> y="Poul_latitud"/>
> </OGRVRTLayer>
> </OGRVRTDataSource>
>
> I´ve tested with OGRINFO and the result is something like the following:
>
> Layer name: puntos
> OGRFeature(puntos):0
> Vehi_textid (String) = 276 33
> Poul_id (Integer) = 73
> Poul_vehi_id (Integer) = 9
> Poul_latitud (Real) = -34
> Poul_longitud (Real) = -58
> Poul_velocidad (Real) = 0
> Poul_sentido (String) = 0
> Poul_posi_fecha (String) = 31/01/2007 12:18:46
> POINT (-58 -34 0)
>
> OGRFeature(puntos):1
> Vehi_textid (String) = 276 58
> Poul_id (Integer) = 63
> Poul_vehi_id (Integer) = 9
> Poul_latitud (Real) = -34
> Poul_longitud (Real) = -58
> Poul_velocidad (Real) = 0
> Poul_sentido (String) = 0
> Poul_posi_fecha (String) = 05/02/2007 17:44:02
> POINT (-58 -34 0)
> ...
> ...
> ...
> ...
> OGRFeature(puntos):19
> Vehi_textid (String) = 276 59
> Poul_id (Integer) = 64
> Poul_vehi_id (Integer) = 9
> Poul_latitud (Real) = -34
> Poul_longitud (Real) = -58
> Poul_velocidad (Real) = 12
> Poul_sentido (String) = 170
> Poul_posi_fecha (String) = 05/02/2007 22:09:35
> POINT (-58 -34 0)
>
> As you can see, the connection retrieves the 20 points, but there is
> a problem with the X/Y (lat/lon) values: they are rounded to the
> integer part, in spite of being defined as real in the database. For
> example, for the last point (#19) I get: xcoord = -58 ycoord = -34
> when the actual value is: x = -58.904272 y = -34.447837
>
> As a result of this, when I test the mapfile with SHP2IMG all 20
> points are in the same place (all with the same coordinate values;
> e.g. x,y = -58,-34)
>
> I am making some mistake?
> My syntax is correct?
> Is there someone to give me a hand on this problem?
>
> Thanks in advance,
>
> Gaston.
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
Murat Beyhan
Jeofizik Yük. Müh.
Afet İşleri Genel Müdürlüğü
Deprem Araştırma Dairesi
Eskişehir Yolu 12. Km. Lodumlu/Ankara
Tel:+90 (312) 2872680-1550
--
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