[gdal-dev] Reprojecting shapefile

Mullins, Steven Steven.Mullins at dmme.virginia.gov
Wed Nov 28 12:45:58 EST 2007


I am reading point data via a VRT file from a sql server and converting to a shapefile.  This works great.  The X and Y coordinates are read from the SQL data columns.  The shapefiles are reprojected but the X and Y datafields are not updated.  I understand why they are not, since they are not spatial data in the shapefile sense.  However, I would like them to match the reprojected coordinates.  Any suggestions?

Thanks,

Steve

VRT FILE (geology-all.ovf):

<OGRVRTDataSource>
    <OGRVRTLayer name="geology-all">
      <SrcDataSource>ODBC:xxx/xxxxxxxxx at xxxx</SrcDataSource>  
	<GeometryType>wkbPoint</GeometryType>
	<SrcSQL>
	  SELECT dmlrpermits_geopoints.keyPeGeoPoints, PeNo, PeGeoLoc, PeGeoElevation,
	   PeGeoAnalysis, PeGeoShared 
	  from dmlrpermits_geopoints
	</SrcSQL> 
      <LayerSRS>PROJCS["NAD27 / Virginia South",
    	  GEOGCS["NAD27",
        DATUM["North_American_Datum_1927",
        SPHEROID["Clarke 1866",6378206.4,294.9786982139103,
        AUTHORITY["EPSG","7008"]],
        AUTHORITY["EPSG","6267"]],
        PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.01745329251994328,
        AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","4267"]],
    	  PROJECTION["Lambert_Conformal_Conic_2SP"],
    	  PARAMETER["standard_parallel_1",36.76666666666667],
        PARAMETER["standard_parallel_2",37.96666666666667],
        PARAMETER["latitude_of_origin",36.33333333333334],
        PARAMETER["central_meridian",-78.5],
        PARAMETER["false_easting",2000000],
        PARAMETER["false_northing",0],
        UNIT["US survey foot",0.3048006096012192,
        AUTHORITY["EPSG","9003"]],
        AUTHORITY["EPSG","32047"]]
      </LayerSRS>
	<GeometryField encoding="PointFromColumns" x="PeGeoEasting" y="PeGeoNorthing"/> 
    </OGRVRTLayer>
</OGRVRTDataSource>


Command:

ogr2ogr -f "ESRI Shapefile"  -t_srs 83.wkt geo geology-all.ovf


More information about the gdal-dev mailing list