Boost logo

Geometry :

Subject: [ggl] Re: maps-charts-graphs
From: fausto (f4ust0f)
Date: 2010-03-29 03:00:05


Great! Thanks a lot Barend for your help, I really appreaciate it.

Regards,
Fausto

On Sat, Mar 27, 2010 at 2:49 PM, barend <barend.gehrels_at_[hidden]> wrote:

>
> Hi Fausto,
>
>
> > An example that shows me how I can get the attributes
> > of a country (for ex. the list of the polylines
> > vertices) would be really helpful.
>
> There are several samples you can look into.
>
> The 07_graph_route_example reads vertices from an ASCII file,
> including attributes (in this case city-name). You can
> implement extra attributes as color yourself. You can also
> use a shapefile, or a database, there are samples available,
> but you then need an external library.
>
> A datafile with world countries (world.wkt) is in the
> distribution, however that one does not have country names.
>
> The x04_wxwidgets_world_mapper (a new sample using WxWidgets)
> is reading from this world.wkt.
>
> If you need to access countries by name I would use something like this:
>
> struct my_country
> {
> multi_polygon<polygon_2d> boundary;
> int color; // or rgb tuple or string, etc
> std::string name; // might be omitted as well
> };
>
> and register this as a multi polygon. There is not yet a
> registration macro, but it is trivial:
>
> namespace boost { namespace geometry { namespace traits
> {
>
> struct tag<my_country>
> {
> typedef multi_polygon_tag type;
> };
>
> }}}
>
> and then have a
> std::map<string, my_country> which is then filled by
> country name and boundaries.
>
> So there is not one complete example doing the thing you want
> (maybe it will be added once) but with some other pieces and
> this mail you should be able to do the trick.
>
> Regards, Barend
>
>
>
> _______________________________________________
> ggl mailing list
> ggl_at_[hidden]
> http://lists.osgeo.org/mailman/listinfo/ggl
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/ggl/attachments/20100329/412e2e35/attachment.html


Geometry list run by mateusz at loskot.net