What are some recommended frameworks for manipulating spatial data in C++? [closed]
Asked Answered
P

6

7

What are some recommended frameworks for manipulating spatial data in C++?

I'm looking for a polygon object, point object, and some operations like union, intersection, distance, and area. I need to enter coordinates in WGS84 (lon,lat) and get area in square km.

I would prefer a free/open source framework, but am open to suggestions.

Edit: Unfortunately I need a non-GPL solution. LGPL is alright.

Psychomancy answered 25/6, 2009 at 21:1 Comment(0)
L
5

GEOS is an open source (LGPL) C++ geometry / topology engine. Might suit you?

Useful places to look for this stuff are this useful article on the O'Reilly website and also OSGeo which is a collaboration to support open source geospatial stuff.

Lampe answered 28/6, 2009 at 20:1 Comment(0)
M
4

I also recommend Generic Geometry Library which recently has been reviewed and eventually accepted to the collection of Boost C++ Libraries. As included in Boost, the GGL is now called Boost.Geometry, more precisely Boost.Geometry aka GGL, Generic Geometry Library.

Other useful tools

  • ORFEO Toolbox (aka OTB) - a library of image processing algorithm
  • MetaCRS - a project encompassing several projections, and coordinate system related technologies.
  • libgeotiff for sole GeoTIFF manipulation
Maidel answered 25/1, 2010 at 23:1 Comment(0)
S
3
  • The CGAL Open Source Project provides easy access to efficient and reliable geometric algorithms in the form of a C++ library. CGAL is used in various areas needing geometric computation, such as: computer graphics, scientific visualization, computer aided design and modeling, geographic information systems, molecular biology, medical imaging, robotics and motion planning, mesh generation, numerical methods.

  • The Generic Geometry Library (geometrylibrary.geodan.nl, currently in "preview 4") provides a generic implementation of geometry algorithms, working with user-defined geometries. The algorithms include some well-known and often needed algorithms as point-in-polygon, polygon area, point-to-point distance, point-to-line distance, line clipping and polygon clipping, convex hulls. It also contains transformation algorithms, map projections and selection algorithms. Besides algorithms the library provides geometry classes which might be used, but the generic algorithms do not depend on them. (Proposed to be included in Boost)

Spectatress answered 29/6, 2009 at 20:23 Comment(0)
I
2

GEOS for the Geometry model, and GDAL/OGR for a spatial data abstraction library which supports Rasters and Vectors.

By using these libraries, you will also be able to handle different coordinate systems (like transforming from/to WGS84) since both of them use Proj.4 under the hood. To find distances in meters you can transform from WGS84 to something that uses meters like UTM.

Ingalls answered 7/7, 2009 at 2:10 Comment(0)
S
1

Depending on how complex these calculations are going to be you might want to consider writing your own. If you are just doing area that might be your best option for speed and lack of bloat.

otherwise the Geographic Foundation Class (GFC) library is your best bet.

Solent answered 25/6, 2009 at 21:29 Comment(1)
Thanks for the pointer to GFC. Unfortunately I need a non-GPL solution so I clarified my question.Psychomancy
K
1

It's not comprehensive and high-level enough for what you asked, but for doing geodetic transforms you can use the NGA's excellent GEOTRANS library:

http://earth-info.nga.mil/GandG/geotrans/

That will let you convert between things like WGS84 lat/long and a local cartesian coordinate system. The C code is well tested, documented, and is public domain.

Kimbro answered 29/6, 2009 at 19:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.