Is simplify algorithm 3D aware

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Is simplify algorithm 3D aware

jakka30
Hello all,

Is Simplify algorithm implemented in boost::geometry::simplify() call (the default one which is Douglas-Peucker) 3D aware? We have a 3D line and would like to simplify using boost::geometry::simplify(), but it looks like to me that it is doing only 2D simplify.

Thank you,
Suresh
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is simplify algorithm 3D aware

Barend
Hi Suresh,

Op 8-4-2016 om 21:33 schreef jakka30:
> Is Simplify algorithm implemented in boost::geometry::simplify() call (the
> default one which is Douglas-Peucker) 3D aware? We have a 3D line and would
> like to simplify using boost::geometry::simplify(), but it looks like to me
> that it is doing only 2D simplify.

Yes, the simplify algorithm can also simplify a 3D line.

Regards, Barend
_______________________________________________
Geometry mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/geometry
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Is simplify algorithm 3D aware

jakka30

Hello Barend,

 

Thank you for your reply.  

 

What we noticed is that, if a point exceeds the max_distance in Z direction, but within the max_distance in x and y, it is still removing that point.

 

Do you have a example where it works in the z direction too?

 

Thank you for your help,

Suresh

 

_______________________________

Suresh Jakka

GeoCue Corporation

9668 Madison Blvd., Suite 202

Madison, AL 35758

(256) 461-8289 Telephone

(256) 461-8249 Fax

www.geocue.com

 

Integrating the Geospatial Workplace...

 

From: Barend [via Boost Geometry] [mailto:ml-node+[hidden email]]
Sent: Sunday, April 10, 2016 11:27 AM
To: Suresh Jakka <[hidden email]>
Subject: Re: Is simplify algorithm 3D aware

 

Hi Suresh,

Op 8-4-2016 om 21:33 schreef jakka30:
> Is Simplify algorithm implemented in boost::geometry::simplify() call (the
> default one which is Douglas-Peucker) 3D aware? We have a 3D line and would
> like to simplify using boost::geometry::simplify(), but it looks like to me
> that it is doing only 2D simplify.

Yes, the simplify algorithm can also simplify a 3D line.

Regards, Barend
_______________________________________________
Geometry mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/geometry


If you reply to this email, your message will be added to the discussion below:

http://boost-geometry.203548.n3.nabble.com/Is-simplify-algorithm-3D-aware-tp4026675p4026677.html

To unsubscribe from Is simplify algorithm 3D aware, click here.
NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is simplify algorithm 3D aware

Adam Wulkiewicz
Hi,

Jakka30 wrote:
What we noticed is that, if a point exceeds the max_distance in Z direction, but within the max_distance in x and y, it is still removing that point.

By default simplify() use:
- the default simplify strategy, bg::strategy::simplify::douglas_peucker,
- the default point-segment strategy, in cartesian bg::strategy::distance::projected_point,
- the default point-point strategy, in cartesian bg::strategy::distance::pythagoras,

The first strategy is CS-agnostic and the two other strategies are N-dimensional. The projected_point strategy first calculates the coordinates of a point projected into a segment and then calculates the distance between this point and the original point using pythagoras strategy. So a point is removed when a distance between this point and a segment created between currently analysed endpoints in douglas_peucker strategy is lesser than max_distance.

Do you have a example where it works in the z direction too?


Just added: https://github.com/boostorg/geometry/blob/develop/test/algorithms/simplify.cpp#L197
It calls simplify() with the default strategies: https://github.com/boostorg/geometry/blob/develop/test/algorithms/test_simplify.hpp#L87

Could you share a test case when the behavior is not correct?

Regards,
Adam
 

_______________________________________________
Geometry mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/geometry
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Is simplify algorithm 3D aware

jakka30

Thank you Adam for your quick reply.

 

I am using it as

 

boost::geometry::simplify(orgLineString,simplifiedLineString,maxMoveDistance);

 

I am assuming that the above code does 2D douglas-Peucker, is it correct?

 

Thanks,

Suresh

_______________________________

Suresh Jakka

GeoCue Corporation

9668 Madison Blvd., Suite 202

Madison, AL 35758

(256) 461-8289 Telephone

(256) 461-8249 Fax

www.geocue.com

 

Integrating the Geospatial Workplace...

 

From: Adam Wulkiewicz [via Boost Geometry] [mailto:ml-node+[hidden email]]
Sent: Tuesday, April 12, 2016 1:24 PM
To: Suresh Jakka <[hidden email]>
Subject: Re: Is simplify algorithm 3D aware

 

Hi,

Jakka30 wrote:

What we noticed is that, if a point exceeds the max_distance in Z direction, but within the max_distance in x and y, it is still removing that point.


By default simplify() use:
- the default simplify strategy, bg::strategy::simplify::douglas_peucker,
- the default point-segment strategy, in cartesian bg::strategy::distance::projected_point,
- the default point-point strategy, in cartesian bg::strategy::distance::pythagoras,

The first strategy is CS-agnostic and the two other strategies are N-dimensional. The projected_point strategy first calculates the coordinates of a point projected into a segment and then calculates the distance between this point and the original point using pythagoras strategy. So a point is removed when a distance between this point and a segment created between currently analysed endpoints in douglas_peucker strategy is lesser than max_distance.


Do you have a example where it works in the z direction too?


Just added: https://github.com/boostorg/geometry/blob/develop/test/algorithms/simplify.cpp#L197
It calls simplify() with the default strategies: https://github.com/boostorg/geometry/blob/develop/test/algorithms/test_simplify.hpp#L87

Could you share a test case when the behavior is not correct?

Regards,
Adam

 


_______________________________________________
Geometry mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/geometry


If you reply to this email, your message will be added to the discussion below:

http://boost-geometry.203548.n3.nabble.com/Is-simplify-algorithm-3D-aware-tp4026675p4026687.html

To unsubscribe from Is simplify algorithm 3D aware, click here.
NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is simplify algorithm 3D aware

Adam Wulkiewicz
Jakka30 wrote:
I am using it as

 boost::geometry::simplify(orgLineString,simplifiedLineString,maxMoveDistance);

 I am assuming that the above code does 2D douglas-Peucker, is it correct?


If the coordinate system is cartesian it does N-dimensional Douglas-Peucker, if the coordiante system is spherical-equatorial it does 2D simplification.

Could you share a specific case when this function doesn't work as you expect?

Regards,
Adam

_______________________________________________
Geometry mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/geometry
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Is simplify algorithm 3D aware

jakka30

Adam,

 

Thank you for your quick replies. You are amazing.

 

We are using it in our product and I will test it more with your information, if it is failing then I will get their coordinates, build a test case and will send that to you.

 

Thank you,

Suresh

 

_______________________________

Suresh Jakka

GeoCue Corporation

9668 Madison Blvd., Suite 202

Madison, AL 35758

(256) 461-8289 Telephone

(256) 461-8249 Fax

www.geocue.com

 

Integrating the Geospatial Workplace...

 

From: Adam Wulkiewicz [via Boost Geometry] [mailto:ml-node+[hidden email]]
Sent: Tuesday, April 12, 2016 2:31 PM
To: Suresh Jakka <[hidden email]>
Subject: Re: Is simplify algorithm 3D aware

 

Jakka30 wrote:

I am using it as

 boost::geometry::simplify(orgLineString,simplifiedLineString,maxMoveDistance);

 I am assuming that the above code does 2D douglas-Peucker, is it correct?


If the coordinate system is cartesian it does N-dimensional Douglas-Peucker, if the coordiante system is spherical-equatorial it does 2D simplification.

Could you share a specific case when this function doesn't work as you expect?

Regards,
Adam

_______________________________________________
Geometry mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/geometry


If you reply to this email, your message will be added to the discussion below:

http://boost-geometry.203548.n3.nabble.com/Is-simplify-algorithm-3D-aware-tp4026675p4026689.html

To unsubscribe from Is simplify algorithm 3D aware, click here.
NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Is simplify algorithm 3D aware

jakka30
Adam,

I thought it is not working but it is working fine. I could not get any failed case. My test case was wrong and when I fixed my test case, smoothing did work fine in 3D.

Thank you,
Suresh
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is simplify algorithm 3D aware

Adam Wulkiewicz
Jakka30 wrote:
> Adam,
>
> I thought it is not working but it is working fine. I could not get any
> failed case. My test case was wrong and when I fixed my test case, smoothing
> did work fine in 3D.

Thanks for the info. I'm glad everything works as expected.

Regards,
Adam
_______________________________________________
Geometry mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/geometry
Loading...