OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimGdalOgrVectorAnnotation.h
Go to the documentation of this file.
1 //*******************************************************************
2 // License: LGPL
3 //
4 // See top level LICENSE.txt file.
5 //
6 // Author: Garrett Potts
7 //
8 // Description:
9 //
10 // Contains class implementaiton for the class "ossimOgrGdalTileSource".
11 //
12 //*******************************************************************
13 // $Id: ossimGdalOgrVectorAnnotation.h 19733 2011-06-06 23:35:25Z dburken $
14 #ifndef ossimGdalOgrVectorAnnotation_HEADER
15 #define ossimGdalOgrVectorAnnotation_HEADER
16 
17 #include <map>
18 #include <vector>
19 #include <list>
20 #include <gdal.h>
21 #include <ogrsf_frmts.h>
28 
29 class ossimProjection;
30 class ossimMapProjection;
34 
36  public ossimAnnotationSource,
37  public ossimViewInterface
38 {
39 public:
42  virtual bool open();
43  virtual bool open(const ossimFilename& file);
44  virtual bool isOpen()const;
45  virtual void close();
46  virtual ossimFilename getFilename()const;
47 
48  virtual bool setView(ossimObject* baseObject);
49 
50  virtual ossimObject* getView();
51  virtual const ossimObject* getView()const;
52 
56 
57  virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0)const;
58  virtual void computeBoundingRect();
59 
61 
62 
63  virtual void setBrushColor(const ossimRgbVector& brushColor);
64  virtual void setPenColor(const ossimRgbVector& penColor);
65  virtual ossimRgbVector getPenColor()const;
66  virtual ossimRgbVector getBrushColor()const;
67  virtual double getPointRadius()const;
68  virtual void setPointRadius(double r);
69  virtual bool getFillFlag()const;
70  virtual void setFillFlag(bool flag);
71  virtual void setThickness(ossim_int32 thickness);
72  virtual ossim_int32 getThickness()const;
73 
74  virtual void setProperty(ossimRefPtr<ossimProperty> property);
75  virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
76  virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
77 
78  virtual bool saveState(ossimKeywordlist& kwl,
79  const char* prefix=0)const;
80 
81  virtual bool loadState(const ossimKeywordlist& kwl,
82  const char* prefix=0);
83 
84  virtual std::ostream& print(std::ostream& out) const;
85 
86  std::multimap<long, ossimAnnotationObject*> getFeatureTable();
87 
88  void setQuery(const ossimString& query);
89 
90  void setGeometryBuffer(ossim_float64 distance, ossimUnitType type);
91 
92  //OGRLayer::GetExtent() returns the MBR (minimal bounding rect) of the data in the layer.
93  //So when only do ossim-info, it is not necessary to go through each feature to calculate
94  //the bounding which cause the memory allocate problem when the shape file is large.
95  void initializeBoundingRec(vector<ossimGpt> points);
96 
97  bool setCurrentEntry(ossim_uint32 entryIdx);
98 
99 protected:
100  OGRDataSource *theDataSource;
101  OGRSFDriver *theDriver;
103  OGREnvelope theBoundingExtent;
106  std::vector<ossimOgrGdalLayerNode*> theLayerTable;
116 
117  std::multimap<long, ossimAnnotationObject*> theFeatureCacheTable;
118 
124  std::vector<ossimString> m_layerNames;
125 
126  void computeDefaultView();
127 
129  void transformObjectsFromView();
130 
131  void loadPoint(long id, OGRPoint* point, ossimMapProjection* mapProj);
132  void loadMultiPoint(long id, OGRMultiPoint* multiPoint, ossimMapProjection* mapProj);
133  void loadMultiPolygon(long id, OGRMultiPolygon* multiPolygon, ossimMapProjection* mapProj);
134  void loadPolygon(long id, OGRPolygon* polygon, ossimMapProjection* mapProj);
135  void loadLineString(long id, OGRLineString* lineString, ossimMapProjection* mapProj);
136  void loadMultiLineString(long id, OGRMultiLineString* multiLineString, ossimMapProjection* mapProj);
137 
138  void getFeatures(std::list<long>& result,
139  const ossimIrect& rect);
140  void getFeature(vector<ossimAnnotationObject*>& featureList,
141  long id);
142  ossimProjection* createProjFromReference(OGRSpatialReference* reference)const;
143  void initializeTables();
144  void deleteTables();
145  void updateAnnotationSettings();
146 
151  void loadExternalGeometryFile();
152 
157  void loadExternalImageGeometryFromXml();
158 
162  void loadOmdFile();
163 
171  void getDefaults();
172 
177  void verifyViewParams();
178 
179 TYPE_DATA
180 
181 }; // End of: class ossimGdalOgrVectorAnnotation
182 
183 #endif
std::multimap< long, ossimAnnotationObject * > theFeatureCacheTable
virtual void setProperty(ossimRefPtr< ossimProperty > property)
ossimRefPtr< ossimImageGeometry > theImageGeometry
ossimUnitType
Represents serializable keyword/value map.
double ossim_float64
virtual std::ostream & print(std::ostream &out) const
Outputs theErrorStatus as an ossimErrorCode and an ossimString.
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
virtual void drawAnnotations(ossimRefPtr< ossimImageData > tile)
#define TYPE_DATA
Definition: ossimRtti.h:339
unsigned int ossim_uint32
#define OSSIM_PLUGINS_DLL
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if not defined...
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
std::vector< ossimOgrGdalLayerNode * > theLayerTable
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
virtual bool setView(ossimObject *baseObject)=0
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
virtual ossimObject * getView()=0
float distance(double lat1, double lon1, double lat2, double lon2, int units)
std::vector< ossimString > m_layerNames
unsigned char ossim_uint8
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
int ossim_int32