a ring concept implementation of a true circle?

classic Classic list List threaded Threaded
17 messages Options
joe
Reply | Threaded
Open this post in threaded view
|

a ring concept implementation of a true circle?

joe
Is there an easy way to model a true circle? By that I mean not a
polygon with a bunch of closely spaced points, but something you
construct with a point and a radius.

I guess not? All rings must consist of a list of points?
_______________________________________________
Geometry mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/geometry
Reply | Threaded
Open this post in threaded view
|

Re: a ring concept implementation of a true circle?

Bruno Lalande
Hi,

There's a nsphere concept + model in the extension, which might meet
your requirements in its 2D version. Probably needs some refreshing
though, I intended to work on that soon. Which algorithm would you
mostly need to apply on it?

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

Re: a ring concept implementation of a true circle?

Mats Taraldsvik-2
In reply to this post by joe
On 08/28/2012 03:47 PM, [hidden email] wrote:
> Is there an easy way to model a true circle? By that I mean not a
> polygon with a bunch of closely spaced points, but something you
> construct with a point and a radius.
>
> I guess not? All rings must consist of a list of points?

It is not part of the simple geometry feature set, which, as far as I
can see, is the only implemented data types thus far. However, the
SQL-MM standard has a CIRCULARSTRING type (see
http://postgis.org/docs/using_postgis_dbmanagement.html#SQL_MM_Part3).
It is currently missing(?) from Boost.Geometry (but might be in future
plans? Barend?)

Mats

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

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

Re: a ring concept implementation of a true circle?

joe
In reply to this post by Bruno Lalande
On 2012-08-28 10:52, Bruno Lalande wrote:
> There's a nsphere concept + model in the extension, which might meet
> your requirements in its 2D version. Probably needs some refreshing
> though, I intended to work on that soon. Which algorithm would you
> mostly need to apply on it?

Um, 'overlaps' and 'within', I guess. These would be sensor volumes
with
various interior rings (not necessarily circular) cut out. They move
around the surface of a sphere and I need to ask if they can see stuff
or not. I'd need CircularRing to be valid model of bg::ring, I suppose.
_______________________________________________
Geometry mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/geometry
Reply | Threaded
Open this post in threaded view
|

Re: a ring concept implementation of a true circle?

Barend
In reply to this post by Mats Taraldsvik-2
On 28-8-2012 18:54, Mats Taraldsvik wrote:

> On 08/28/2012 03:47 PM, [hidden email] wrote:
>> Is there an easy way to model a true circle? By that I mean not a
>> polygon with a bunch of closely spaced points, but something you
>> construct with a point and a radius.
>>
>> I guess not? All rings must consist of a list of points?
>
> It is not part of the simple geometry feature set, which, as far as I
> can see, is the only implemented data types thus far. However, the
> SQL-MM standard has a CIRCULARSTRING type (see
> http://postgis.org/docs/using_postgis_dbmanagement.html#SQL_MM_Part3).
> It is currently missing(?) from Boost.Geometry (but might be in future
> plans? Barend?)

Yes, plans are there: as Bruno answered (2 minutes before your mail ;-)
) we started the nsphere geometry and concepts, but they are never
released, so still in extensions. See Bruno's mail.

Regards, Barend

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

Re: a ring concept implementation of a true circle?

Mats Taraldsvik-2
Hi Bruno and Barend,

On 08/28/2012 10:49 PM, Barend Gehrels wrote:

> On 28-8-2012 18:54, Mats Taraldsvik wrote:
>> On 08/28/2012 03:47 PM, [hidden email] wrote:
>>> Is there an easy way to model a true circle? By that I mean not a
>>> polygon with a bunch of closely spaced points, but something you
>>> construct with a point and a radius.
>>>
>>> I guess not? All rings must consist of a list of points?
>>
>> It is not part of the simple geometry feature set, which, as far as I
>> can see, is the only implemented data types thus far. However, the
>> SQL-MM standard has a CIRCULARSTRING type (see
>> http://postgis.org/docs/using_postgis_dbmanagement.html#SQL_MM_Part3). It
>> is currently missing(?) from Boost.Geometry (but might be in future
>> plans? Barend?)
>
> Yes, plans are there: as Bruno answered (2 minutes before your mail
> ;-) ) we started the nsphere geometry and concepts, but they are never
> released, so still in extensions. See Bruno's mail.
>
Ah, I see. Great! :) Does this nsphere implement (parts of) the SQL-MM
standard? Is the resulting WRT output compatible with PostGIS?

Will both circular and straight linestrings/segments in e.g. a Ring be
possible in the future? (Since there is no hierarchy in the geometries
(only ranges of points) I guess this is difficult at present, but
perhaps something to consider for the future?)

> Regards, Barend
>

Mats

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

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

Re: a ring concept implementation of a true circle?

Bruno Lalande
Hi Mats,

As I haven't dug much into the current state of nsphere, I can't
really answer your questions right now.

Not sure to understand your last one about linestrings/segments, can
you be more precise?

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

Re: a ring concept implementation of a true circle?

joe
Is there a bug tracking system I should report issues to?

I'm giving the nsphere extension a quick try and having no luck. First,
a
header path is screwed up in trunk.

     $ svn diff
     Index: extensions/nsphere/core/replace_point_type.hpp
     ===================================================================
     --- extensions/nsphere/core/replace_point_type.hpp      (revision
80406)
     +++ extensions/nsphere/core/replace_point_type.hpp      (working
copy)
     @@ -16,7 +16,7 @@
      #define
BOOST_GEOMETRY_EXTENSIONS_NSPHERE_CORE_REPLACE_POINT_TYPE_HPP


     -#include <boost/geometry/core/replace_point_type.hpp>
     +#include <boost/geometry/extensions/util/replace_point_type.hpp>

      #include <boost/geometry/extensions/nsphere/core/tags.hpp>
      #include
<boost/geometry/extensions/nsphere/geometries/nsphere.hpp>

With that fixed I get various template argument errors just compiling
the
nsphere.hpp file.

     In file included from
thirdparty/boost/geometry/extensions/nsphere/nsphere.hpp:17:0,
                      from src/test.cpp:3:
     thirdparty/boost/geometry/extensions/nsphere/core/access.hpp:33:62:
error: wrong number of template arguments (4, should be 5)
     In file included from
thirdparty/boost/geometry/extensions/nsphere/core/access.hpp:19:0,
                      from
thirdparty/boost/geometry/extensions/nsphere/nsphere.hpp:17,
                      from src/test.cpp:3:
     thirdparty/boost/geometry/core/access.hpp:143:8: error: provided
for ‘template<class Tag, class Geometry, class CoordinateType, long
unsigned int Dimension, class IsPointer> struct
boost::geometry::core_dispatch::access’
     In file included from
thirdparty/boost/geometry/extensions/nsphere/core/replace_point_type.hpp:22:0,
                      from
thirdparty/boost/geometry/extensions/nsphere/nsphere.hpp:20,
                      from src/test.cpp:3:
     
thirdparty/boost/geometry/extensions/nsphere/geometries/nsphere.hpp: In
constructor ‘boost::geometry::model::nsphere<P, T>::nsphere()’:
     
thirdparty/boost/geometry/extensions/nsphere/geometries/nsphere.hpp:60:9:
error: ‘assign_value’ is not a member of
‘boost::geometry::detail::assign’
     
thirdparty/boost/geometry/extensions/nsphere/geometries/nsphere.hpp:60:9:
note: suggested alternative:
     In file included from
thirdparty/boost/geometry/algorithms/convert.hpp:24:0,
                      from
thirdparty/boost/geometry/geometries/box.hpp:21,
                      from
thirdparty/boost/geometry/extensions/util/replace_point_type.hpp:34,
                      from
thirdparty/boost/geometry/extensions/nsphere/core/replace_point_type.hpp:19,
                      from
thirdparty/boost/geometry/extensions/nsphere/nsphere.hpp:20,
                      from src/test.cpp:3:
     thirdparty/boost/geometry/arithmetic/arithmetic.hpp:253:13: note:  
‘boost::geometry::assign_value’
     In file included from
thirdparty/boost/geometry/extensions/nsphere/nsphere.hpp:30:0,
                      from src/test.cpp:3:
     thirdparty/boost/geometry/extensions/nsphere/algorithms/area.hpp:
At global scope:
     
thirdparty/boost/geometry/extensions/nsphere/algorithms/area.hpp:70:44:
error: wrong number of template arguments (3, should be 2)
     In file included from
thirdparty/boost/geometry/extensions/nsphere/algorithms/area.hpp:19:0,
                      from
thirdparty/boost/geometry/extensions/nsphere/nsphere.hpp:30,
                      from src/test.cpp:3:
     thirdparty/boost/geometry/algorithms/area.hpp:133:8: error:
provided for ‘template<class Geometry, class Tag> struct
boost::geometry::dispatch::area’
     In file included from
thirdparty/boost/geometry/extensions/nsphere/nsphere.hpp:33:0,
                      from src/test.cpp:3:
     
thirdparty/boost/geometry/extensions/nsphere/algorithms/envelope.hpp:67:5:
error: wrong number of template arguments (6, should be 2)
     In file included from
thirdparty/boost/geometry/extensions/nsphere/algorithms/envelope.hpp:18:0,
                      from
thirdparty/boost/geometry/extensions/nsphere/nsphere.hpp:33,
                      from src/test.cpp:3:
     thirdparty/boost/geometry/algorithms/envelope.hpp:90:8: error:
provided for ‘template<class Geometry, class Tag> struct
boost::geometry::dispatch::envelope’
     In file included from
thirdparty/boost/geometry/extensions/nsphere/nsphere.hpp:34:0,
                      from src/test.cpp:3:
     
thirdparty/boost/geometry/extensions/nsphere/algorithms/num_points.hpp:33:47:
error: wrong number of template arguments (3, should be 2)
     In file included from
thirdparty/boost/geometry/extensions/nsphere/algorithms/num_points.hpp:17:0,
                      from
thirdparty/boost/geometry/extensions/nsphere/nsphere.hpp:34,
                      from src/test.cpp:3:
     thirdparty/boost/geometry/algorithms/num_points.hpp:102:8: error:
provided for ‘template<class GeometryTag, class Geometry> struct
boost::geometry::dispatch::num_points’
     In file included from
thirdparty/boost/geometry/extensions/nsphere/nsphere.hpp:35:0,
                      from src/test.cpp:3:
     
thirdparty/boost/geometry/extensions/nsphere/algorithms/within.hpp:149:58:
error: wrong number of template arguments (5, should be 4)
     In file included from
thirdparty/boost/geometry/algorithms/disjoint.hpp:33:0,
                      from
thirdparty/boost/geometry/algorithms/num_points.hpp:29,
                      from
thirdparty/boost/geometry/extensions/nsphere/algorithms/num_points.hpp:17,
                      from
thirdparty/boost/geometry/extensions/nsphere/nsphere.hpp:34,
                      from src/test.cpp:3:
     thirdparty/boost/geometry/algorithms/within.hpp:173:8: error:
provided for ‘template<class Geometry1, class Geometry2, class Tag1,
class Tag2> struct boost::geometry::dispatch::within’
     In file included from
thirdparty/boost/geometry/extensions/nsphere/nsphere.hpp:35:0,
                      from src/test.cpp:3:
     
thirdparty/boost/geometry/extensions/nsphere/algorithms/within.hpp:158:58:
error: wrong number of template arguments (5, should be 4)
     In file included from
thirdparty/boost/geometry/algorithms/disjoint.hpp:33:0,
                      from
thirdparty/boost/geometry/algorithms/num_points.hpp:29,
                      from
thirdparty/boost/geometry/extensions/nsphere/algorithms/num_points.hpp:17,
                      from
thirdparty/boost/geometry/extensions/nsphere/nsphere.hpp:34,
                      from src/test.cpp:3:
     thirdparty/boost/geometry/algorithms/within.hpp:173:8: error:
provided for ‘template<class Geometry1, class Geometry2, class Tag1,
class Tag2> struct boost::geometry::dispatch::within’
     In file included from
thirdparty/boost/geometry/extensions/nsphere/nsphere.hpp:35:0,
                      from src/test.cpp:3:
     
thirdparty/boost/geometry/extensions/nsphere/algorithms/within.hpp:167:72:
error: wrong number of template arguments (5, should be 4)
     In file included from
thirdparty/boost/geometry/algorithms/disjoint.hpp:33:0,
                      from
thirdparty/boost/geometry/algorithms/num_points.hpp:29,
                      from
thirdparty/boost/geometry/extensions/nsphere/algorithms/num_points.hpp:17,
                      from
thirdparty/boost/geometry/extensions/nsphere/nsphere.hpp:34,
                      from src/test.cpp:3:
     thirdparty/boost/geometry/algorithms/within.hpp:173:8: error:
provided for ‘template<class Geometry1, class Geometry2, class Tag1,
class Tag2> struct boost::geometry::dispatch::within’
     In file included from
thirdparty/boost/geometry/extensions/nsphere/nsphere.hpp:35:0,
                      from src/test.cpp:3:
     
thirdparty/boost/geometry/extensions/nsphere/algorithms/within.hpp:176:60:
error: wrong number of template arguments (5, should be 4)
     In file included from
thirdparty/boost/geometry/algorithms/disjoint.hpp:33:0,
                      from
thirdparty/boost/geometry/algorithms/num_points.hpp:29,
                      from
thirdparty/boost/geometry/extensions/nsphere/algorithms/num_points.hpp:17,
                      from
thirdparty/boost/geometry/extensions/nsphere/nsphere.hpp:34,
                      from src/test.cpp:3:
     thirdparty/boost/geometry/algorithms/within.hpp:173:8: error:
provided for ‘template<class Geometry1, class Geometry2, class Tag1,
class Tag2> struct boost::geometry::dispatch::within’
     In file included from
thirdparty/boost/geometry/extensions/nsphere/nsphere.hpp:35:0,
                      from src/test.cpp:3:
     
thirdparty/boost/geometry/extensions/nsphere/algorithms/within.hpp:185:66:
error: wrong number of template arguments (5, should be 4)
     In file included from
thirdparty/boost/geometry/algorithms/disjoint.hpp:33:0,
                      from
thirdparty/boost/geometry/algorithms/num_points.hpp:29,
                      from
thirdparty/boost/geometry/extensions/nsphere/algorithms/num_points.hpp:17,
                      from
thirdparty/boost/geometry/extensions/nsphere/nsphere.hpp:34,
                      from src/test.cpp:3:
     thirdparty/boost/geometry/algorithms/within.hpp:173:8: error:
provided for ‘template<class Geometry1, class Geometry2, class Tag1,
class Tag2> struct boost::geometry::dispatch::within’
     In file included from
thirdparty/boost/geometry/extensions/nsphere/nsphere.hpp:35:0,
                      from src/test.cpp:3:
     
thirdparty/boost/geometry/extensions/nsphere/algorithms/within.hpp:194:61:
error: wrong number of template arguments (5, should be 4)
     In file included from
thirdparty/boost/geometry/algorithms/disjoint.hpp:33:0,
                      from
thirdparty/boost/geometry/algorithms/num_points.hpp:29,
                      from
thirdparty/boost/geometry/extensions/nsphere/algorithms/num_points.hpp:17,
                      from
thirdparty/boost/geometry/extensions/nsphere/nsphere.hpp:34,
                      from src/test.cpp:3:
     thirdparty/boost/geometry/algorithms/within.hpp:173:8: error:
provided for ‘template<class Geometry1, class Geometry2, class Tag1,
class Tag2> struct boost::geometry::dispatch::within’
     In file included from
thirdparty/boost/geometry/geometries/point.hpp:26:0,
                      from
thirdparty/boost/geometry/extensions/util/replace_point_type.hpp:29,
                      from
thirdparty/boost/geometry/extensions/nsphere/core/replace_point_type.hpp:19,
                      from
thirdparty/boost/geometry/extensions/nsphere/nsphere.hpp:20,
                      from src/test.cpp:3:
     thirdparty/boost/geometry/util/math.hpp:176:14: error:
‘boost::geometry::math::r2d’ defined but not used
[-Werror=unused-variable]
     cc1plus: all warnings being treated as errors
     make[1]: *** [obj/Debug/test.o] Error 1
     make: *** [test] Error 2

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

Re: a ring concept implementation of a true circle?

Bruno Lalande
Ouch - This is due to the changes I made recently in algorithms. I
didn't realize that part of the dispatch classes specializations was
spread in a separate area of our code base. I'll work on fixing this
ASAP.

You can report this here: http://www.boost.org/support/bugs.html

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

Re: a ring concept implementation of a true circle?

Mats Taraldsvik-2
In reply to this post by Bruno Lalande
Hi Bruno,

On 08/31/2012 04:16 PM, Bruno Lalande wrote:
> Hi Mats,
>
> As I haven't dug much into the current state of nsphere, I can't
> really answer your questions right now.
>
> Not sure to understand your last one about linestrings/segments, can
> you be more precise?

I'll try to explain:

Essentially, I believe the current geometry structure can currently only
be combined in one way, which is points->lines->rings->polygons. (?)

When I have a boost::geometry Polygon, is there a way to get to the line
or ring objects that the polygon consists of (maintaining
topology/shared geometry is therefore difficult or impossible), since
points are exposed directly?

A heterogenous collection of straight and circular lines will also be
impossible as long as the context of the objects between the points and
polygon are not available.

Concrete examples would be a road segment -- it is often both straight
and curvy. Also, administrative boundaries share geometry. :)

I'm not very good at explaining, I'm afraid. :)

Mats



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

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

Re: a ring concept implementation of a true circle?

Bruno Lalande
Hi Mats,

Sorry, missed to reply this. What you're requesting goes much beyond
the scope of a ring, we would first have to invent a curve
concept/model and then we could eventually propose a range of curves
or something like that. For curve/straight lines mix, the variant
geometry concept which is coming soon might help (variant<segment,
curve>), encapsulated into a multi geometry which would also have to
be more flexible than what we have. As you can see, we're far from
there :-)

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

Re: a ring concept implementation of a true circle?

Bruno Lalande
In reply to this post by Bruno Lalande
Hi,

> Ouch - This is due to the changes I made recently in algorithms. I
> didn't realize that part of the dispatch classes specializations was
> spread in a separate area of our code base. I'll work on fixing this
> ASAP.

I've updated the code to have nsphere work with the latest core
library code, can you refresh from trunk and try?

There are 2 tests which I can't pass yet, within and multi_within, so
I've commented them out from now.

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

Re: a ring concept implementation of a true circle?

joe
On 2012-09-16 17:04, Bruno Lalande wrote:
>
> I've updated the code to have nsphere work with the latest core
> library code, can you refresh from trunk and try?
>
> There are 2 tests which I can't pass yet, within and multi_within, so
> I've commented them out from now.
>

I can confirm the nsphere header compiles now. And the
test_extensions/area.cpp file compiles and runs. But I suspect you knew
that.

Does 'within' not work with nsphere right now, or is it just the
test/example that's broken? 'within' is kind of critical to what I want
to do with nsphere.

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

Re: a ring concept implementation of a true circle?

Bruno Lalande
Hi,

I'm afraid within really doesn't work right now but you can always
give it a try. With which exactly geometry types do you need to make
it work? i.e. is it only for point within sphere/circle?

Bruno

On Mon, Sep 17, 2012 at 2:13 AM,  <[hidden email]> wrote:

> On 2012-09-16 17:04, Bruno Lalande wrote:
>>
>>
>> I've updated the code to have nsphere work with the latest core
>> library code, can you refresh from trunk and try?
>>
>> There are 2 tests which I can't pass yet, within and multi_within, so
>> I've commented them out from now.
>>
>
> I can confirm the nsphere header compiles now. And the
> test_extensions/area.cpp file compiles and runs. But I suspect you knew
> that.
>
> Does 'within' not work with nsphere right now, or is it just the
> test/example that's broken? 'within' is kind of critical to what I want to
> do with nsphere.
>
>
> _______________________________________________
> Geometry mailing list
> [hidden email]
> http://lists.boost.org/mailman/listinfo.cgi/geometry
_______________________________________________
Geometry mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/geometry
joe
Reply | Threaded
Open this post in threaded view
|

Re: a ring concept implementation of a true circle?

joe
On 2012-09-17 09:40, Bruno Lalande wrote:
>
> I'm afraid within really doesn't work right now but you can always
> give it a try. With which exactly geometry types do you need to make
> it work? i.e. is it only for point within sphere/circle?
>

Does covered_by and so forth work?

At a high level what I'm trying to build will involve detecting whether
or not lines, points, and boxes intersect circles or not. This is all
with spherical_equatorial.

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

additional geometries (was: a ring concept implementation of a true circle?)

Adam Wulkiewicz
In reply to this post by Bruno Lalande
> I've updated the code to have nsphere work with the latest core
> library code, can you refresh from trunk and try?

Hi,

Do you plan to implement additional geometrical objects like ray/line,
oriented box, plane? This would probably require to introduce Vector
concept or use points as vectors.

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

Re: additional geometries (was: a ring concept implementation of a true circle?)

Bruno Lalande
Hi Adam,

> Do you plan to implement additional geometrical objects like ray/line,
> oriented box, plane? This would probably require to introduce Vector concept
> or use points as vectors.

Yep, all what you describe is something we plan to have (ray, line,
place, OBB, vector). Still need to think about how vectors would
integrate into the current design, that will need to be discussed...
I'll probably email about that at some point to share my thoughts.

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