linestring limits?

648 views
Skip to first unread message

Enzo

unread,
Aug 28, 2007, 4:15:27 PM8/28/07
to KML Developer Support - Getting Started, rbr...@nrcan.gc.ca
I have been unsuccessfully trying to determine the limits for a
linestring. A few previous posts
http://groups.google.com/group/kml-support-getting-started/browse_thread/thread/d830e8ac1d90d338/af02bcad41eadc35?lnk=gst&q=linestring+limit&rnum=2#af02bcad41eadc35
and
http://groups.google.com/group/kml-support-getting-started/browse_thread/thread/1e3b59313cd6ed4/6d8aa813f5dae008?lnk=gst&q=maximum&rnum=1#6d8aa813f5dae008
talk about a 64k limit, but from my small experiments, I don't think I
get it. Doesn't seem to be anything in the KML references. Is there
any definitive source documenting the limitations? Any google
developers that could shed some light??

Here's my tests: I have a rather long contour line with some 80k+
vertices. Needless to say, GE doesn't render it. See
http://groups.google.com/group/kml-support/web/contour1050_problem.kmz

So, I chopped it into three parts, all less than 64k and each segment
works fine.
See http://groups.google.com/group/kml-support/web/cont1050prob_sect1.kmz
http://groups.google.com/group/kml-support/web/cont1050prob_sect2.kmz
and http://groups.google.com/group/kml-support/web/cont1050prob_sect3.kmz

Also they if I pull them all back together, they compare correctly
with the original, and again don't work. See
http://groups.google.com/group/kml-support/web/cont1050prob_sect132.kmz

This is all well and good and supports the 64k limit. But...

Next I simplified the line, keeping the shape approximately correct
but removing some vertices. The line didn't render although there are
only 6k+ points. See http://groups.google.com/group/kml-support/web/cont1050_prob_simp2.kmz

Doesn't make sense, so I looked to see how many vertices it would
render. See http://groups.google.com/group/kml-support/web/renders_no.kmz
(4770 vertices) and http://groups.google.com/group/kml-support/web/renders_yes.kmz
(4769 vertices)

I did later manage to create a version that would render with 6k+
vertices. See http://groups.google.com/group/kml-support/web/cont1050_prob_simp1.kmz

See my problem? I can't imagine why some of these linestrings will
not render when there are far less than 64k points. Can anybody shed
some light?

Thanks.

ManoM

unread,
Aug 28, 2007, 6:17:14 PM8/28/07
to KML Developer Support - Getting Started
Hi Enzo,

Some experimentation revealed an interesting result. It appears that
in the case of your simplified line, turning off tesselation or
turning off the terrain layer will cause it to show up. I'm not sure
what the cause of that is, and I'm going to look into it, but in the
mean time you know that this file isn't rendering for reasons other
than a limit on the number of vertices.

Some other comments about your KML file:

You're using the KML 2.0 namespace. You should be using 2.1 or 2.2
now:
<kml xmlns="http://earth.google.com/kml/2.2">

You separate your coordinates like this:
136.592811238978,46.7413440454061,1
,136.593354908879,46.7422657300852,1

There's an extra comma there, at the beginning of the 2nd and each
subsequent line.

Technically, according to the KML 2.1 and 2.2 schemata, <visibility>
and <open> come before <LookAt>. Earth is forgiving, but other KML
interpretations might not be.

You embed each <LineString> element in a <MultiGeometry> element. If
there's only one, you don't need the <MultiGeometry>. However, you
should be able to get around any limits on the number of vertices by
wrapping two or more contiguous <LineString> elements in one
<MultiGeometry> as long as each of them is under the limit.

ManoM

On Aug 28, 1:15 pm, Enzo wrote:
> I have been unsuccessfully trying to determine the limits for a

> linestring. A few previous postshttp://groups.google.com/group/kml-support-getting-started/browse_thr...
> andhttp://groups.google.com/group/kml-support-getting-started/browse_thr...


> talk about a 64k limit, but from my small experiments, I don't think I
> get it. Doesn't seem to be anything in the KML references. Is there
> any definitive source documenting the limitations? Any google
> developers that could shed some light??
>
> Here's my tests: I have a rather long contour line with some 80k+

> vertices. Needless to say, GE doesn't render it. Seehttp://groups.google.com/group/kml-support/web/contour1050_problem.kmz


>
> So, I chopped it into three parts, all less than 64k and each segment
> works fine.
> Seehttp://groups.google.com/group/kml-support/web/cont1050prob_sect1.kmzhttp://groups.google.com/group/kml-support/web/cont1050prob_sect2.kmz

> andhttp://groups.google.com/group/kml-support/web/cont1050prob_sect3.kmz


>
> Also they if I pull them all back together, they compare correctly

> with the original, and again don't work. Seehttp://groups.google.com/group/kml-support/web/cont1050prob_sect132.kmz


>
> This is all well and good and supports the 64k limit. But...
>
> Next I simplified the line, keeping the shape approximately correct
> but removing some vertices. The line didn't render although there are

> only 6k+ points. Seehttp://groups.google.com/group/kml-support/web/cont1050_prob_simp2.kmz


>
> Doesn't make sense, so I looked to see how many vertices it would
> render. Seehttp://groups.google.com/group/kml-support/web/renders_no.kmz

> (4770 vertices) andhttp://groups.google.com/group/kml-support/web/renders_yes.kmz


> (4769 vertices)
>
> I did later manage to create a version that would render with 6k+

> vertices. Seehttp://groups.google.com/group/kml-support/web/cont1050_prob_simp1.kmz

Enzo

unread,
Aug 28, 2007, 7:54:13 PM8/28/07
to KML Developer Support - Getting Started
Thanks for the tesselation tip - I'll try that for others that give me
problems. And also for the tips about the KML syntax. I knew about
the extra ','s. These KML were exported from a ArcGIS and I didn't
bother to edit them since they seem to work anyway.

> > Seehttp://groups.google.com/group/kml-support/web/cont1050prob_sect1.kmz...


> > andhttp://groups.google.com/group/kml-support/web/cont1050prob_sect3.kmz
>
> > Also they if I pull them all back together, they compare correctly
> > with the original, and again don't work. Seehttp://groups.google.com/group/kml-support/web/cont1050prob_sect132.kmz
>
> > This is all well and good and supports the 64k limit. But...
>
> > Next I simplified the line, keeping the shape approximately correct
> > but removing some vertices. The line didn't render although there are
> > only 6k+ points. Seehttp://groups.google.com/group/kml-support/web/cont1050_prob_simp2.kmz
>
> > Doesn't make sense, so I looked to see how many vertices it would
> > render. Seehttp://groups.google.com/group/kml-support/web/renders_no.kmz
> > (4770 vertices) andhttp://groups.google.com/group/kml-support/web/renders_yes.kmz
> > (4769 vertices)
>
> > I did later manage to create a version that would render with 6k+
> > vertices. Seehttp://groups.google.com/group/kml-support/web/cont1050_prob_simp1.kmz
>
> > See my problem? I can't imagine why some of these linestrings will
> > not render when there are far less than 64k points. Can anybody shed
> > some light?
>

> > Thanks.- Hide quoted text -
>
> - Show quoted text -

Enzo

unread,
Aug 29, 2007, 11:44:29 AM8/29/07
to KML Developer Support - Getting Started
Also found that if I raise the non-rendered line
http://groups.google.com/group/kml-support/web/renders_no.kmz by about
130 meters it displays (but then is difficult to interpret). Probably
something similar to removing tessellation. I wonder why adding one
additional vertex to http://groups.google.com/group/kml-support/web/renders_yes.kmz
causes it to sink 130m below the surface. Weird.
Reply all
Reply to author
Forward
0 new messages