/* osgEarth
* Copyright 2025 Pelican Mapping
* MIT License
*/
#pragma once

#include <osgEarth/Common>
#include <osgEarth/Geometry>
#include <osgEarth/SpatialReference>

namespace osgEarth
{
    namespace GeometryUtils
    {
        extern OSGEARTH_EXPORT std::string geometryToWKT( const Geometry* geometry );
        extern OSGEARTH_EXPORT std::string geometryToIsoWKT( const Geometry* geometry );
        extern OSGEARTH_EXPORT Geometry*   geometryFromWKT( const std::string& wkt, bool rewindPolygons = true);

        extern OSGEARTH_EXPORT std::string geometryToGeoJSON( const Geometry* geometry, const SpatialReference* srs = nullptr );
        extern OSGEARTH_EXPORT Geometry*   geometryFromGeoJSON( const std::string& geojson, bool rewindPolygons = true);

        extern OSGEARTH_EXPORT std::string geometryToKML( const Geometry* geometry );
        extern OSGEARTH_EXPORT std::string geometryToGML( const Geometry* geometry );
        extern OSGEARTH_EXPORT double getGeometryArea( const Geometry* geometry );
    }

} // namespace osgEarth

