5

Can someone explain how the ogr2ogr simplify works?

I am trying to use raster data which has a spectral resolution of 30m. The vector file that I am trying to import into Google Fusion is large in size and so I was recommended to use ogr2ogr with tolerance of 0.00001.

Can someone explain the unit of the tolerance?

I assumed that it would be decimal degrees but the resulting KML still has around 10 decimal points.

3
  • Read about Douglas-Peucker simplification.
    – user30184
    Commented Apr 25, 2015 at 20:38
  • Thanks. Do you know what the unit on the tolerance is? Like if I specify 0.00001, what does that mean in terms of accuracy?
    – user52932
    Commented Apr 25, 2015 at 22:18
  • What has your raster (with a "spatial", not "spectral"?) resolution of 30m got to do with the vector data? Nothing?
    – Spacedman
    Commented Apr 26, 2015 at 20:29

1 Answer 1

5

You may still have 10dp numbers reported, but count the number of nodes in the modified file, and it should be far fewer that the original.

The tolerance unit is whatever the unit of your map data uses. 0.000001° would keep destination paths no more than 0.000001° (a metre 10 cm or so) from their original location. It would be far too small if your data were in metric UTM format.

Clarification: My original estimate was off by an order of magnitude. It would have been 0.00001° that would have been around a metre. I say around, as fractions of a degree vary by location, and aren't always equal. For example, where I live, 0.000001° N↔S is roughly 11 cm, but 0.000001° E↔W is only about 8 cm.

OGR only simplifies on fractions/multiples of the layer's unit. If your layer is EPSG 4326, you're going to have to live with fractions of a degree, and perhaps slight variations in tolerance over large objects. If you wish the unit to stay constant, convert to a projection such as UTM, and then the unit you use will be fractions/multiples of metres/feet/US survey feet, etc.

2
  • It is less that meter en.wikipedia.org/wiki/Decimal_degrees. You would also need a tool for reducing the precision of coordinates from 10 to 6 decimals but that is lacking from the KML driver of GDAL at the moment trac.osgeo.org/gdal/ticket/2461.
    – user30184
    Commented Apr 26, 2015 at 7:33
  • I see. So because my data is in WGS84, the unit will be decimal degrees only? Or is there a separate unit that is also maintained? How do I check this other unit, if it so exists?
    – user52932
    Commented Apr 26, 2015 at 16:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.