[MultiGeometry] ge

28 views
Skip to first unread message

Laurent

unread,
Oct 7, 2011, 6:13:40 PM10/7/11
to libkml
Hi,

I want to deserialize a kml file with KmlLib (Kml library, version C#
(Aug 25, 2011)), but it's don't work.
The deserialisation are ok, but when I watch my object, I don't get
some properties of this object.
By example, in my kml file, I have these sections :
<Folder>
<name>02 - Aisne</name>
<Placemark>
<name>Limites administratives</name>
<styleUrl>#khStyle2676</styleUrl>
<MultiGeometry>
<extrude>1</extrude>
<LineString>
<extrude>1</extrude>
<coordinates>
4.12644497,49.67821369000001,0 4.12623943,49.67472240000001,0
4.12484074,49.65061485,0 4.11720479,49.64152870000001,0 4.1...
</coordinates>
</LineString>
<LineString>
<extrude>1</extrude>
<coordinates>
2.99020203,49.21067358,0
2.99171255,49.2...2.99020203,49.21067358,0
</coordinates>
</LineString>
</MultiGeometry>
</Placemark>
</Folder>
I want to get coordinates's section, but they are no visible in
deserialised object, no properties match.
Somebody, have an idea? There something, that I don't understand ?
This Kml lib's version is beta, and if yes, how I get another rc
version ?

Thanks a lot

Laurent BROUCK

Michael Ashbridge

unread,
Oct 7, 2011, 7:14:06 PM10/7/11
to lib...@googlegroups.com
See files like http://code.google.com/p/libkml/source/browse/trunk/examples/helloworld/printgeometry.cc
for how to walk geometries and
http://code.google.com/p/libkml/source/browse/trunk/examples/helloworld/simplifylines.cc
for how to use the FeatureVisitor to watch elements of interest.

> --
> You received this message because you are subscribed to the Google Groups "libkml" group.
> To post to this group, send email to lib...@googlegroups.com.
> To unsubscribe from this group, send email to libkml+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/libkml?hl=en.
>
>

Laurent BROUCK

unread,
Oct 10, 2011, 3:51:48 AM10/10/11
to lib...@googlegroups.com
Hi Michael,

Thank's for your examples, you use the same library than me ? (same version). Another question, kmlLib (version C++) look's more complete than KmlLib (version C#), it's really ?
I don't get the coordinates values in Multigeometry/LineString's Tags, because the deserialised object don't contains this properties.
I have the same problem, when I like get value coordinates in Placemark tag ?
Example :<Point id="khPoint933">
          <coordinates>-0.3600000143051101,49.18444444444445,0</coordinates>
        </Point>
In attachment, I have put my kml file, could you test the obtention of coordinates in Multigeometry tags ?
Have you an idea ?

Sincerely,

Laurent BROUCK

2011/10/8 Michael Ashbridge <kml.mas...@gmail.com>
doc.kml

Michael Ashbridge

unread,
Oct 10, 2011, 12:52:54 PM10/10/11
to lib...@googlegroups.com
I don't know anything about the C# version. Can't help you there.

I've attached a diff that modifies
examples/helloworld/printgeometry.cc to print coordinates of
LineStrings and Points when it sees them. For example:

$ echo "<Placemark><Point><coordinates>0,1,2
3,4,5</coordinates></Point></Placemark>" > /tmp/x.kml &&
./examples/helloworld/printgeometry /tmp/x.kml
Found a Point
coordinates:
<coordinates>0,1,2
3,4,5
</coordinates>

printgeometry-printcoordinates.diff

Laurent BROUCK

unread,
Oct 15, 2011, 3:57:22 AM10/15/11
to lib...@googlegroups.com
Thank Michael for your help, I will watch more this examples.
In your, my kml file is correct ?

2011/10/10 Michael Ashbridge <kml.mas...@gmail.com>

Laurent BROUCK

unread,
Nov 1, 2011, 3:17:30 PM11/1/11
to lib...@googlegroups.com
Hello Michael,

I have spend many times about this problem, and he is dont't solve :(
I thinl, yout lib in C++ is more complete than C# version, for example, I didn't find the function get_geometry_array_size.
I have no more idea, only post a news comments on the forum !


2011/10/15 Laurent BROUCK <laurent...@gmail.com>

Michael Ashbridge

unread,
Nov 1, 2011, 4:09:28 PM11/1/11
to lib...@googlegroups.com
Best suggestion is to contact the maintainer of the C# version.
Reply all
Reply to author
Forward
0 new messages