TerraLib and TerraView Wiki Page

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revision Both sides next revision
wiki:documentation:mini_curso:geom [2016/01/19 10:09]
gribeiro created
wiki:documentation:mini_curso:geom [2016/01/19 14:28]
gribeiro
Line 2: Line 2:
  
 Script CMake: Script CMake:
-<code cmake>+<file cmake CMakeLists.txt>
 cmake_minimum_required(VERSION 2.8.12) cmake_minimum_required(VERSION 2.8.12)
  
Line 14: Line 14:
  
 if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPILER MATCHES "​.*clang"​) OR (CMAKE_CXX_COMPILER_ID STREQUAL "​Clang"​)) if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPILER MATCHES "​.*clang"​) OR (CMAKE_CXX_COMPILER_ID STREQUAL "​Clang"​))
-  set(CMAKE_CXX_FLAGS "​${CMAKE_CXX_FLAGS} -Wall -pedantic -std=c++14")+  set(CMAKE_CXX_FLAGS "​${CMAKE_CXX_FLAGS} -Wall -pedantic -std=c++11")
 endif() endif()
  
Line 30: Line 30:
                                               ${BOOST_SYSTEM_LIBRARY})                                               ${BOOST_SYSTEM_LIBRARY})
  
- +</file>
-</code>+
  
 Código: Código:
-<code cpp>+<file cpp main.cpp>
 // TerraLib // TerraLib
 +#include <​terralib/​common/​TerraLib.h>​
 #include <​terralib/​geometry/​Point.h>​ #include <​terralib/​geometry/​Point.h>​
 #include <​terralib/​geometry/​LineString.h>​ #include <​terralib/​geometry/​LineString.h>​
Line 49: Line 49:
 { {
   {   {
-    std::​unique_ptr<​te::​gm::​LinearRing>​ anel_vermelho = std::​make_unique<​te::​gm::​LinearRing>​(5,​ te::​gm::​LineStringType,​ 0);+    ​//std::​unique_ptr<​te::​gm::​LinearRing>​ anel_vermelho = std::​make_unique<​te::​gm::​LinearRing>​(5,​ te::​gm::​LineStringType,​ 0); 
 +    std::​unique_ptr<​te::​gm::​LinearRing>​ anel_vermelho( new te::​gm::​LinearRing(5,​ te::​gm::​LineStringType,​ 0) );
     anel_vermelho->​setPoint(0,​ 1, 2);     anel_vermelho->​setPoint(0,​ 1, 2);
     anel_vermelho->​setPoint(1,​ 1, 7);     anel_vermelho->​setPoint(1,​ 1, 7);
Line 55: Line 56:
     anel_vermelho->​setPoint(3,​ 7, 2);     anel_vermelho->​setPoint(3,​ 7, 2);
     anel_vermelho->​setPoint(4,​ 1, 2);     anel_vermelho->​setPoint(4,​ 1, 2);
-    ​+
     te::​gm::​Polygon poligono_vermelho(1,​ te::​gm::​PolygonType,​ 0);     te::​gm::​Polygon poligono_vermelho(1,​ te::​gm::​PolygonType,​ 0);
-    ​+
     poligono_vermelho.setRingN(0,​ anel_vermelho.release());​     poligono_vermelho.setRingN(0,​ anel_vermelho.release());​
-    ​ + 
-     + 
-    std::​unique_ptr<​te::​gm::​LinearRing>​ anel_azul = std::​make_unique<​te::​gm::​LinearRing>​(5,​ te::​gm::​LineStringType);​+    ​//std::​unique_ptr<​te::​gm::​LinearRing>​ anel_azul = std::​make_unique<​te::​gm::​LinearRing>​(5,​ te::​gm::​LineStringType); 
 +    std::​unique_ptr<​te::​gm::​LinearRing>​ anel_azul( new te::​gm::​LinearRing(5,​ te::​gm::​LineStringType) ​);
     anel_azul->​setPoint(0,​ 2, 3);     anel_azul->​setPoint(0,​ 2, 3);
     anel_azul->​setPoint(1,​ 2, 6);     anel_azul->​setPoint(1,​ 2, 6);
Line 67: Line 69:
     anel_azul->​setPoint(3,​ 6, 3);     anel_azul->​setPoint(3,​ 6, 3);
     anel_azul->​setPoint(4,​ 2, 3);     anel_azul->​setPoint(4,​ 2, 3);
-    ​+
     te::​gm::​Polygon poligono_azul(1,​ te::​gm::​PolygonType,​ 0);     te::​gm::​Polygon poligono_azul(1,​ te::​gm::​PolygonType,​ 0);
     ​     ​
Line 224: Line 226:
 int main(int argc, char* argv[]) int main(int argc, char* argv[])
 { {
-  ​//std::unique_ptr<​te::​gm::​Point>​ p = std::​make_unique<​te::​gm::​Point>​(-54.0, -12.0, 4326)+  ​TerraLib::getInstance().initialize(); 
-   +
-  //​std::​unique_ptr<​te::​gm::​LineString>​ l = std::​make_unique<​te::​gm::​ LineString>​(2,​ te::​gm::​LineStringType);​ +
-  +
-  //​l->​setPoint(0,​ -54.0, -12.0); +
-  //​l->​setPoint(1, -55.0, -13.0); +
-  +
   op_contains();​   op_contains();​
 +  ​
   op_within();​   op_within();​
 +  ​
   op_touches();​   op_touches();​
 +  ​
   op_intersection();​   op_intersection();​
 +  ​
   op_union();   op_union();
 +  ​
   op_buffer();​   op_buffer();​
   ​   ​
 +  TerraLib::​getInstance().finalize();​
 +
   return EXIT_SUCCESS;​   return EXIT_SUCCESS;​
 } }
 +</​file>​
 +
 +**3.** Opções do CMake:
 +<code cmake>
 +-DCMAKE_BUILD_TYPE:​STRING="​Debug"​
 +
 +-DCMAKE_PREFIX_PATH:​PATH="/​home/​terralib5/​mylibs;/​home/​terralib5/​mylibs/​terralib5/​lib/​cmake"​
 </​code>​ </​code>​
 +