[Gdal-dev] Re: Problem exporting to MapInfo TAB with ogr2ogr from postgreSQL

Bill Thoen bthoen at gisnet.com
Fri Sep 15 11:45:25 EDT 2006


I didn't get a single response to this yesterday, so I'll ask it again. If
I'm not asking the right question or not explaining smoething, will
somebody please let me know, or point me to the right FM so I can RTFM? 

 
On Thu, Sep 14, 2006 at 08:53:25AM -0600, Bill Thoen wrote:
> I just installed gdal 1.3.2 (compiled from source using the default 
> settings) so I could use ogr2ogr to convert data in PostgreSQL to 
> MapInfo, but I'm getting some weird results. First, I tried:
> ogr2ogr -f "MapInfo File" test.tab "PG:dbname=spatial1" -sql "select * 
> from napp2"
> 
> I expected trouble with this because there are two geometries for each 
> record; a point and a polygon. But I got a file where  all records 
> mapped to the same point location and all fields were rendered as 
> char(254). So if you have multiple geometries, how do you specify the 
> one you want?
> 
> Next I tried a table with only one geometry. I typed:
> ogr2ogr -f "MapInfo File" test.tab "PG:dbname=spatial2" -sql "select id, 
> gridcode from adams_v1 where gridcode=72 limit 50"
> 
> This time I got 50 records with the id and gridcode set to the right 
> types, but no polygons. I tried specifying the geometry:
> ogr2ogr -f "MapInfo File" test.tab "PG:dbname=spatial2" -sql "select 
> the_geom, id, gridcode from adams_v1 where gridcode=72 limit 50"
> 
> but the result was the same. So I looked for documentation and found 
> only some *.dox files. So my question is, how do I read the 
> documentation, and why doesn't the MapInfo conversion work?
> 
> Thanks,
> - Bill Thoen
> 



More information about the Gdal-dev mailing list