GithubHelp home page GithubHelp logo

boost_geometry_correct's People

Contributors

kleunen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

boost_geometry_correct's Issues

problems in Visual Studio + boost v1.75

WHen I try to compile, correct.hpp is not deducing my custom boost geometry types. ( I register OpenCV points as my point type via BOOST_GEOMETRY_REGISTER_POINT_2D and use polygons that like " boost::geometry::model::polygon<point, true, false>" etc.)

If I explicitly put my types in angle brackets of geometry::correct like geometry::correct<my::point, my::polygon, my::ring, my::polygons>(...), I get compilation errors in correct.hpp where it tries to call internal functions that do not deduce these types correctly.

So I just changed the correct,hpp source file to use my types, but i still get compilation errors. Now I am getting

"self_turn_points.hpp(156,75): error C2039: 'get_envelope_strategy': is not a member of 'boost::geometry::strategies::cartesian'"

I'm wondering if the library code is targeting a different version of boost.geometry?

Visual studio compilaton error

On implementation in a VS project a compilation error is thrown, any suggestions?

Code


#include <correct.hpp>
#include <boost/assign.hpp>

typedef boost::geometry::model::d2::point_xy<double> point;
typedef boost::geometry::model::polygon<point> polygon;
typedef boost::geometry::model::multi_polygon<polygon> multi_polygon;

void CRegion::CorrectPolyline(PolylineClass myPolyLine)
{
	std::vector<point> points;
	for (int p = 0;p < myPolyLine->GetNumberOfPoints();p++)
	{
		double pnt[3];
		myPolyLine->GetPoint(p, pnt);
		points.push_back(point(pnt[0], pnt[1]));
	}
	// Create a polygon object and assign the points to it.
	polygon aPolygon;
	boost::geometry::assign_points(aPolygon, points);

	multi_polygon input;
	input.push_back(aPolygon);
	multi_polygon result;
	double remove_spike_threshold = 1E-12;
	geometry::correct(input, result, remove_spike_threshold);

	for (auto const& poly : result) {
		std::cout << "Polygon area: " << boost::geometry::area(poly) << std::endl;
	}
}

Error

1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include\xtree(1599,1): error C3848: expression having type 'const geometry::impl::compare_point_less<point_t>' would lose some const-volatile qualifiers in order to call 'bool geometry::impl::compare_point_less<point_t>::operator ()(const point_t &,const point_t &)'
1> with
1> [
1> point_t=boost::geometry::model::d2::point_xy<double,boost::geometry::cs::cartesian>
1> ]

include in boost ?

Hi,
Wouldn't it be interesting to have "correct" inside the main library instead of having to find that it exists ?
The functionnality seems interesting enough to me.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.