We created a VRT file for the shapefile. Convert VRT to TAB with the following command:
ogr2ogr -f "MapInfo File" address.tab address.vrt -s_srs "+proj=longlat+ellps=WGS84 +datum=WGS84 +no_defs" -s_srs "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"
Notice duplicate -s_srs's. This is needed. Not sure why, but doesn't work without it.
Cheers,
Xin
On 09/01/06, Xin <[EMAIL PROTECTED]> wrote:
I appreciate it might look a bit strange the way I've got the command written. The idea is to convert from TAB to SHP and have WGS84 projection.
Converting with projection tags would result in non-earth projection, as MapInfo would see it. The command seems to work with identical target and source projections.
My problem is why does it work on Linux, but not on Windows. I'd love to get your views on it Frank.
Cheers,
XinOn 09/01/06, Frank Warmerdam <[EMAIL PROTECTED]> wrote:On 1/9/06, Xin < [EMAIL PROTECTED]> wrote:
> Hi list,
>
> I am trying to convert a shapefile to tabfile whilst reprojecting it to
> LatLong WGS84. This works great on Linux, but doesn't on Windows.
>
> The command used is:
> ogr2ogr -f "MapInfo File" address.tab address.shp -t_srs "+proj=longlat
> +ellps=WGS84 +datum=WGS84 +no_defs" -s_srs "+proj=longlat +ellps=WGS84
> +datum=WGS84 +no_defs"
>
> I did initially use EPSG codes, but that didn't work on Windows so I thought
> I'd try the actual datum codes. No luck.
>
> There are no error produced on Windows. On opening the TAB file it is not
> projected.
Xin,
You have told ogr2ogr that the source and target SRS are both WGS84
so there is no reprojection to do. If the source is not already in WGS84
degrees then you should either use a different -s_srs or omit this option
and let ogr2ogr pick up the coordinate system from the source file.
Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, [EMAIL PROTECTED]
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
