DiomedesDominguez / kml-library

Automatically exported from code.google.com/p/kml-library
0 stars 0 forks source link

A list of <Coordinates> is stored as a list of Google.KML.geAngle180, Google.KML.geAngle90 #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

   gePlaceMark pm = new (gePlaceMark();
   List<geCoordinates> Temp = new List<geCoordinates>();
   //populate Temp with a bunch of geCoordinates (built from geAngle90 and
      geAngle180
   geAngle90 Lat = new geAngle90(LatDeg);
   geAngle180 Lon = new geAngle180(LonDeg);
   Temp.Add(new geCoordinates(Lat, Lon));
   geOuterBoundaryIs outerBoundary = new geOuterBoundaryIs(new
      geLinearRing(CircleCoordinatesList));
   gePolygon polygon = new gePolygon(outerBoundary);
   pm.Geometry = polygon;
   //Finally, add the placemark to the document
   doc.Features.Add(pm);             

What is the expected output? What do you see instead?

Should see 
<coordinates> -122.19,56.273152841195,0 -121.90880344116,56.2714883167,0
-121.62775915015,56.266495684686,0, etc...

instead:
<Coordinates>Google.KML.geAngle180,Google.KML.geAngle90,0Google.KML.geAngle180,
etc...

What version of the product are you using? On what operating system?
March 16, 2010  XP

Please provide any additional information below.
Note that the comma delimiters are incorrect, too (0 before "Google").

Original issue reported on code.google.com by mowenW...@gmail.com on 7 Apr 2010 at 8:30

GoogleCodeExporter commented 9 years ago
I am also having this problem on Windows 7 using the binary dll version 
2.1.0.1. Here
is the code to reproduce:

geDocument doc = new geDocument();
List<geCoordinates> coords = new List<geCoordinates>();
coords.Add(new geCoordinates(new geAngle90(39), new geAngle180(-84)));
gePlacemark pm = new gePlacemark();
geLineString ls = new geLineString(coords);
ls.AltitudeMode = geAltitudeModeEnum.clampToGround;
pm.Geometry = ls;
pm.Name = "TestPM";
doc.Features.Add(pm);
geKML kml = new geKML(doc);
File.WriteAllBytes("C:\test.kml", kml.ToKML());

Original comment by CDWaddell on 9 May 2010 at 3:15

GoogleCodeExporter commented 9 years ago
FYI, it appears that you need to modify the first line of 
geCoordinates.ToTuple():
Change "string str = this.Longitude.ToString() + "," + 
this.Latitude.ToString();"
To "string str = this.Longitude.Value.ToString() + "," + 
this.Latitude.Value.ToString();"

the ToString() call is falling back to Object.ToString() which returns 
GetType();

Original comment by CDWaddell on 9 May 2010 at 5:05

GoogleCodeExporter commented 9 years ago
Hi,

I use KmLib to deserialized kml file, I use the C# version, but I met some 
problems.
I don't work to get values in some sections like :
<Placemark>
   <MultiGeometry MultiGeometry="">
      <Polygon>
         <tessellate>0</tessellate>
         <extrude>0</extrude>
         <altitudeMode>clampedToGround</altitudeMode>
         <outerBoundaryIs>
              <LinearRing>
                <coordinates>...</coordinates>
              </LinearRing>
            </outerBoundaryIs>
       </Polygon>
       <Polygon Polygon="">
         ...  
      </Polygon>
   </MultiGeometry>
</Placemark>

Somebody could help me, to get this value in C# ??
Another developper would help me, but he use C++ version version, and it looks 
easier, he use the function get_geometry_array_size
I don't know this functions, my conclusion is, yhe C++ version of KmLib is more 
complete than C# version.
In attacment, I have put a file which are use.
Thanks

Sincerely,

Laurent BROUCK

Original comment by laurent....@gmail.com on 2 Nov 2011 at 7:09

Attachments: