Opened 17 years ago
Last modified 17 years ago
#1575 closed defect
Need to limit KML Polygon Complexity — at Version 4
Reported by: | warmerdam | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 1.4.2 |
Component: | OGR_SF | Version: | unspecified |
Severity: | normal | Keywords: | kml |
Cc: | warmerdam, didge |
Description (last modified by )
Bryan reports:
""" I solved this problem with some help from Google:
http://groups.google.com/group/kml-support-getting-started/browse_thread/thread/e6995b8073e69c41
The problem turned out to be that Google has a limit on the number of vertices in a polygon. My solution was to dump the dataset into postgis and simplify the large polygons. I did something like this:
ogr2ogr -sql "select admin, case when area(the_geom) > 3000000000 then transform(simplify(the_geom, 4), 4030) else transform(simplify(the_geom, 0.01), 4030) end from utlanduse" -f kml out.kml PG:"host=localhost user=xxx dbname=statewide password=xxx"
The simplified polygons display without a problem in Google Earth. """
I think perhaps that the KML driver should warn, or include an option to automatically simplify features to be legal with google earth.