georust / geos Goto Github PK
View Code? Open in Web Editor NEWRust bindings for GEOS
Home Page: https://docs.rs/geos/
License: MIT License
Rust bindings for GEOS
Home Page: https://docs.rs/geos/
License: MIT License
Currently the only way to use geos v3.12.1 is to use the static build but it would be nice to be able to dynamically link to a preinstalled build like we can with the other versions.
Would this be possible to add?
There is no point into making a conversion inside geos
, it should be done alongside or outside but not inside the compute_voronoi
function.
If/when georust/geos-sys#21 gets merged, please add a static
feature flag to proxy to geos-sys/static
.
I have a geometry representing a polygon, I want to iterate of the points in the exterior ring. I tried following the same approach as this question but it doesn't seem to work in rust.
The get_exterior_ring
function returns a ConstGeometry
of type LinearRing
. If I call get_num_points
on this geometry it returns an error
Err(
GenericError(
"Geometry must be a LineString",
),
)
let test_polygon: Polygon = Polygon::new(
LineString(vec![
Coord::from((4.9147899, 52.3735245)),
Coord::from((4.9148563, 52.3735048)),
Coord::from((4.9148865, 52.3735437)),
Coord::from((4.9148248, 52.3735613)),
Coord::from((4.9147899, 52.3735245)),
]),
vec![LineString(vec![])],
);
let geometry: geos::Geometry = (&test_polygon).try_into().unwrap();
let linear_ring: ConstGeometry = geometry.get_exterior_ring().unwrap();
dbg!(linear_ring.get_num_points().err());
Hi,
we've done some work on your repository to add a rust-geo conversion.
I think this project will have more visibility if it's moved to the GeoRust organisation.
Would you be willing to move it ?
else I can either:
If you agree to move this repository, I'll ask the GeoRust guys to add you in the GeoRust organisation
Thanks for your great work,
Antoine
I'd like to use some of the new features coming in GEOS 3.11, but the process for updating the raw C to Rust bindings isn't clear. Apologies if there is documentation or an issue or PR that demonstrates this; I couldn't find anything.
It looks like the sys/geos-src/source
points at a fairly recent commit of GEOS source tree, and can be updated via git submodules. Great!
However, it looks like the sys/check_missing/geos_c.h
is an old copy of capi/geos_c.h.in
from the GEOS source tree (includes template parameters for version numbers, etc), rather than the geos_c.h
produced during a build of GEOS. It seems like sys/check_missing/check_missing.py
should instead use the capi/geos_c.h.in
from the GEOS source tree instead of an old copy, or that when a new version of GEOS is bound, that the compiled geos_c.h
file (including version numbers) is added here instead.
It looks like sys/check_missing/check_missing.py
is used to identify functions available in geos_c.h
that haven't yet been bound into sys/src/functions.rs
. It isn't clear how entries are added there. Is this done manually? And then version-guarded using #[cfg(feature = "v<GEOS version that enables API>")]
? (and associated feature added to sys/Cargo.toml
). I'm assuming there is a good reason for doing so rather than using bindgen like in georust/gdal to pregenerate bindings for specific versions of GEOS.
Sorry if these have obvious answers; I'm pretty new to Rust so these weren't obvious to me.
error: failed to run custom build command for `geos-src v0.2.1 (/home/jayvdb/rust/geos/sys/geos-src)`
Caused by:
process didn't exit successfully: `/home/jayvdb/rust/geos/target/debug/build/geos-src-2ae16c31e7b1411f/build-script-build` (exit status: 101)
--- stdout
cargo:rerun-if-changed=build.rs
CMAKE_TOOLCHAIN_FILE_x86_64-unknown-linux-gnu = None
CMAKE_TOOLCHAIN_FILE_x86_64_unknown_linux_gnu = None
HOST_CMAKE_TOOLCHAIN_FILE = None
CMAKE_TOOLCHAIN_FILE = None
CMAKE_GENERATOR_x86_64-unknown-linux-gnu = None
CMAKE_GENERATOR_x86_64_unknown_linux_gnu = None
HOST_CMAKE_GENERATOR = None
CMAKE_GENERATOR = None
CMAKE_PREFIX_PATH_x86_64-unknown-linux-gnu = None
CMAKE_PREFIX_PATH_x86_64_unknown_linux_gnu = None
HOST_CMAKE_PREFIX_PATH = None
CMAKE_PREFIX_PATH = None
CMAKE_x86_64-unknown-linux-gnu = None
CMAKE_x86_64_unknown_linux_gnu = None
HOST_CMAKE = None
CMAKE = None
running: cd "/home/jayvdb/rust/geos/target/debug/build/geos-src-674cec5a58a81688/out/build" && CMAKE_PREFIX_PATH="" "cmake" "/home/jayvdb/rust/geos/sys/geos-src/source" "-DBUILD_BENCHMARKS=OFF" "-DBUILD_TESTING=OFF" "-DGEOS_ENABLE_TESTS=OFF" "-DBUILD_DOCUMENTATION=OFF" "-DCMAKE_INSTALL_LIBDIR=lib" "-DBUILD_SHARED_LIBS=OFF" "-DGEOS_BUILD_STATIC=ON" "-DGEOS_BUILD_SHARED=OFF" "-DCMAKE_INSTALL_PREFIX=/home/jayvdb/rust/geos/target/debug/build/geos-src-674cec5a58a81688/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=Release"
-- The C compiler identification is GNU 13.0.1
-- The CXX compiler identification is GNU 13.0.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- GEOS: Version 3.11.0
-- GEOS: C API Version 1.17.0
-- GEOS: JTS port 1.18.0
-- GEOS: Build type: Release
-- GEOS: Run-time output: /home/jayvdb/rust/geos/target/debug/build/geos-src-674cec5a58a81688/out/build/bin
-- GEOS: Archives output: /home/jayvdb/rust/geos/target/debug/build/geos-src-674cec5a58a81688/out/build/lib
-- GEOS: Require C++11
-- GEOS: Developer mode ENABLED
-- Looking for pow in m
-- Looking for pow in m - found
-- GEOS: Build geosop ON
-- GEOS: Build astyle OFF
-- GEOS: Configured 'dist' target
-- GEOS: Configured 'distcheck' target
-- Configuring done (0.3s)
-- Generating done (0.0s)
-- Build files have been written to: /home/jayvdb/rust/geos/target/debug/build/geos-src-674cec5a58a81688/out/build
running: cd "/home/jayvdb/rust/geos/target/debug/build/geos-src-674cec5a58a81688/out/build" && MAKEFLAGS="-j --jobserver-fds=18,19 --jobserver-auth=18,19" "cmake" "--build" "." "--target" "install" "--config" "Release"
[ 1%] Building C object src/deps/CMakeFiles/ryu.dir/ryu/d2s.c.o
[ 1%] Built target ryu
[ 1%] Building CXX object CMakeFiles/geos.dir/src/algorithm/BoundaryNodeRule.cpp.o
[ 1%] Building CXX object CMakeFiles/geos.dir/src/algorithm/Angle.cpp.o
[ 1%] Building CXX object CMakeFiles/geos.dir/src/algorithm/Area.cpp.o
[ 2%] Building CXX object CMakeFiles/geos.dir/src/algorithm/CGAlgorithmsDD.cpp.o
[ 2%] Building CXX object CMakeFiles/geos.dir/src/algorithm/Centroid.cpp.o
[ 2%] Building CXX object CMakeFiles/geos.dir/src/algorithm/ConvexHull.cpp.o
[ 2%] Building CXX object CMakeFiles/geos.dir/src/algorithm/Distance.cpp.o
[ 3%] Building CXX object CMakeFiles/geos.dir/src/algorithm/InteriorPointArea.cpp.o
[ 3%] Building CXX object CMakeFiles/geos.dir/src/algorithm/HCoordinate.cpp.o
[ 4%] Building CXX object CMakeFiles/geos.dir/src/algorithm/Intersection.cpp.o
[ 4%] Building CXX object CMakeFiles/geos.dir/src/algorithm/Length.cpp.o
[ 4%] Building CXX object CMakeFiles/geos.dir/src/algorithm/InteriorPointLine.cpp.o
[ 4%] Building CXX object CMakeFiles/geos.dir/src/algorithm/InteriorPointPoint.cpp.o
[ 4%] Building CXX object CMakeFiles/geos.dir/src/algorithm/MinimumBoundingCircle.cpp.o
[ 4%] Building CXX object CMakeFiles/geos.dir/src/algorithm/LineIntersector.cpp.o
[ 4%] Building CXX object CMakeFiles/geos.dir/src/algorithm/NotRepresentableException.cpp.o
[ 5%] Building CXX object CMakeFiles/geos.dir/src/algorithm/MinimumDiameter.cpp.o
[ 5%] Building CXX object CMakeFiles/geos.dir/src/algorithm/Orientation.cpp.o
[ 5%] Building CXX object CMakeFiles/geos.dir/src/algorithm/PointLocation.cpp.o
[ 6%] Building CXX object CMakeFiles/geos.dir/src/algorithm/PointLocator.cpp.o
[ 6%] Building CXX object CMakeFiles/geos.dir/src/algorithm/RayCrossingCounter.cpp.o
[ 6%] Building CXX object CMakeFiles/geos.dir/src/algorithm/RayCrossingCounterDD.cpp.o
[ 6%] Building CXX object CMakeFiles/geos.dir/src/algorithm/RobustDeterminant.cpp.o
[ 7%] Building CXX object CMakeFiles/geos.dir/src/algorithm/SimplePointInRing.cpp.o
[ 7%] Building CXX object CMakeFiles/geos.dir/src/algorithm/construct/LargestEmptyCircle.cpp.o
[ 7%] Building CXX object CMakeFiles/geos.dir/src/algorithm/construct/MaximumInscribedCircle.cpp.o
[ 7%] Building CXX object CMakeFiles/geos.dir/src/algorithm/distance/DiscreteFrechetDistance.cpp.o
[ 8%] Building CXX object CMakeFiles/geos.dir/src/algorithm/distance/DiscreteHausdorffDistance.cpp.o
[ 8%] Building CXX object CMakeFiles/geos.dir/src/algorithm/distance/DistanceToPoint.cpp.o
[ 8%] Building CXX object CMakeFiles/geos.dir/src/algorithm/hull/ConcaveHull.cpp.o
[ 8%] Building CXX object CMakeFiles/geos.dir/src/algorithm/hull/ConcaveHullOfPolygons.cpp.o
[ 9%] Building CXX object CMakeFiles/geos.dir/src/algorithm/hull/HullTri.cpp.o
[ 9%] Building CXX object CMakeFiles/geos.dir/src/algorithm/hull/HullTriangulation.cpp.o
[ 9%] Building CXX object CMakeFiles/geos.dir/src/algorithm/locate/IndexedPointInAreaLocator.cpp.o
[ 9%] Building CXX object CMakeFiles/geos.dir/src/algorithm/locate/PointOnGeometryLocator.cpp.o
[ 10%] Building CXX object CMakeFiles/geos.dir/src/algorithm/locate/SimplePointInAreaLocator.cpp.o
[ 10%] Building CXX object CMakeFiles/geos.dir/src/edgegraph/EdgeGraph.cpp.o
[ 10%] Building CXX object CMakeFiles/geos.dir/src/edgegraph/EdgeGraphBuilder.cpp.o
[ 10%] Building CXX object CMakeFiles/geos.dir/src/edgegraph/HalfEdge.cpp.o
[ 11%] Building CXX object CMakeFiles/geos.dir/src/edgegraph/MarkHalfEdge.cpp.o
[ 11%] Building CXX object CMakeFiles/geos.dir/src/geom/Coordinate.cpp.o
[ 11%] Building CXX object CMakeFiles/geos.dir/src/geom/CoordinateArraySequence.cpp.o
[ 11%] Building CXX object CMakeFiles/geos.dir/src/geom/CoordinateArraySequenceFactory.cpp.o
[ 12%] Building CXX object CMakeFiles/geos.dir/src/geom/CoordinateSequence.cpp.o
[ 12%] Building CXX object CMakeFiles/geos.dir/src/geom/DefaultCoordinateSequenceFactory.cpp.o
[ 12%] Building CXX object CMakeFiles/geos.dir/src/geom/Dimension.cpp.o
[ 12%] Building CXX object CMakeFiles/geos.dir/src/geom/Geometry.cpp.o
[ 13%] Building CXX object CMakeFiles/geos.dir/src/geom/Envelope.cpp.o
[ 13%] Building CXX object CMakeFiles/geos.dir/src/geom/GeometryCollection.cpp.o
[ 13%] Building CXX object CMakeFiles/geos.dir/src/geom/GeometryComponentFilter.cpp.o
[ 14%] Building CXX object CMakeFiles/geos.dir/src/geom/GeometryFactory.cpp.o
[ 14%] Building CXX object CMakeFiles/geos.dir/src/geom/HeuristicOverlay.cpp.o
[ 14%] Building CXX object CMakeFiles/geos.dir/src/geom/IntersectionMatrix.cpp.o
[ 15%] Building CXX object CMakeFiles/geos.dir/src/geom/LineSegment.cpp.o
[ 15%] Building CXX object CMakeFiles/geos.dir/src/geom/LineString.cpp.o
[ 15%] Building CXX object CMakeFiles/geos.dir/src/geom/LinearRing.cpp.o
[ 15%] Building CXX object CMakeFiles/geos.dir/src/geom/Location.cpp.o
[ 15%] Building CXX object CMakeFiles/geos.dir/src/geom/MultiLineString.cpp.o
[ 16%] Building CXX object CMakeFiles/geos.dir/src/geom/MultiPoint.cpp.o
[ 16%] Building CXX object CMakeFiles/geos.dir/src/geom/MultiPolygon.cpp.o
[ 16%] Building CXX object CMakeFiles/geos.dir/src/geom/Point.cpp.o
[ 16%] Building CXX object CMakeFiles/geos.dir/src/geom/Polygon.cpp.o
[ 17%] Building CXX object CMakeFiles/geos.dir/src/geom/Position.cpp.o
[ 17%] Building CXX object CMakeFiles/geos.dir/src/geom/PrecisionModel.cpp.o
[ 17%] Building CXX object CMakeFiles/geos.dir/src/geom/Quadrant.cpp.o
[ 17%] Building CXX object CMakeFiles/geos.dir/src/geom/Triangle.cpp.o
[ 18%] Building CXX object CMakeFiles/geos.dir/src/geom/prep/AbstractPreparedPolygonContains.cpp.o
[ 18%] Building CXX object CMakeFiles/geos.dir/src/geom/prep/BasicPreparedGeometry.cpp.o
[ 18%] Building CXX object CMakeFiles/geos.dir/src/geom/prep/PreparedGeometry.cpp.o
[ 18%] Building CXX object CMakeFiles/geos.dir/src/geom/prep/PreparedGeometryFactory.cpp.o
[ 19%] Building CXX object CMakeFiles/geos.dir/src/geom/prep/PreparedLineString.cpp.o
[ 19%] Building CXX object CMakeFiles/geos.dir/src/geom/prep/PreparedLineStringDistance.cpp.o
[ 19%] Building CXX object CMakeFiles/geos.dir/src/geom/prep/PreparedLineStringIntersects.cpp.o
[ 19%] Building CXX object CMakeFiles/geos.dir/src/geom/prep/PreparedLineStringNearestPoints.cpp.o
[ 20%] Building CXX object CMakeFiles/geos.dir/src/geom/prep/PreparedPoint.cpp.o
[ 20%] Building CXX object CMakeFiles/geos.dir/src/geom/prep/PreparedPolygon.cpp.o
[ 20%] Building CXX object CMakeFiles/geos.dir/src/geom/prep/PreparedPolygonContains.cpp.o
[ 20%] Building CXX object CMakeFiles/geos.dir/src/geom/prep/PreparedPolygonContainsProperly.cpp.o
[ 21%] Building CXX object CMakeFiles/geos.dir/src/geom/prep/PreparedPolygonCovers.cpp.o
[ 21%] Building CXX object CMakeFiles/geos.dir/src/geom/prep/PreparedPolygonDistance.cpp.o
[ 21%] Building CXX object CMakeFiles/geos.dir/src/geom/prep/PreparedPolygonIntersects.cpp.o
[ 21%] Building CXX object CMakeFiles/geos.dir/src/geom/prep/PreparedPolygonPredicate.cpp.o
[ 22%] Building CXX object CMakeFiles/geos.dir/src/geom/util/ComponentCoordinateExtracter.cpp.o
[ 22%] Building CXX object CMakeFiles/geos.dir/src/geom/util/CoordinateOperation.cpp.o
[ 22%] Building CXX object CMakeFiles/geos.dir/src/geom/util/Densifier.cpp.o
[ 22%] Building CXX object CMakeFiles/geos.dir/src/geom/util/GeometryCombiner.cpp.o
[ 23%] Building CXX object CMakeFiles/geos.dir/src/geom/util/GeometryEditor.cpp.o
[ 23%] Building CXX object CMakeFiles/geos.dir/src/geom/util/GeometryFixer.cpp.o
[ 23%] Building CXX object CMakeFiles/geos.dir/src/geom/util/GeometryMapper.cpp.o
[ 24%] Building CXX object CMakeFiles/geos.dir/src/geom/util/GeometryTransformer.cpp.o
[ 24%] Building CXX object CMakeFiles/geos.dir/src/geom/util/LinearComponentExtracter.cpp.o
[ 24%] Building CXX object CMakeFiles/geos.dir/src/geom/util/NoOpGeometryOperation.cpp.o
[ 24%] Building CXX object CMakeFiles/geos.dir/src/geom/util/PointExtracter.cpp.o
[ 25%] Building CXX object CMakeFiles/geos.dir/src/geom/util/PolygonExtracter.cpp.o
[ 25%] Building CXX object CMakeFiles/geos.dir/src/geom/util/ShortCircuitedGeometryVisitor.cpp.o
[ 25%] Building CXX object CMakeFiles/geos.dir/src/geom/util/SineStarFactory.cpp.o
[ 26%] Building CXX object CMakeFiles/geos.dir/src/geomgraph/DirectedEdge.cpp.o
[ 26%] Building CXX object CMakeFiles/geos.dir/src/geomgraph/Depth.cpp.o
[ 26%] Building CXX object CMakeFiles/geos.dir/src/geomgraph/DirectedEdgeStar.cpp.o
[ 26%] Building CXX object CMakeFiles/geos.dir/src/geomgraph/Edge.cpp.o
[ 26%] Building CXX object CMakeFiles/geos.dir/src/geomgraph/EdgeEnd.cpp.o
[ 27%] Building CXX object CMakeFiles/geos.dir/src/geomgraph/EdgeEndStar.cpp.o
[ 27%] Building CXX object CMakeFiles/geos.dir/src/geomgraph/EdgeIntersectionList.cpp.o
--- stderr
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_ASM_COMPILER
CMAKE_ASM_FLAGS
GEOS_BUILD_SHARED
GEOS_BUILD_STATIC
GEOS_ENABLE_TESTS
In file included from /home/jayvdb/rust/geos/sys/geos-src/source/src/geomgraph/Depth.cpp:23:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Depth.h:115:17: error: ‘uint8_t’ has not been declared
115 | bool isNull(uint8_t geomIndex) const
| ^~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Depth.h:120:17: error: ‘uint8_t’ has not been declared
120 | bool isNull(uint8_t geomIndex, uint8_t posIndex) const
| ^~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Depth.h:120:36: error: ‘uint8_t’ has not been declared
120 | bool isNull(uint8_t geomIndex, uint8_t posIndex) const
| ^~~~~~~
In file included from /home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:25,
from /home/jayvdb/rust/geos/sys/geos-src/source/src/geomgraph/Depth.cpp:24:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:143:52: error: ‘uint32_t’ has not been declared
143 | bool isEqualOnSide(const TopologyLocation& le, uint32_t locIndex) const
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:226:10: error: ‘uint8_t’ in namespace ‘std’ does not name a type; did you mean ‘wint_t’?
226 | std::uint8_t locationSize;
| ^~~~~~~
| wint_t
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In constructor ‘geos::geomgraph::TopologyLocation::TopologyLocation(geos::geom::Location, geos::geom::Location, geos::geom::Location)’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:82:11: error: class ‘geos::geomgraph::TopologyLocation’ does not have any field named ‘locationSize’
82 | : locationSize(3)
| ^~~~~~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In constructor ‘geos::geomgraph::TopologyLocation::TopologyLocation(geos::geom::Location)’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:90:11: error: class ‘geos::geomgraph::TopologyLocation’ does not have any field named ‘locationSize’
90 | : locationSize(1)
| ^~~~~~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In copy constructor ‘geos::geomgraph::TopologyLocation::TopologyLocation(const geos::geomgraph::TopologyLocation&)’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:98:11: error: class ‘geos::geomgraph::TopologyLocation’ does not have any field named ‘locationSize’
98 | , locationSize(gl.locationSize)
| ^~~~~~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:98:27: error: ‘const class geos::geomgraph::TopologyLocation’ has no member named ‘locationSize’; did you mean ‘location’?
98 | , locationSize(gl.locationSize)
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In member function ‘geos::geomgraph::TopologyLocation& geos::geomgraph::TopologyLocation::operator=(const geos::geomgraph::TopologyLocation&)’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:104:9: error: ‘locationSize’ was not declared in this scope; did you mean ‘location’?
104 | locationSize = gl.locationSize;
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:104:27: error: ‘const class geos::geomgraph::TopologyLocation’ has no member named ‘locationSize’; did you mean ‘location’?
104 | locationSize = gl.locationSize;
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In member function ‘geos::geom::Location geos::geomgraph::TopologyLocation::get(std::size_t) const’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:111:23: error: ‘locationSize’ was not declared in this scope; did you mean ‘location’?
111 | if(posIndex < locationSize) {
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In member function ‘bool geos::geomgraph::TopologyLocation::isNull() const’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:122:36: error: ‘locationSize’ was not declared in this scope; did you mean ‘location’?
122 | for(std::size_t i = 0; i < locationSize; ++i) {
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In member function ‘bool geos::geomgraph::TopologyLocation::isAnyNull() const’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:135:36: error: ‘locationSize’ was not declared in this scope; did you mean ‘location’?
135 | for(std::size_t i = 0; i < locationSize; ++i) {
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In member function ‘bool geos::geomgraph::TopologyLocation::isArea() const’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:150:16: error: ‘locationSize’ was not declared in this scope; did you mean ‘location’?
150 | return locationSize > 1;
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In member function ‘bool geos::geomgraph::TopologyLocation::isLine() const’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:155:16: error: ‘locationSize’ was not declared in this scope; did you mean ‘location’?
155 | return locationSize == 1;
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In member function ‘void geos::geomgraph::TopologyLocation::flip()’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:160:12: error: ‘locationSize’ was not declared in this scope; did you mean ‘location’?
160 | if(locationSize <= 1) {
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In member function ‘void geos::geomgraph::TopologyLocation::setAllLocationsIfNull(geos::geom::Location)’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:174:36: error: ‘locationSize’ was not declared in this scope; did you mean ‘location’?
174 | for(std::size_t i = 0; i < locationSize; ++i) {
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In member function ‘bool geos::geomgraph::TopologyLocation::allPositionsEqual(geos::geom::Location) const’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:206:36: error: ‘locationSize’ was not declared in this scope; did you mean ‘location’?
206 | for(std::size_t i = 0; i < locationSize; ++i) {
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h: At global scope:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:92:19: error: expected ‘)’ before ‘geomIndex’
92 | Label(uint32_t geomIndex, geom::Location onLoc)
| ~ ^~~~~~~~~~
| )
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:95:5: error: expected unqualified-id before ‘{’ token
95 | {
| ^
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:132:19: error: expected ‘)’ before ‘geomIndex’
132 | Label(uint32_t geomIndex, geom::Location onLoc, geom::Location leftLoc, geom::Location rightLoc)
| ~ ^~~~~~~~~~
| )
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:178:32: error: ‘uint32_t’ has not been declared
178 | geom::Location getLocation(uint32_t geomIndex, uint32_t posIndex) const
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:178:52: error: ‘uint32_t’ has not been declared
178 | geom::Location getLocation(uint32_t geomIndex, uint32_t posIndex) const
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:184:32: error: ‘uint32_t’ has not been declared
184 | geom::Location getLocation(uint32_t geomIndex) const
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:190:22: error: ‘uint32_t’ has not been declared
190 | void setLocation(uint32_t geomIndex, uint32_t posIndex, geom::Location location)
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:190:42: error: ‘uint32_t’ has not been declared
190 | void setLocation(uint32_t geomIndex, uint32_t posIndex, geom::Location location)
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:196:22: error: ‘uint32_t’ has not been declared
196 | void setLocation(uint32_t geomIndex, geom::Location location)
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:202:26: error: ‘uint32_t’ has not been declared
202 | void setAllLocations(uint32_t geomIndex, geom::Location location)
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:208:32: error: ‘uint32_t’ has not been declared
208 | void setAllLocationsIfNull(uint32_t geomIndex, geom::Location location)
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:220:17: error: ‘uint32_t’ has not been declared
220 | bool isNull(uint32_t geomIndex) const
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:231:20: error: ‘uint32_t’ has not been declared
231 | bool isAnyNull(uint32_t geomIndex) const
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:242:17: error: ‘uint32_t’ has not been declared
242 | bool isArea(uint32_t geomIndex) const
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:248:17: error: ‘uint32_t’ has not been declared
248 | bool isLine(uint32_t geomIndex) const
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:254:42: error: ‘uint32_t’ has not been declared
254 | bool isEqualOnSide(const Label& lbl, uint32_t side) const
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:260:28: error: ‘uint32_t’ has not been declared
260 | bool allPositionsEqual(uint32_t geomIndex, geom::Location loc) const
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:269:17: error: ‘uint32_t’ has not been declared
269 | void toLine(uint32_t geomIndex)
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h: In static member function ‘static geos::geomgraph::Label geos::geomgraph::Label::toLineLabel(const geos::geomgraph::Label&)’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:71:13: error: ‘uint32_t’ was not declared in this scope
71 | for(uint32_t i = 0; i < 2; i++) {
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:29:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
28 | #include <cassert>
+++ |+#include <cstdint>
29 |
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:71:29: error: ‘i’ was not declared in this scope
71 | for(uint32_t i = 0; i < 2; i++) {
| ^
/home/jayvdb/rust/geos/sys/geos-src/source/src/geomgraph/Depth.cpp: In member function ‘void geos::geomgraph::Depth::normalize()’:
/home/jayvdb/rust/geos/sys/geos-src/source/src/geomgraph/Depth.cpp:43:9: error: ‘uint8_t’ was not declared in this scope
43 | for(uint8_t i = 0; i < 2; i++) {
| ^~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/src/geomgraph/Depth.cpp:25:1: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
24 | #include <geos/geomgraph/Label.h>
+++ |+#include <cstdint>
25 | #include <geos/geom/Location.h>
/home/jayvdb/rust/geos/sys/geos-src/source/src/geomgraph/Depth.cpp:43:24: error: ‘i’ was not declared in this scope
43 | for(uint8_t i = 0; i < 2; i++) {
| ^
/home/jayvdb/rust/geos/sys/geos-src/source/src/geomgraph/Depth.cpp: In member function ‘void geos::geomgraph::Depth::add(const geos::geomgraph::Label&)’:
/home/jayvdb/rust/geos/sys/geos-src/source/src/geomgraph/Depth.cpp:66:9: error: ‘uint8_t’ was not declared in this scope
66 | for(uint8_t i = 0; i < 2; i++) {
| ^~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/src/geomgraph/Depth.cpp:66:9: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
/home/jayvdb/rust/geos/sys/geos-src/source/src/geomgraph/Depth.cpp:66:24: error: ‘i’ was not declared in this scope
66 | for(uint8_t i = 0; i < 2; i++) {
| ^
/home/jayvdb/rust/geos/sys/geos-src/source/src/geomgraph/Depth.cpp:67:20: error: expected ‘;’ before ‘j’
67 | for(uint8_t j = 1; j < 3; j++) {
| ^~
| ;
/home/jayvdb/rust/geos/sys/geos-src/source/src/geomgraph/Depth.cpp:67:28: error: ‘j’ was not declared in this scope
67 | for(uint8_t j = 1; j < 3; j++) {
| ^
gmake[2]: *** [CMakeFiles/geos.dir/build.make:1420: CMakeFiles/geos.dir/src/geomgraph/Depth.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
In file included from /home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:25,
from /home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/GraphComponent.h:26,
from /home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Edge.h:28,
from /home/jayvdb/rust/geos/sys/geos-src/source/src/geomgraph/DirectedEdge.cpp:21:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:143:52: error: ‘uint32_t’ has not been declared
143 | bool isEqualOnSide(const TopologyLocation& le, uint32_t locIndex) const
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:226:10: error: ‘uint8_t’ in namespace ‘std’ does not name a type; did you mean ‘wint_t’?
226 | std::uint8_t locationSize;
| ^~~~~~~
| wint_t
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In constructor ‘geos::geomgraph::TopologyLocation::TopologyLocation(geos::geom::Location, geos::geom::Location, geos::geom::Location)’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:82:11: error: class ‘geos::geomgraph::TopologyLocation’ does not have any field named ‘locationSize’
82 | : locationSize(3)
| ^~~~~~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In constructor ‘geos::geomgraph::TopologyLocation::TopologyLocation(geos::geom::Location)’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:90:11: error: class ‘geos::geomgraph::TopologyLocation’ does not have any field named ‘locationSize’
90 | : locationSize(1)
| ^~~~~~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In copy constructor ‘geos::geomgraph::TopologyLocation::TopologyLocation(const geos::geomgraph::TopologyLocation&)’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:98:11: error: class ‘geos::geomgraph::TopologyLocation’ does not have any field named ‘locationSize’
98 | , locationSize(gl.locationSize)
| ^~~~~~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:98:27: error: ‘const class geos::geomgraph::TopologyLocation’ has no member named ‘locationSize’; did you mean ‘location’?
98 | , locationSize(gl.locationSize)
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In member function ‘geos::geomgraph::TopologyLocation& geos::geomgraph::TopologyLocation::operator=(const geos::geomgraph::TopologyLocation&)’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:104:9: error: ‘locationSize’ was not declared in this scope; did you mean ‘location’?
104 | locationSize = gl.locationSize;
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:104:27: error: ‘const class geos::geomgraph::TopologyLocation’ has no member named ‘locationSize’; did you mean ‘location’?
104 | locationSize = gl.locationSize;
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In member function ‘geos::geom::Location geos::geomgraph::TopologyLocation::get(std::size_t) const’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:111:23: error: ‘locationSize’ was not declared in this scope; did you mean ‘location’?
111 | if(posIndex < locationSize) {
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In member function ‘bool geos::geomgraph::TopologyLocation::isNull() const’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:122:36: error: ‘locationSize’ was not declared in this scope; did you mean ‘location’?
122 | for(std::size_t i = 0; i < locationSize; ++i) {
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In member function ‘bool geos::geomgraph::TopologyLocation::isAnyNull() const’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:135:36: error: ‘locationSize’ was not declared in this scope; did you mean ‘location’?
135 | for(std::size_t i = 0; i < locationSize; ++i) {
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In member function ‘bool geos::geomgraph::TopologyLocation::isArea() const’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:150:16: error: ‘locationSize’ was not declared in this scope; did you mean ‘location’?
150 | return locationSize > 1;
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In member function ‘bool geos::geomgraph::TopologyLocation::isLine() const’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:155:16: error: ‘locationSize’ was not declared in this scope; did you mean ‘location’?
155 | return locationSize == 1;
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In member function ‘void geos::geomgraph::TopologyLocation::flip()’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:160:12: error: ‘locationSize’ was not declared in this scope; did you mean ‘location’?
160 | if(locationSize <= 1) {
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In member function ‘void geos::geomgraph::TopologyLocation::setAllLocationsIfNull(geos::geom::Location)’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:174:36: error: ‘locationSize’ was not declared in this scope; did you mean ‘location’?
174 | for(std::size_t i = 0; i < locationSize; ++i) {
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In member function ‘bool geos::geomgraph::TopologyLocation::allPositionsEqual(geos::geom::Location) const’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:206:36: error: ‘locationSize’ was not declared in this scope; did you mean ‘location’?
206 | for(std::size_t i = 0; i < locationSize; ++i) {
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h: At global scope:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:92:19: error: expected ‘)’ before ‘geomIndex’
92 | Label(uint32_t geomIndex, geom::Location onLoc)
| ~ ^~~~~~~~~~
| )
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:95:5: error: expected unqualified-id before ‘{’ token
95 | {
| ^
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:132:19: error: expected ‘)’ before ‘geomIndex’
132 | Label(uint32_t geomIndex, geom::Location onLoc, geom::Location leftLoc, geom::Location rightLoc)
| ~ ^~~~~~~~~~
| )
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:178:32: error: ‘uint32_t’ has not been declared
178 | geom::Location getLocation(uint32_t geomIndex, uint32_t posIndex) const
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:178:52: error: ‘uint32_t’ has not been declared
178 | geom::Location getLocation(uint32_t geomIndex, uint32_t posIndex) const
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:184:32: error: ‘uint32_t’ has not been declared
184 | geom::Location getLocation(uint32_t geomIndex) const
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:190:22: error: ‘uint32_t’ has not been declared
190 | void setLocation(uint32_t geomIndex, uint32_t posIndex, geom::Location location)
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:190:42: error: ‘uint32_t’ has not been declared
190 | void setLocation(uint32_t geomIndex, uint32_t posIndex, geom::Location location)
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:196:22: error: ‘uint32_t’ has not been declared
196 | void setLocation(uint32_t geomIndex, geom::Location location)
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:202:26: error: ‘uint32_t’ has not been declared
202 | void setAllLocations(uint32_t geomIndex, geom::Location location)
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:208:32: error: ‘uint32_t’ has not been declared
208 | void setAllLocationsIfNull(uint32_t geomIndex, geom::Location location)
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:220:17: error: ‘uint32_t’ has not been declared
220 | bool isNull(uint32_t geomIndex) const
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:231:20: error: ‘uint32_t’ has not been declared
231 | bool isAnyNull(uint32_t geomIndex) const
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:242:17: error: ‘uint32_t’ has not been declared
242 | bool isArea(uint32_t geomIndex) const
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:248:17: error: ‘uint32_t’ has not been declared
248 | bool isLine(uint32_t geomIndex) const
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:254:42: error: ‘uint32_t’ has not been declared
254 | bool isEqualOnSide(const Label& lbl, uint32_t side) const
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:260:28: error: ‘uint32_t’ has not been declared
260 | bool allPositionsEqual(uint32_t geomIndex, geom::Location loc) const
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:269:17: error: ‘uint32_t’ has not been declared
269 | void toLine(uint32_t geomIndex)
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h: In static member function ‘static geos::geomgraph::Label geos::geomgraph::Label::toLineLabel(const geos::geomgraph::Label&)’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:71:13: error: ‘uint32_t’ was not declared in this scope
71 | for(uint32_t i = 0; i < 2; i++) {
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:29:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
28 | #include <cassert>
+++ |+#include <cstdint>
29 |
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:71:29: error: ‘i’ was not declared in this scope
71 | for(uint32_t i = 0; i < 2; i++) {
| ^
In file included from /home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Edge.h:29:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Depth.h: At global scope:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Depth.h:115:17: error: ‘uint8_t’ has not been declared
115 | bool isNull(uint8_t geomIndex) const
| ^~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Depth.h:120:17: error: ‘uint8_t’ has not been declared
120 | bool isNull(uint8_t geomIndex, uint8_t posIndex) const
| ^~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Depth.h:120:36: error: ‘uint8_t’ has not been declared
120 | bool isNull(uint8_t geomIndex, uint8_t posIndex) const
| ^~~~~~~
In file included from /home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:25,
from /home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/GraphComponent.h:26,
from /home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Edge.h:28,
from /home/jayvdb/rust/geos/sys/geos-src/source/src/geomgraph/Edge.cpp:29:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:143:52: error: ‘uint32_t’ has not been declared
143 | bool isEqualOnSide(const TopologyLocation& le, uint32_t locIndex) const
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:226:10: error: ‘uint8_t’ in namespace ‘std’ does not name a type; did you mean ‘wint_t’?
226 | std::uint8_t locationSize;
| ^~~~~~~
| wint_t
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In constructor ‘geos::geomgraph::TopologyLocation::TopologyLocation(geos::geom::Location, geos::geom::Location, geos::geom::Location)’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:82:11: error: class ‘geos::geomgraph::TopologyLocation’ does not have any field named ‘locationSize’
82 | : locationSize(3)
| ^~~~~~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In constructor ‘geos::geomgraph::TopologyLocation::TopologyLocation(geos::geom::Location)’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:90:11: error: class ‘geos::geomgraph::TopologyLocation’ does not have any field named ‘locationSize’
90 | : locationSize(1)
| ^~~~~~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In copy constructor ‘geos::geomgraph::TopologyLocation::TopologyLocation(const geos::geomgraph::TopologyLocation&)’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:98:11: error: class ‘geos::geomgraph::TopologyLocation’ does not have any field named ‘locationSize’
98 | , locationSize(gl.locationSize)
| ^~~~~~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:98:27: error: ‘const class geos::geomgraph::TopologyLocation’ has no member named ‘locationSize’; did you mean ‘location’?
98 | , locationSize(gl.locationSize)
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In member function ‘geos::geomgraph::TopologyLocation& geos::geomgraph::TopologyLocation::operator=(const geos::geomgraph::TopologyLocation&)’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:104:9: error: ‘locationSize’ was not declared in this scope; did you mean ‘location’?
104 | locationSize = gl.locationSize;
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:104:27: error: ‘const class geos::geomgraph::TopologyLocation’ has no member named ‘locationSize’; did you mean ‘location’?
104 | locationSize = gl.locationSize;
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In member function ‘geos::geom::Location geos::geomgraph::TopologyLocation::get(std::size_t) const’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:111:23: error: ‘locationSize’ was not declared in this scope; did you mean ‘location’?
111 | if(posIndex < locationSize) {
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In member function ‘bool geos::geomgraph::TopologyLocation::isNull() const’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:122:36: error: ‘locationSize’ was not declared in this scope; did you mean ‘location’?
122 | for(std::size_t i = 0; i < locationSize; ++i) {
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In member function ‘bool geos::geomgraph::TopologyLocation::isAnyNull() const’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:135:36: error: ‘locationSize’ was not declared in this scope; did you mean ‘location’?
135 | for(std::size_t i = 0; i < locationSize; ++i) {
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In member function ‘bool geos::geomgraph::TopologyLocation::isArea() const’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:150:16: error: ‘locationSize’ was not declared in this scope; did you mean ‘location’?
150 | return locationSize > 1;
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In member function ‘bool geos::geomgraph::TopologyLocation::isLine() const’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:155:16: error: ‘locationSize’ was not declared in this scope; did you mean ‘location’?
155 | return locationSize == 1;
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In member function ‘void geos::geomgraph::TopologyLocation::flip()’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:160:12: error: ‘locationSize’ was not declared in this scope; did you mean ‘location’?
160 | if(locationSize <= 1) {
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In member function ‘void geos::geomgraph::TopologyLocation::setAllLocationsIfNull(geos::geom::Location)’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:174:36: error: ‘locationSize’ was not declared in this scope; did you mean ‘location’?
174 | for(std::size_t i = 0; i < locationSize; ++i) {
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h: In member function ‘bool geos::geomgraph::TopologyLocation::allPositionsEqual(geos::geom::Location) const’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/TopologyLocation.h:206:36: error: ‘locationSize’ was not declared in this scope; did you mean ‘location’?
206 | for(std::size_t i = 0; i < locationSize; ++i) {
| ^~~~~~~~~~~~
| location
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h: At global scope:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:92:19: error: expected ‘)’ before ‘geomIndex’
92 | Label(uint32_t geomIndex, geom::Location onLoc)
| ~ ^~~~~~~~~~
| )
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:95:5: error: expected unqualified-id before ‘{’ token
95 | {
| ^
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:132:19: error: expected ‘)’ before ‘geomIndex’
132 | Label(uint32_t geomIndex, geom::Location onLoc, geom::Location leftLoc, geom::Location rightLoc)
| ~ ^~~~~~~~~~
| )
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:178:32: error: ‘uint32_t’ has not been declared
178 | geom::Location getLocation(uint32_t geomIndex, uint32_t posIndex) const
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:178:52: error: ‘uint32_t’ has not been declared
178 | geom::Location getLocation(uint32_t geomIndex, uint32_t posIndex) const
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:184:32: error: ‘uint32_t’ has not been declared
184 | geom::Location getLocation(uint32_t geomIndex) const
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:190:22: error: ‘uint32_t’ has not been declared
190 | void setLocation(uint32_t geomIndex, uint32_t posIndex, geom::Location location)
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:190:42: error: ‘uint32_t’ has not been declared
190 | void setLocation(uint32_t geomIndex, uint32_t posIndex, geom::Location location)
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:196:22: error: ‘uint32_t’ has not been declared
196 | void setLocation(uint32_t geomIndex, geom::Location location)
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:202:26: error: ‘uint32_t’ has not been declared
202 | void setAllLocations(uint32_t geomIndex, geom::Location location)
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:208:32: error: ‘uint32_t’ has not been declared
208 | void setAllLocationsIfNull(uint32_t geomIndex, geom::Location location)
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:220:17: error: ‘uint32_t’ has not been declared
220 | bool isNull(uint32_t geomIndex) const
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:231:20: error: ‘uint32_t’ has not been declared
231 | bool isAnyNull(uint32_t geomIndex) const
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:242:17: error: ‘uint32_t’ has not been declared
242 | bool isArea(uint32_t geomIndex) const
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:248:17: error: ‘uint32_t’ has not been declared
248 | bool isLine(uint32_t geomIndex) const
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:254:42: error: ‘uint32_t’ has not been declared
254 | bool isEqualOnSide(const Label& lbl, uint32_t side) const
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:260:28: error: ‘uint32_t’ has not been declared
260 | bool allPositionsEqual(uint32_t geomIndex, geom::Location loc) const
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:269:17: error: ‘uint32_t’ has not been declared
269 | void toLine(uint32_t geomIndex)
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h: In static member function ‘static geos::geomgraph::Label geos::geomgraph::Label::toLineLabel(const geos::geomgraph::Label&)’:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:71:13: error: ‘uint32_t’ was not declared in this scope
71 | for(uint32_t i = 0; i < 2; i++) {
| ^~~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:29:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
28 | #include <cassert>
+++ |+#include <cstdint>
29 |
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Label.h:71:29: error: ‘i’ was not declared in this scope
71 | for(uint32_t i = 0; i < 2; i++) {
| ^
In file included from /home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Edge.h:29:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Depth.h: At global scope:
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Depth.h:115:17: error: ‘uint8_t’ has not been declared
115 | bool isNull(uint8_t geomIndex) const
| ^~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Depth.h:120:17: error: ‘uint8_t’ has not been declared
120 | bool isNull(uint8_t geomIndex, uint8_t posIndex) const
| ^~~~~~~
/home/jayvdb/rust/geos/sys/geos-src/source/include/geos/geomgraph/Depth.h:120:36: error: ‘uint8_t’ has not been declared
120 | bool isNull(uint8_t geomIndex, uint8_t posIndex) const
| ^~~~~~~
gmake[2]: *** [CMakeFiles/geos.dir/build.make:1434: CMakeFiles/geos.dir/src/geomgraph/DirectedEdge.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/geos.dir/build.make:1462: CMakeFiles/geos.dir/src/geomgraph/Edge.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:226: CMakeFiles/geos.dir/all] Error 2
gmake: *** [Makefile:156: all] Error 2
thread 'main' panicked at '
command did not execute successfully, got: exit status: 2
build script failed, must exit now', /home/jayvdb/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.49/src/lib.rs:1104:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
It would be very helpful if new tags were created for each new crate version.
https://github.com/georust/geos/tags atm only has 2.0.2
👋 Hi @GuillaumeGomez and @antoine-de, you two are the only "user-owners" of the geos crate on crates.io, so only you can edit that crate's owners on crates.io.
Following up on georust/meta#21, I created a new geos-publishers team for publishing to crates.io with you as maintainer.
Could you please update the crate owners? Specifically:
cd geos
# 💥 remove large publishing team
cargo owner --remove github:georust:core
# 🔐 add small publishing team
cargo owner --add github:georust:geos-publishers
# make sure everything looks good 👀
cargo owner --list
cd geos
# 💥 geos-sys didn't have the georust/core team as a team-owner
# 🔐 add small publishing team (assuming you'd prefer to share a publishing team between geos and geos-sys crates)
cargo owner --add github:georust:geos-publishers
# 🚨 @GuillaumeGomez: note that you are the *sole* user-owner of the geos-sys crate.
# Consider adding another user-owner so that someone can still update the crate owners if you become inaccessible. Maybe @antoine-de?
cargo owner --add antoine-de
# make sure everything looks good 👀
cargo owner --list
If there's anyone else you'd like to be able to publish the crates, feel free to add them to your publishing team, or as a user-owner. Consider that user-owners, as opposed to owners-via-team, can themselves edit the crate's owners, which could be desirable, or not, depending.
Once you switch the publishing team, no one else will be able to publish until either they are added to the new publishing team or added as a user-owner.
Let me know if you have any questions, or you can review georust/meta#21.
Any function that dereference a raw pointer, or allow to, later, dereference a raw pointer, must be tagged unsafe. As a side effect, almost all the function taking a raw pointer as a parameter must be tagged unsafe.
Some such functions:
GGeom::new_from_c_obj
CoordSeq::new_from_c_obj
This has been occurring for quite a long time, so raising an issue to ensure it is either fixed, or the test runner enhanced to ignore the known problems.
https://github.com/georust/geos/actions/runs/7817187602/job/21324473886
find ./target/debug/deps -name "geos*" -type f -executable | xargs -n 1 valgrind --leak-check=full --error-exitcode=42 --show-leak-kinds=all
==14626== Memcheck, a memory error detector
==14626== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==14626== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==14626== Command: ./target/debug/deps/geos-329262b61c72c019
==14626==
==14626== Syscall param statx(file_name) points to unaddressable byte(s)
==14626== at 0x4B33AAE: statx (statx.c:29)
==14626== by 0x229188: statx (weak.rs:176)
==14626== by 0x229188: std::sys::unix::fs::try_statx (fs.rs:161)
==14626== by 0x21A892: file_attr (fs.rs:955)
==14626== by 0x21A892: metadata (fs.rs:550)
==14626== by 0x21A892: std::fs::buffer_capacity_required (fs.rs:718)
==14626== by 0x21827F: read_to_end (fs.rs:746)
==14626== by 0x21827F: quota (thread.rs:441)
==14626== by 0x21827F: available_parallelism (thread.rs:312)
==14626== by 0x21827F: std::thread::available_parallelism (mod.rs:1653)
==14626== by 0x1C6C63: test::helpers::concurrency::get_concurrency (concurrency.rs:12)
==14626== by 0x1BD0A8: call_once<fn() -> usize, ()> (function.rs:248)
==14626== by 0x1BD0A8: unwrap_or_else<usize, fn() -> usize> (option.rs:825)
==14626== by 0x1BD0A8: test::console::run_tests_console (console.rs:269)
==14626== by 0x1D24F7: test::test_main (alloc.rs:[11](https://github.com/georust/geos/actions/runs/7817187602/job/21324473886#step:15:12)3)
==14626== by 0x1D3473: test::test_main_static (lib.rs:132)
==14626== by 0x1873B2: geos::main (lib.rs:1)
==14626== by 0x14378A: core::ops::function::FnOnce::call_once (function.rs:248)
==14626== by 0x19238D: std::sys_common::backtrace::__rust_begin_short_backtrace (backtrace.rs:[12](https://github.com/georust/geos/actions/runs/7817187602/job/21324473886#step:15:13)2)
==14626== by 0x17D8B0: std::rt::lang_start::{{closure}} (rt.rs:166)
==14626== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==14626==
==14626== Syscall param statx(buf) points to unaddressable byte(s)
==14626== at 0x4B33AAE: statx (statx.c:29)
==14626== by 0x229188: statx (weak.rs:176)
==14626== by 0x229188: std::sys::unix::fs::try_statx (fs.rs:161)
==14626== by 0x21A892: file_attr (fs.rs:955)
==14626== by 0x21A892: metadata (fs.rs:550)
==14626== by 0x21A892: std::fs::buffer_capacity_required (fs.rs:718)
==14626== by 0x21827F: read_to_end (fs.rs:746)
==14626== by 0x21827F: quota (thread.rs:441)
==14626== by 0x21827F: available_parallelism (thread.rs:312)
==14626== by 0x21827F: std::thread::available_parallelism (mod.rs:1653)
==14626== by 0x1C6C63: test::helpers::concurrency::get_concurrency (concurrency.rs:12)
==14626== by 0x1BD0A8: call_once<fn() -> usize, ()> (function.rs:248)
==14626== by 0x1BD0A8: unwrap_or_else<usize, fn() -> usize> (option.rs:825)
==14626== by 0x1BD0A8: test::console::run_tests_console (console.rs:269)
==14626== by 0x1D24F7: test::test_main (alloc.rs:1[13](https://github.com/georust/geos/actions/runs/7817187602/job/21324473886#step:15:14))
==[14](https://github.com/georust/geos/actions/runs/7817187602/job/21324473886#step:15:15)626== by 0x1D3473: test::test_main_static (lib.rs:132)
==14626== by 0x1873B2: geos::main (lib.rs:1)
==14626== by 0x14378A: core::ops::function::FnOnce::call_once (function.rs:248)
==14626== by 0x19238D: std::sys_common::backtrace::__rust_begin_short_backtrace (backtrace.rs:122)
==14626== by 0x17D8B0: std::rt::lang_start::{{closure}} (rt.rs:166)
==14626== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==14626==
running 47 tests
test from_geo::test::closed_2_points_linear_ring ... ok
test from_geo::test::good_linear_ring ... ok
test from_geo::test::incorrect_multipolygon_test ... ok
test from_geo::test::empty_linear_ring ... ok
test from_geo::test::incorrect_polygon_not_closed ... ok
test from_geo::test::multipolygon_contains_test ... ok
test from_geo::test::polygon_contains_test ... ok
test from_geo::test::one_elt_linear_ring ... ok
test from_geo::test::test_conversion_multilinestring ... ok
test from_geo::test::test_conversion_multipoint ... ok
test from_geo::test::unclosed_linear_ring ... ok
test from_geo::test::two_elt_linear_ring ... ok
test from_geojson::test::geom_from_geojson_geometry_collection ... ok
test from_geojson::test::geom_from_geojson_line ... ok
test from_geojson::test::geom_from_geojson_multiline ... ok
test from_geojson::test::geom_from_geojson_multipoint ... ok
test from_geojson::test::geom_from_geojson_multipolygon ... ok
test from_geojson::test::geom_from_geojson_polygon ... ok
test from_geojson::test::geom_from_geojson_polygon_with_unclosed_interior_ring ... ok
test functions::test::check_geos_predicate_err_test ... ok
test from_geojson::test::geom_from_geojson_point ... ok
test functions::test::check_geos_predicate_ko_test ... ok
test functions::test::check_geos_predicate_ok_test ... ok
test spatial_index::test::test_strtree ... ok
test test::test_geom_creation_from_geoms ... ok
test test::test_error_multi_from_vec_single ... ok
test test::test_geometrycollection_from_vec_geometry ... ok
test test::test_get_geometry_n ... ok
test test::test_multilinestring_from_vec_single ... ok
test test::test_multipoint_from_vec_single ... ok
test test::test_multipolygon_from_vec_single ... ok
test test::test_prepared_geoms ... ok
test test::test_relationship ... ok
test test::test_wkt_rounding_precision ... ok
test to_geo::test::geom_to_geo_multipoint ... ok
test to_geojson::test::geom_to_geojson_line ... ok
test to_geojson::test::geom_to_geojson_linearring ... ok
test to_geo::test::geom_to_geo_polygon ... ok
test to_geojson::test::geom_to_geojson_geometry_collection ... ok
test to_geojson::test::geom_to_geojson_multiline ... ok
test to_geojson::test::geom_to_geojson_multipolygon ... ok
test to_geojson::test::geom_to_geojson_point ... ok
test to_geojson::test::geom_to_geojson_polygon ... ok
test to_geojson::test::geom_to_geojson_multipoint ... ok
test voronoi::test::geo_voronoi ... ok
test voronoi::test::wkt_voronoi_precision ... ok
test voronoi::test::simple_voronoi ... ok
test result: ok. 47 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.16s
==14626==
==14626== HEAP SUMMARY:
==14626== in use at exit: 56 bytes in 2 blocks
==14626== total heap usage: 13,271 allocs, 13,269 frees, 1,011,084 bytes allocated
==14626==
==14626== 16 bytes in 1 blocks are still reachable in loss record 1 of 2
==14626== at 0x483BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==14626== by 0x4CEBD42: geos::geom::GeometryFactory::GeometryFactory() (in /usr/local/lib/libgeos.so.3.6.5)
==14626== by 0x4CEDF8C: geos::geom::GeometryFactory::getDefaultInstance() (in /usr/local/lib/libgeos.so.3.6.5)
==14626== by 0x4867306: GEOS_init_r (in /usr/local/lib/libgeos_c.so.1.10.5)
==14626== by 0x1385AE: geos::context_handle::ContextHandle::init_e (context_handle.rs:95)
==14626== by 0x19E680: geos::coord_seq::CoordSeq::new (coord_seq.rs:64)
==14626== by 0x141879: geos::from_geo::create_coord_seq (from_geo.rs:22)
==14626== by 0x13062A: geos::from_geo::<impl core::convert::TryFrom<geos::from_geo::LineRing> for geos::geometry::Geometry>::try_from (from_geo.rs:147)
==14626== by 0x141025: <T as core::convert::TryInto<U>>::try_into (mod.rs:593)
==14626== by 0x19BA6D: geos::from_geo::test::closed_2_points_linear_ring (from_geo.rs:367)
==14626== by 0x169539: geos::from_geo::test::closed_2_points_linear_ring::{{closure}} (from_geo.rs:365)
==14626== by 0x14328D: core::ops::function::FnOnce::call_once (function.rs:248)
==14626==
==14626== 40 bytes in 1 blocks are still reachable in loss record 2 of 2
==14626== at 0x483BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==14626== by 0x4CEDF81: geos::geom::GeometryFactory::getDefaultInstance() (in /usr/local/lib/libgeos.so.3.6.5)
==14626== by 0x4867306: GEOS_init_r (in /usr/local/lib/libgeos_c.so.1.10.5)
==14626== by 0x1385AE: geos::context_handle::ContextHandle::init_e (context_handle.rs:95)
==14626== by 0x19E680: geos::coord_seq::CoordSeq::new (coord_seq.rs:64)
==14626== by 0x141879: geos::from_geo::create_coord_seq (from_geo.rs:22)
==14626== by 0x13062A: geos::from_geo::<impl core::convert::TryFrom<geos::from_geo::LineRing> for geos::geometry::Geometry>::try_from (from_geo.rs:147)
==14626== by 0x141025: <T as core::convert::TryInto<U>>::try_into (mod.rs:593)
==14626== by 0x19BA6D: geos::from_geo::test::closed_2_points_linear_ring (from_geo.rs:367)
==14626== by 0x169539: geos::from_geo::test::closed_2_points_linear_ring::{{closure}} (from_geo.rs:365)
==14626== by 0x14328D: core::ops::function::FnOnce::call_once (function.rs:248)
==14626== by 0x1DD792: call_once<fn(), ()> (function.rs:248)
==14626== by 0x1DD792: test::__rust_begin_short_backtrace (lib.rs:572)
==14626==
==14626== LEAK SUMMARY:
==14626== definitely lost: 0 bytes in 0 blocks
==14626== indirectly lost: 0 bytes in 0 blocks
==14626== possibly lost: 0 bytes in 0 blocks
==14626== still reachable: 56 bytes in 2 blocks
==14626== suppressed: 0 bytes in 0 blocks
==14626==
==14626== For lists of detected and suppressed errors, rerun with: -s
==14626== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
==14674== Memcheck, a memory error detector
==14674== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==14674== Using Valgrind-3.[15](https://github.com/georust/geos/actions/runs/7817187602/job/21324473886#step:15:16).0 and LibVEX; rerun with -h for copyright info
==14674== Command: ./target/debug/deps/geos-0992edceede136[16](https://github.com/georust/geos/actions/runs/7817187602/job/21324473886#step:15:17)
==14674==
==14674== Syscall param statx(file_name) points to unaddressable byte(s)
==14674== at 0x4B33AAE: statx (statx.c:29)
==14674== by 0x1A2D48: statx (weak.rs:[17](https://github.com/georust/geos/actions/runs/7817187602/job/21324473886#step:15:18)6)
==14674== by 0x1A2D48: std::sys::unix::fs::try_statx (fs.rs:161)
==14674== by 0x194452: file_attr (fs.rs:955)
==14674== by 0x194452: metadata (fs.rs:550)
==14674== by 0x194452: std::fs::buffer_capacity_required (fs.rs:7[18](https://github.com/georust/geos/actions/runs/7817187602/job/21324473886#step:15:19))
==14674== by 0x[19](https://github.com/georust/geos/actions/runs/7817187602/job/21324473886#step:15:20)1E3F: read_to_end (fs.rs:746)
==14674== by 0x191E3F: quota (thread.rs:441)
==14674== by 0x191E3F: available_parallelism (thread.rs:312)
==14674== by 0x191E3F: std::thread::available_parallelism (mod.rs:1653)
==14674== by 0x15D5C3: test::helpers::concurrency::get_concurrency (concurrency.rs:12)
==14674== by 0x153A08: call_once<fn() -> usize, ()> (function.rs:248)
==14674== by 0x153A08: unwrap_or_else<usize, fn() -> usize> (option.rs:825)
==14674== by 0x153A08: test::console::run_tests_console (console.rs:269)
==14674== by 0x168E57: test::test_main (alloc.rs:113)
==14674== by 0x169DD3: test::test_main_static (lib.rs:132)
==14674== by 0x137942: geos::main (lib.rs:1)
==14674== by 0x134A7A: core::ops::function::FnOnce::call_once (function.rs:248)
==14674== by 0x1[20](https://github.com/georust/geos/actions/runs/7817187602/job/21324473886#step:15:21)3CD: std::sys_common::backtrace::__rust_begin_short_backtrace (backtrace.rs:1[22](https://github.com/georust/geos/actions/runs/7817187602/job/21324473886#step:15:23))
==14674== by 0x137380: std::rt::lang_start::{{closure}} (rt.rs:166)
==14674== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==14674==
==14674== Syscall param statx(buf) points to unaddressable byte(s)
==14674== at 0x4B33AAE: statx (statx.c:29)
==14674== by 0x1A2D48: statx (weak.rs:176)
==14674== by 0x1A2D48: std::sys::unix::fs::try_statx (fs.rs:161)
==14674== by 0x194452: file_attr (fs.rs:955)
==14674== by 0x194452: metadata (fs.rs:550)
==14674== by 0x194452: std::fs::buffer_capacity_required (fs.rs:718)
==14674== by 0x191E3F: read_to_end (fs.rs:746)
==14674== by 0x191E3F: quota (thread.rs:441)
==14674== by 0x191E3F: available_parallelism (thread.rs:312)
==14674== by 0x191E3F: std::thread::available_parallelism (mod.rs:1653)
==14674== by 0x15D5C3: test::helpers::concurrency::get_concurrency (concurrency.rs:12)
==14674== by 0x153A08: call_once<fn() -> usize, ()> (function.rs:[24](https://github.com/georust/geos/actions/runs/7817187602/job/21324473886#step:15:25)8)
==14674== by 0x153A08: unwrap_or_else<usize, fn() -> usize> (option.rs:8[25](https://github.com/georust/geos/actions/runs/7817187602/job/21324473886#step:15:26))
==14674== by 0x153A08: test::console::run_tests_console (console.rs:[26](https://github.com/georust/geos/actions/runs/7817187602/job/21324473886#step:15:27)9)
==14674== by 0x168E57: test::test_main (alloc.rs:113)
==14674== by 0x169DD3: test::test_main_static (lib.rs:132)
==14674== by 0x137942: geos::main (lib.rs:1)
==14674== by 0x134A7A: core::ops::function::FnOnce::call_once (function.rs:248)
==14674== by 0x1203CD: std::sys_common::backtrace::__rust_begin_short_backtrace (backtrace.rs:122)
==14674== by 0x137380: std::rt::lang_start::{{closure}} (rt.rs:166)
==14674== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==14674==
running 14 tests
test functions::test::check_geos_predicate_err_test ... ok
test spatial_index::test::test_strtree ... ok
test functions::test::check_geos_predicate_ko_test ... ok
test functions::test::check_geos_predicate_ok_test ... ok
test test::test_error_multi_from_vec_single ... ok
test test::test_geom_creation_from_geoms ... ok
test test::test_get_geometry_n ... ok
test test::test_multilinestring_from_vec_single ... ok
test test::test_geometrycollection_from_vec_geometry ... ok
test test::test_multipoint_from_vec_single ... ok
test test::test_multipolygon_from_vec_single ... ok
test test::test_prepared_geoms ... ok
test test::test_relationship ... ok
test test::test_wkt_rounding_precision ... ok
test result: ok. 14 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.58s
==14674==
==14674== HEAP SUMMARY:
==14674== in use at exit: 56 bytes in 2 blocks
==14674== total heap usage: 2,632 allocs, 2,630 frees, 303,076 bytes allocated
==14674==
==14674== 16 bytes in 1 blocks are still reachable in loss record 1 of 2
==14674== at 0x483BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==14674== by 0x4CEBD42: geos::geom::GeometryFactory::GeometryFactory() (in /usr/local/lib/libgeos.so.3.6.5)
==14674== by 0x4CEDF8C: geos::geom::GeometryFactory::getDefaultInstance() (in /usr/local/lib/libgeos.so.3.6.5)
==14674== by 0x4867306: GEOS_init_r (in /usr/local/lib/libgeos_c.so.1.10.5)
==14674== by 0x12614E: geos::context_handle::ContextHandle::init_e (context_handle.rs:95)
==14674== by 0x13400E: geos::spatial_index::STRtree<I>::with_capacity (spatial_index.rs:26)
==14674== by 0x133968: geos::spatial_index::test::test_strtree (spatial_index.rs:149)
==14674== by 0x12CB69: geos::spatial_index::test::test_strtree::{{closure}} (spatial_index.rs:148)
==14674== by 0x13499D: core::ops::function::FnOnce::call_once (function.rs:248)
==14674== by 0x1740F2: call_once<fn(), ()> (function.rs:248)
==14674== by 0x1740F2: test::__rust_begin_short_backtrace (lib.rs:572)
==14674== by 0x172DCF: call_once<(), (dyn core::ops::function::FnOnce<(), Output=()> + core::marker::Send), alloc::alloc::Global> (boxed.rs:1940)
==14674== by 0x172DCF: call_once<(), alloc::boxed::Box<(dyn core::ops::function::FnOnce<(), Output=()> + core::marker::Send), alloc::alloc::Global>> (unwind_safe.rs:[27](https://github.com/georust/geos/actions/runs/7817187602/job/21324473886#step:15:28)1)
==14674== by 0x172DCF: do_call<core::panic::unwind_safe::AssertUnwindSafe<alloc::boxed::Box<(dyn core::ops::function::FnOnce<(), Output=()> + core::marker::Send), alloc::alloc::Global>>, ()> (panicking.rs:492)
==14674== by 0x172DCF: try<(), core::panic::unwind_safe::AssertUnwindSafe<alloc::boxed::Box<(dyn core::ops::function::FnOnce<(), Output=()> + core::marker::Send), alloc::alloc::Global>>> (panicking.rs:456)
==14674== by 0x172DCF: catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<alloc::boxed::Box<(dyn core::ops::function::FnOnce<(), Output=()> + core::marker::Send), alloc::alloc::Global>>, ()> (panic.rs:137)
==14674== by 0x172DCF: run_test_in_process (lib.rs:595)
==14674== by 0x172DCF: test::run_test::run_test_inner::{{closure}} (lib.rs:489)
==14674== by 0x13E413: {closure#1} (lib.rs:516)
==14674== by 0x13E413: std::sys_common::backtrace::__rust_begin_short_backtrace (backtrace.rs:122)
==14674==
==14674== 40 bytes in 1 blocks are still reachable in loss record 2 of 2
==14674== at 0x483BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==14674== by 0x4CEDF81: geos::geom::GeometryFactory::getDefaultInstance() (in /usr/local/lib/libgeos.so.3.6.5)
==14674== by 0x4867[30](https://github.com/georust/geos/actions/runs/7817187602/job/21324473886#step:15:31)6: GEOS_init_r (in /usr/local/lib/libgeos_c.so.1.10.5)
==14674== by 0x12614E: geos::context_handle::ContextHandle::init_e (context_handle.rs:95)
==14674== by 0x13400E: geos::spatial_index::STRtree<I>::with_capacity (spatial_index.rs:26)
==14674== by 0x1[33](https://github.com/georust/geos/actions/runs/7817187602/job/21324473886#step:15:34)968: geos::spatial_index::test::test_strtree (spatial_index.rs:149)
==14674== by 0x12CB69: geos::spatial_index::test::test_strtree::{{closure}} (spatial_index.rs:148)
==14674== by 0x1[34](https://github.com/georust/geos/actions/runs/7817187602/job/21324473886#step:15:35)99D: core::ops::function::FnOnce::call_once (function.rs:248)
==14674== by 0x1740F2: call_once<fn(), ()> (function.rs:248)
==14674== by 0x1740F2: test::__rust_begin_short_backtrace (lib.rs:572)
==14674== by 0x172DCF: call_once<(), (dyn core::ops::function::FnOnce<(), Output=()> + core::marker::Send), alloc::alloc::Global> (boxed.rs:1940)
==14674== by 0x172DCF: call_once<(), alloc::boxed::Box<(dyn core::ops::function::FnOnce<(), Output=()> + core::marker::Send), alloc::alloc::Global>> (unwind_safe.rs:271)
==14674== by 0x172DCF: do_call<core::panic::unwind_safe::AssertUnwindSafe<alloc::boxed::Box<(dyn core::ops::function::FnOnce<(), Output=()> + core::marker::Send), alloc::alloc::Global>>, ()> (panicking.rs:492)
==14674== by 0x172DCF: try<(), core::panic::unwind_safe::AssertUnwindSafe<alloc::boxed::Box<(dyn core::ops::function::FnOnce<(), Output=()> + core::marker::Send), alloc::alloc::Global>>> (panicking.rs:456)
==14674== by 0x172DCF: catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<alloc::boxed::Box<(dyn core::ops::function::FnOnce<(), Output=()> + core::marker::Send), alloc::alloc::Global>>, ()> (panic.rs:1[37](https://github.com/georust/geos/actions/runs/7817187602/job/21324473886#step:15:38))
==14674== by 0x172DCF: run_test_in_process (lib.rs:595)
==14674== by 0x172DCF: test::run_test::run_test_inner::{{closure}} (lib.rs:489)
==14674== by 0x13E[41](https://github.com/georust/geos/actions/runs/7817187602/job/21324473886#step:15:42)3: {closure#1} (lib.rs:516)
==14674== by 0x13E413: std::sys_common::backtrace::__rust_begin_short_backtrace (backtrace.rs:122)
==14674== by 0x1[43](https://github.com/georust/geos/actions/runs/7817187602/job/21324473886#step:15:44)C66: {closure#0}<test::run_test::run_test_inner::{closure_env#1}, ()> (mod.rs:514)
==14674== by 0x143C66: call_once<(), std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<test::run_test::run_test_inner::{closure_env#1}, ()>> (unwind_safe.rs:271)
==14674== by 0x143C66: do_call<core::panic::unwind_safe::AssertUnwindSafe<std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<test::run_test::run_test_inner::{closure_env#1}, ()>>, ()> (panicking.rs:492)
==14674== by 0x143C66: try<(), core::panic::unwind_safe::AssertUnwindSafe<std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<test::run_test::run_test_inner::{closure_env#1}, ()>>> (panicking.rs:[45](https://github.com/georust/geos/actions/runs/7817187602/job/21324473886#step:15:46)6)
==1[46](https://github.com/georust/geos/actions/runs/7817187602/job/21324473886#step:15:47)74== by 0x143C66: catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<test::run_test::run_test_inner::{closure_env#1}, ()>>, ()> (panic.rs:137)
==14674== by 0x143C66: {closure#1}<test::run_test::run_test_inner::{closure_env#1}, ()> (mod.rs:513)
==14674== by 0x143C66: core::ops::function::FnOnce::call_once{{vtable-shim}} (function.rs:2[48](https://github.com/georust/geos/actions/runs/7817187602/job/21324473886#step:15:49))
==14674==
==14674== LEAK SUMMARY:
==14674== definitely lost: 0 bytes in 0 blocks
==14674== indirectly lost: 0 bytes in 0 blocks
==14674== possibly lost: 0 bytes in 0 blocks
==14674== still reachable: [56](https://github.com/georust/geos/actions/runs/7817187602/job/21324473886#step:15:57) bytes in 2 blocks
==14[67](https://github.com/georust/geos/actions/runs/7817187602/job/21324473886#step:15:68)4== suppressed: 0 bytes in 0 blocks
==146[74](https://github.com/georust/geos/actions/runs/7817187602/job/21324473886#step:15:75)==
==[146](https://github.com/georust/geos/actions/runs/7817187602/job/21324473886#step:15:147)74== For lists of detected and suppressed errors, rerun with: -s
==14674== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
error: failed to run custom build command for geos-sys v2.0.5
Caused by:
process didn't exit successfully: /home/bouyei/projects/georust/target/debug/build/geos-sys-70c700a92bad5d0b/build-script-build
(exit status: 101)
--- stdout
cargo:rerun-if-changed=build.rs
cargo:rerun-if-env-changed=GEOS_LIB_DIR
cargo:rerun-if-env-changed=GEOS_VERSION
cargo:rerun-if-env-changed=GEOS_NO_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=GEOS_STATIC
cargo:rerun-if-env-changed=GEOS_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
--- stderr
thread 'main' panicked at 'Could not detect GEOS using pkg-config or geos-config', /home/bouyei/.cargo/registry/src/github.com/rust-lang-df7c3c540f42cdbd/geos-sys-2.0.5/build.rs:137:13
Hi,
It seems that prepared geometry contains is not thread safe before run at least once. Easiest to provoke on large geometries. Not able to provoke on example in docs.
Regards, Gaute
# New geos release
The `5.0` version of the [geos](https://crates.io/crates/geos) crate was just released! The last version came out not so long ago, however it lacked quite a number of things, starting with functions available in the C library. This new release changes everything. Time to write about what happened in this new version!
A quick note before starting: when "geos" is written, I'm talking about the Rust crate, when "GEOS" is written, I'm talking about the C library. Now that it's clear, let's start!
### Changes
To sum up changes:
* geos objects are now thread-safe thanks to the switch to GEOS thread-safe functions.
* GEOS versions are handled through features (if a function isn't available, it's very likely you forgot to enable a feature!).
* All types have a `ContextHandle` (which is the object which makes types thread-safe).
* No need anymore to call `geos::init` (and therefore, no need on our side to cleanup on exit).
* A lot more of functions/types available.
* A **lot** more of documentation (with examples!).
* A **lot** more of tests (thanks to documentation).
* Bridges with the geo crate are now optional. You need to enable the `geo` feature if you want to use them.
Alongside those big changes, some smaller ones like the replacement of [skeptic](https://crates.io/crates/skeptic) with [doc-comment](https://crates.io/crates/doc-comment) to test README file code examples now prevents `cargo` to rebuild the whole library everytime when it's being used as a dependency.
A renaming also happened:
* `GGeom` became `Geometry`
* `PreparedGGeom` became `PreparedGeometry`
### More control
For this new release, control over errors has been greatly improved. Now, almost every function returns a `GResult`. It can seem a bit annoying at first, but when an error triggers, you can find where it comes from **very** easily, and that was the goal.
You can then get more information on the error through the `ContextHandle` type which provides the following two methods (amongst others):
```Rust
pub fn get_last_error(&self) -> Option<String>;
pub fn get_last_notification(&self) -> Option<String>;
```
You can call them on any geos type through the `ContextInteractions` trait. But in case you want to be noticed when the error occurs directly without having to call this function, you can set a callback to be called:
```Rust
pub fn set_error_message_handler(&self, ef: Option<Box<dyn Fn(&str) + Send + Sync + 'a>>);
pub fn set_notice_message_handler(&self, nf: Option<Box<dyn Fn(&str) + Send + Sync + 'a>>);
```
### Outputs
Another nice add is the add of the `WBKWriter` and `WKTWriter` types. Convenient methods over other types to generate outputs are still available (thinking about `to_wkt` and `to_wkt_precision`). Now it's possible to change how many decimals you want, the number of output dimensions, etc...
### Word of the end
All these changes were made with a clear focus on giving more control to the users while making it easier to use (thanks to the documentation and the examples too!). Feedbacks are very welcome so don't hesitate to open issues on the [repository](https://github.com/georust/geos/).
Good hacking!
In order to expose a safe interface and to not alter the results returned by GEOS I guess we should check the value returned by the various binary predicates and wrap it in a Result
.
GEOS is returning 2 for an exception (that we could transform to an Err
) or 1/0 if its true/false (that we could wrap in a Ok
).
Currently we are doing like this : https://github.com/georust/rust-geos/blob/master/src/ffi.rs#L464
If no one is already working on it I will send a PR today, sorry this error remained in the code so long of my fault!
From the docstring of get_coord_seq
:
Note: this clones the underlying CoordSeq to avoid double free (because CoordSeq handles the object ptr and the CoordSeq is still owned by the geos geometry) if this method’s performance becomes a bottleneck, feel free to open an issue, we could skip this clone with cleaner code.
My use case is to bind GEOS algorithms to the GeoArrow memory layout (an efficient geometry layout for arrays of geometries, see geoarrow.org and my WIP rust implementation at https://github.com/geoarrow/geoarrow-rs). My current plan is to always store geometries before and after each operation in GeoArrow memory, and therefore GEOS objects are totally ephemeral during an operation. So the process goes like
Therefore the IO to and from GEOS objects is really important to me, because it's overhead for every operation on the array.
One option is to improve this get_coord_seq
, removing a clone. The other possibility for me is to have something like into_coord_seq
or into_inner
. Given that I want to consume the GEOS geometry anyways, and only access its coords, this might be easier to implement?
I'd be willing to attempt a PR!
First of all, thanks for this library.
I am experimenting an issue converting from geos::Geometry to geojson::Geometry type. It looks like the readme has not been updated since this commit 1614a49 makes use of the std TryFrom trait.
I have this sample code:
let pt = "POINT(1.0 1.0)";
let pt = geos::Geometry::new_from_wkt(pt).unwrap();
let geom: geojson::Geometry = pt.try_into().unwrap();
and the compiler shows this error:
error[E0277]: the trait bound `Value: From<geos::Geometry<'_>>` is not satisfied
--> src/main.rs:79:38
|
79 | let geom: geojson::Geometry = pt.try_into().unwrap();
| ^^^^^^^^ the trait `From<geos::Geometry<'_>>` is not implemented for `Value`
|
= note: required because of the requirements on the impl of `Into<Value>` for `geos::Geometry<'_>`
= note: required because of the requirements on the impl of `From<geos::Geometry<'_>>` for `geojson::Geometry`
= note: required because of the requirements on the impl of `Into<geojson::Geometry>` for `geos::Geometry<'_>`
= note: required because of the requirements on the impl of `TryFrom<geos::Geometry<'_>>` for `geojson::Geometry`
= note: required because of the requirements on the impl of `TryInto<geojson::Geometry>` for `geos::Geometry<'_>`
I have the geos library with json feature enabled.
[dependencies]
geos = {version = "7.0.0", features = ["json"]}
geojson= {version = "0.20.1"}
Curiously, the code compiles by first doing a conversion to geo_types and then to geojson
let geotypes_obj: geo_types::Geometry<f64> = pt.try_into().unwrap();
let geometry = geojson::Geometry::new(geojson::Value::from(&geotypes_obj));
I found here
Line 5 in 0a4862d
It looks like the geojson::Geometry type has not implemented the TryFrom crate within to_geojson.rs file.
Let me know your opinion
I made a silly typo in this commit : 42212ed.
Should we change the name of the method to the more explicit "to_wkt_precision" ?
I guess it's also a change in the API that would require incrementing the major version number.
Seems like the PreparedGeometry should have a lifetime dependency on the original Geometry. When I try to use the the PreparedGeometry after dropping the original one I get various errors and sigabrts, including messages like pure virtual method called
(which could have been a coincidence).
Step to reproduce :
let vec_geoms = vec![
GGeom::new("POINT (1.3 2.4)").unwrap(),
GGeom::new("LINESTRING(1 1,10 50,20 25)").unwrap(),
];
let multi_point = GGeom::create_multipoint(vec_geoms)?;
Changing the return type of a public function is a breaking change.
a306538 change a lot of return type from GGeom.
v1.1.0 must be yanked, and published as 2.0.0.
That would allow to prevent unnecessary runtime checks on some methods. The GGeom
trait would contain all the common methods.
I can't find the algorithm library for geos in C ++ in the API. How can I calculate the angle between two points?
thanks。
I must be doing something dumb.
Rust 2018 edition, Geos v8.0.1
Code:
use geo::{MultiPolygon};
use std::convert::TryInto;
use geos::{Geometry as GGeometry};
#[derive(Clone, Debug)]
pub struct GeomAndId {
pub geom: MultiPolygon<f64>,
pub id: u128, // TODO: use core.Id etc.
}
impl GeomAndId {
pub fn geos_geom(&self) -> Result<GGeometry<'static>, StringError> {
let g: GGeometry = (&self.geom).try_into().map_err(|e| {
format!("Geometry could not be converted to GEOS: {}", e).into()
})?;
Ok(g)
}
}
Error:
error[E0277]: the trait bound `geos::Geometry<'_>: From<&geo_types::MultiPolygon<f64>>` is not satisfied
--> geo.rs:20:41
|
20 | let g: GGeometry = (&self.geom).try_into().map_err(|e| {
| ^^^^^^^^ the trait `From<&geo_types::MultiPolygon<f64>>` is not implemented for `geos::Geometry<'_>`
|
= note: required because of the requirements on the impl of `Into<geos::Geometry<'_>>` for `&geo_types::MultiPolygon<f64>`
= note: required because of the requirements on the impl of `TryFrom<&geo_types::MultiPolygon<f64>>` for `geos::Geometry<'_>`
= note: required because of the requirements on the impl of `TryInto<geos::Geometry<'_>>` for `&geo_types::MultiPolygon<f64>`
It seems like somehow using try_into() is causing it to want the From trait, but clearly according to docs, the Geos TryFrom<&'a MultiPolygon<f64>
trait exists, so what gives? Any help appreciated, thanks.
Hi,
I have few questions/suggestions about geos context and lifetimes. (I'm literally couple of days into learning rust so I may not see some obvious things.)
I don't understand why each geometry keeps geos context and why is this context cloned over to other derived geometries (even though the cloned rust context is referencing the same instance of geos context).
Geos context is ment to be used as a thread safe mechanism to propagate C++ exceptions through C api and to keep some temporary/helper data AFAIK (like buffer to format error messages or geos Point instance to be re-used as a temporary object). But rust binding does allow non-thread safe usage.
I think it would be good to have thread local instances of geos context and to use those temporarily just to call C geos api. This wayite would also prevent unnecessary allocations of new contexts in many operations (like creating new non-derived geometries, new coordinate sequences, etc.). In the end the whole context mechanism would be private (and transparent to the users of rust api).
The only thing in geos context which is not primarily related to thread safety is configuration of WKB dims and byte order. But I feel like it does not belong there and also it has been deprecated.
There is draft of what I mean: 8c09681
links:
I don't understand why Geometry struct (and other structs) has explicit lifetime and why all functions returning new derived geometries also have the same lifetime. Because derived geometries resulting from geometric operations, etc. are just new and owned geometries non-related to the input geometry/geometries.
(It's true that derived geos geometries do pass around non-owned pointer to geometry factory, which is also part of geos context, but which cannot be changed with C api and which is always set to the single global instance.)
It seems to me that all lifetime parameters could be removed and the code would still be correct. And then it would be possible to pass Geometry freely around without any constraints. (But as I wrote, I do not have much experience with rust yet. Maybe I'm missing something.)
There is draft of what I mean: 83c3219
The self-generated documentation for geos crate is rather empty.
Perhaps we should try to document the main structs (CoordSeq
, GGeom
) and put some examples to feed a bit the documentation.
We're a version behind right now
I can use dynamic compilation to implement functions after installing libgeos on Ubuntu, but after the program is sent to other environments, if other machines do not have lib Geo, static compilation is required. I have already configured gcc, cmake, etc. on my machine, but I still don't know how to implement static compilation. What are the specific steps for static compilation?
I have been engaged in GIS development, but I am a novice in Rust. I hope to receive more detailed step-by-step instructions. Thank you.
👋 Hello!
GEOS 3.10+ includes new APIs to interact between a CoordSeq
and external buffers/arrays. This would be useful for me because I'm trying to make interop between GeoArrow and GEOS faster. I'm guessing that these should be faster than a manual approach with iterating because copyFromBuffer
should be essentially just a memcpy
.
Would you take a PR for this?
I doing some staff with this lib why some function not implemented??
such as ST_Split
, ST_TileEnvelope
.
I see those function is postgis document, some C
lib don't have those function??
We currently have methods to create MultiPoint (https://github.com/georust/geos/blob/master/src/ffi.rs#L600) and MultiPolygon (https://github.com/georust/geos/blob/master/src/ffi.rs#L581) from a Vec
of GGeom
but it seems it lacks methods for construction of MultiLineString and GeometryCollection from a Vec
of GGeom
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.