Opened 17 years ago
Closed 17 years ago
#1575 closed defect (fixed)
Need to limit KML Polygon Complexity
Reported by: | warmerdam | Owned by: | Mateusz Łoskot |
---|---|---|---|
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.
Change History (6)
comment:4 by , 17 years ago
Description: | modified (diff) |
---|
comment:5 by , 17 years ago
Cc: | added |
---|
comment:6 by , 17 years ago
comment:7 by , 17 years ago
Cc: | added; removed |
---|---|
Milestone: | 1.5.0 → 1.4.2 |
Owner: | changed from | to
Mateusz,
Could you add some notes in the kml driver user docs warning that very complex features may not render properly in GE? I don't think we should try and do simplification in the driver given the vagueness of the issues.
comment:8 by , 17 years ago
Status: | new → assigned |
---|
comment:9 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I updated KML driver documentation with short note about the limitation and potential problem.
I think it's worth to quote some notes from the polygon displays with vertical stripes thread here:
ManoM:
Bryan:
ManoM:
According my understanding of this explanation, there is not hard limits but it's more like a judgement that your geometry is too big.
So, it seems it's not possible to just check number of coordinates and warn user that it will probably can not be displayed properly in the GE.
For me, the idea of line/polygon simplification on request is very reasonable. The problem here is to define how user is supposed to use it. What factors are required as input, etc.? Many users do not know what's a geometry simplification, they may be confused if they will be asked for tolerance factor.