Hi On 2 February 2010 17:11, Antonio Castillo <gantonio.casti...@gmail.com>wrote:
> ogr2ogr -f "ESRI Shapefile" -a_srs "EPSG:4326" "puentes.shp" > "ODBC:INACMASQL" -nlt POINT -sql "SELECT > p.nombre,t.latitud,t.longitud,t.altura FROM puente p,trayectoria t WHERE > p.id_trajectory = t.id_trayectoria" I think your problem stems from the fact that the DBF created in the previous command has two fields that need to be related to a point geometry. There's an example in how to translate this query into a virtual dataset, which can then be translated into a shapefile easily in < http://www.gdal.org/ogr/drv_vrt.html>. Not tested, but basically create a file called the following file: <OGRVRTDataSource> <OGRVRTLayer name="MyQuery"> <SrcDataSource>ODBC:INACMASQL</SrcDataSource> * <SrcSQL*>SELECT p.nombre AS nombre,t.latitud AS lat,t.longitud AS long,t.altura AS altura FROM puente p,trayectoria t WHERE p.id_trajectory = t.id_trayectoria</SrcSQL> <GeometryType>wkbPoint</GeometryType> <LayerSRS>WGS84</LayerSRS> <GeometryField encoding="PointFromColumns" x="long" y="lat"/> </OGRVRTLayer> </OGRVRTDataSource> and then convert it into a Shapefile using ogr2ogr. Hope that helps! Jose
_______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev