[gdal-dev] ogr2ogr midmif to tab format conversion

Zoltan Szecsei zoltans at geograph.co.za
Fri Apr 29 10:27:31 EDT 2011


On 2011-04-29 16:03, Frank Warmerdam wrote:
> On 11-04-29 08:25 AM, Zoltan Szecsei wrote:
>> Any idea why the TAB route messes up the geometries?
>
> As discussed in http://www.gdal.org/ogr/drv_mitab.html the driver 
> needs to
> set a bounds for coordinates which determines precision.  If it doesn't
> know the coordinate system it won't know that the bounds should be small
> (and hence the precision high) for latitudes and longitudes.   Try adding
> -a_srs WGS84 to your ogr2ogr command to tell OGR that the coordinate 
> system
> is geographic.
>
>
> eg.
>
> ogr2ogr -f "MapInfo File" -a_srs WGS84 $n $m

Spot on, Frank - thank you. (it works as desired, now).
I'm not sure if anything is mentioned in the overview docs or help area, 
but perhaps that comment regarding assumed precision could be added 
somewhere obvious even to skip-readers like me?
[just to save you having to repeat yourself too often :-) ]


BTW - any idea why the organizePolygons() routine bellows?
Does it suggest an open polygon in my data-set, which then maybe engulfs 
the other polygons?
Presumably 3-point polygons are classified as errors because the first 
and last points are counted as "2" ?

Is there a way to get a coordinate or some debugging info to assist in 
finding the offending geometries?

Thanks & regards,
Zoltan


geograph at gs0:/mnt/geo_lvm0/gisdata/NGIQ04x/midmif_toNGI/20110428/q041_1/ogr$ 
./mif2tab
******************** Starting ADMN_GEONAMES.mif
******************** Starting CULT_BARRIERS.mif
******************** Starting CULT_EDUCATIONAL.mif
******************** Starting CULT_INDUSTRIAL.mif
******************** Starting CULT_PUBLIC.mif
******************** Starting CULT_RECREATIONAL.mif
******************** Starting CULT_UTILITIES.mif
******************** Starting GEOD_TRIG_STATIONS.mif
ERROR 6: Error during reading Record.
******************** Starting HYDR_AREAS.mif
******************** Starting HYDR_LINES.mif
******************** Starting HYDR_POINTS.mif
******************** Starting HYPS_ELEVATION_LINES.mif
******************** Starting HYPS_ELEVATION_POINTS.mif
******************** Starting LCLU_LANDCOVER.mif
Warning 1: organizePolygons() received an unexpected geometry.
Either a polygon with interior rings, or a polygon with less than 4 points,
or a non-Polygon geometry.  Return arguments as a collection.
Warning 1: Geometry of polygon cannot be translated to Simple Geometry. 
All polygons will be contained in a multipolygon.

Warning 1: organizePolygons() received an unexpected geometry.
Either a polygon with interior rings, or a polygon with less than 4 points,
or a non-Polygon geometry.  Return arguments as a collection.
Warning 1: Geometry of polygon cannot be translated to Simple Geometry. 
All polygons will be contained in a multipolygon.

******************** Starting LCLU_LANDUSE.mif
Warning 1: organizePolygons() received an unexpected geometry.
Either a polygon with interior rings, or a polygon with less than 4 points,
or a non-Polygon geometry.  Return arguments as a collection.
Warning 1: Geometry of polygon cannot be translated to Simple Geometry. 
All polygons will be contained in a multipolygon.

Warning 1: organizePolygons() received an unexpected geometry.
Either a polygon with interior rings, or a polygon with less than 4 points,
or a non-Polygon geometry.  Return arguments as a collection.
Warning 1: Geometry of polygon cannot be translated to Simple Geometry. 
All polygons will be contained in a multipolygon.

******************** Starting PHYS_LANDFORM_ARTIFIC.mif
******************** Starting PHYS_LANDFORM_NATURAL.mif
******************** Starting q041_new_ADMN_BOUNDARIES_AREA.mif
******************** Starting TRAN_CROSSINGS.mif
******************** Starting TRAN_FACILITIES.mif
******************** Starting TRAN_RAILWAY_LINES.mif
******************** Starting TRAN_ROADS.mif
geograph at gs0:/mnt/geo_lvm0/gisdata/NGIQ04x/midmif_toNGI/20110428/q041_1/ogr$ 


-- 

===========================================
Zoltan Szecsei PrGISc [PGP0031]
Geograph (Pty) Ltd.
P.O. Box 7, Muizenberg 7950, South Africa.

65 Main Road, Muizenberg 7945
Western Cape, South Africa.

34° 6'16.35"S 18°28'5.62"E

Tel: +27-21-7884897  Mobile: +27-83-6004028
Fax: +27-86-6115323     www.geograph.co.za
===========================================



-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1209 / Virus Database: 1500/3603 - Release Date: 04/28/11



More information about the gdal-dev mailing list