Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
wiki:documentation:devguide:geometry_module [2016/01/19 09:55] gribeiro [Set Operations] |
wiki:documentation:devguide:geometry_module [2016/01/20 10:21] gribeiro [LineString] |
||
---|---|---|---|
Line 5: | Line 5: | ||
It is important to notice that this module refers to //**a geometry model to be used in main memory**// and //**it doesn't assume any kind of persistence or data storage management**//. This section explains the basic concepts, design behind this module ad how to use it. | It is important to notice that this module refers to //**a geometry model to be used in main memory**// and //**it doesn't assume any kind of persistence or data storage management**//. This section explains the basic concepts, design behind this module ad how to use it. | ||
- | All the types offered by Geometry module are in the namespace ''te::gm''. Check the [[http://www.dpi.inpe.br/terralib5/codedocs_5.1.0/d9/dba/group__geometry.html|DOxygen documentation of this module]], where these and other classes are documented in details. | + | All the types offered by Geometry module are in the namespace ''te::gm''. Check the [[http://www.dpi.inpe.br/terralib5/codedocs_5.1.0/d9/dba/group__geometry.html|Doxygen documentation of this module]], where these and other classes are documented in details. |
===== General Concepts ===== | ===== General Concepts ===== | ||
Line 43: | Line 43: | ||
<code cpp> | <code cpp> | ||
- | std::unique_ptr<te::gm::Point> p = std::make_unique<te::gm::Point>(-54.0, -12.0, 4326); | + | te::gm::Point p(-54.0, -12.0, 4326); |
</code> | </code> | ||
Line 69: | Line 69: | ||
<code cpp> | <code cpp> | ||
- | std::unique_ptr<te::gm::LineString> l = std::make_unique<te::gm:: LineString>(2, te::gm::LineStringType); | + | te::gm::LineString l(2, te::gm::LineStringType); |
- | l->setPoint(0, -54.0, -12.0); | + | l.setPoint(0, -54.0, -12.0); |
- | l->setPoint(1, -55.0, -13.0); | + | l.setPoint(1, -55.0, -13.0); |
</code> | </code> | ||
Line 363: | Line 363: | ||
std::unique_ptr<te::gm::Geometry> result( red->intersection( blue.get() ) ); | std::unique_ptr<te::gm::Geometry> result( red->intersection( blue.get() ) ); | ||
| | ||
- | std::cout << resultado->toString() << std::end; | + | std::cout << result->toString() << std::end; |
</code> | </code> | ||
Line 413: | Line 413: | ||
===== Buffer ===== | ===== Buffer ===== | ||
+ | <code cpp> | ||
+ | std::unique_ptr<te::gm::Geometry> poly( te::gm::WKTReader::read("POLYGON ( (6 3, 6 5, 9 5, 9 3, 6 3) )") ); | ||
+ | |||
+ | std::unique_ptr<te::gm::Geometry> result( poly->buffer(2.0) ); | ||
+ | | ||
+ | std::cout << result->toString() << std::endl; | ||
+ | </code> | ||
===== Metric Operators ===== | ===== Metric Operators ===== |