Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ports/osgearth/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Source: osgearth
Version: 3.0
Port-Version: 1
Homepage: https://github.com/gwaldron/osgearth
Description: osgEarth - Dynamic map generation toolkit for OpenSceneGraph Copyright 2015 Pelican Mapping.
Build-Depends: osg[plugins]
41 changes: 41 additions & 0 deletions ports/osgearth/fix-build-with-geos-3-8.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
diff --git a/src/osgEarth/GEOS.cpp b/src/osgEarth/GEOS.cpp
index 07da3fd..31f97ab 100644
--- a/src/osgEarth/GEOS.cpp
+++ b/src/osgEarth/GEOS.cpp
@@ -63,9 +63,13 @@ namespace
{
coords->push_back( coords->front() );
}
+#if GEOS_VERSION_AT_LEAST(3,8)
+ geom::CoordinateSequence::Ptr seq = factory->create(coords);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems wrong.
geom::CoordinateSequence::Ptr is a unique_ptr which will be released as soon as the context goes out of scope.
You will be returning a freed memory by returning seq.get()
seq.release would probably work but there might be a memory leak

+ return seq.get();
+#else
geom::CoordinateSequence* seq = factory->create( coords );
-
return seq;
+#endif
}

geom::Geometry*
@@ -141,12 +145,20 @@ namespace
if ( shell )
{
const Polygon* poly = static_cast<const Polygon*>(input);
+#if GEOS_VERSION_AT_LEAST(3,8)
+ std::vector<geom::LinearRing*>* holes = poly->getHoles().size() > 0 ? new std::vector<geom::LinearRing*>() : 0L;
+#else
std::vector<geom::Geometry*>* holes = poly->getHoles().size() > 0 ? new std::vector<geom::Geometry*>() : 0L;
+#endif
if (holes)
{
for( RingCollection::const_iterator r = poly->getHoles().begin(); r != poly->getHoles().end(); ++r )
{
- geom::Geometry* hole = import( r->get(), f );
+#if GEOS_VERSION_AT_LEAST(3,8)
+ geom::LinearRing* hole = dynamic_cast<geom::LinearRing*>(import( r->get(), f ));
+#else
+ geom::Geometry* hole = import(r->get(), f);
+#endif
if (hole)
{
if (hole->getGeometryTypeId() == geos::geom::GEOS_LINEARRING)
1 change: 1 addition & 0 deletions ports/osgearth/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
RocksDB.patch
fix-build-with-geos-3-8.patch # Remove this patch after https://github.com/gwaldron/osgearth/pull/1497 merge
)

vcpkg_configure_cmake(
Expand Down