SELECTED ANSWER
replied on October 13, 2020
With the Laserfiche.RepositoryAccess assembly, use Entry.GetGeographyData to retrieve and Entry.SetGeographyData to set it. Entry.GetGeographyData returns an EntryGeography object and you can use the Laserfiche.RepositoryAccess.Spatial.GeoConverter class to decode the coordinates:
EntryGeography geoData = Entry.GetGeographyData(entryId, session);
if (geoData != null && geoData.GeoObject != null && geoData.GeoObject.Length > 0)
{
// EntryGeography.GeoObject uses the WKB format (https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry)
var index = 4; // Skip WKB header and start on the geometry type byte
var decoded = GeoConverter.DecodeWkb(geoData.GeoObject, ref index);
if (decoded is Point2D)
{
Point2D point = (Point2D)decoded;
double latitude = point.P.Y;
double longitude = point.P.X;
}
}