[gdal-dev] Re: ogr2ogr: shp > kml, coordinate precision and related kml file size

Hermann Peifer peifer at gmx.eu
Sat Mar 14 10:23:33 EDT 2009


Christopher Condit wrote:
> Hi Hermann,
> 
>> In my context, Lat/Lon values with 6 decimals are just about enough
>> precision. I feel that I am pumping a lot of meaningless numbers into
>> the kml file, which makes it big. Is there an option to reduce the
>> number of decimals for transformed coordinates?
> 
> See http://trac.osgeo.org/gdal/ticket/2461 for information about this...
> 
>> However, and based on my limited understanding: I do not need 3 numbers
>> to describe a point in a 2D system, do I? How can I strip the height
>> coordinate (and why is it there in the first place?).
> 
> I think you can use the nlt option to at least make the input 2.5 D and
> then strip the Z value off, effectively removing the height. It may be
> related to the CS transformation but I'm not sure without seeing your
> actual input file.
> 
> -Chris

I now noticed: my earlier coordinate transformation example with a non-zero height value was done on another computer, with an older version of libproj (4.5.0, from 2006). 

<Polygon><outerBoundaryIs><LinearRing><coordinates>
   13.457676473320388,55.803540172099304,-0.000071634377946
</coordinates></LinearRing></outerBoundaryIs></Polygon>

After updating to libproj 4.6.1, the height is always 0, is as expected.

<Polygon><outerBoundaryIs><LinearRing><coordinates>
  13.457535814437861,55.800578762055501,0 
</coordinates></LinearRing></outerBoundaryIs></Polygon>



More information about the gdal-dev mailing list