Freitag, 25. Juli 2008

VC++ Includeverzeichniss Makros

Using macros to configure projects.

Eigenschaft -> C/C++ -> Allgemein -> Zusaetzliche Includeverzeichniss -> Makros>>

Oracle Coordinate System Transformation Functions

-- how to extract srids
SELECT *
FROM mdsys.cs_srs cs
WHERE cs.cs_name LIKE '%UTM%'
AND cs.cs_name LIKE '%32%';

-- how to make a spatial point (WGS84)
SELECT mdsys.sdo_geometry(2001, 8307, mdsys.sdo_point_type(n.x, n.y, NULL), NULL, NULL) AS geometry
FROM nodes n;

-- how to make a converted spatial point (UTM Zone 32, Northern Hemisphere (WGS 84))
SELECT t.geometry.sdo_point.x as x, t.geometry.sdo_point.y as y FROM (SELECT sdo_cs.transform(mdsys.sdo_geometry(2001, 8307, mdsys.sdo_point_type(n.x, n.y, NULL), NULL, NULL), 82344) AS geometry FROM nodes n) t;

82344 is SRID for UTM Zone 32, Northern Hemisphere (WGS 84).

Donnerstag, 24. Juli 2008

Polymorphism

// abstract base class
#include
using namespace std;

class CPolygon {
protected:
int width, height;
public:
void set_values (int a, int b)
{ width=a; height=b; }
virtual int area (void) =0;
};

class CRectangle: public CPolygon {
public:
int area (void)
{ return (width * height); }
};

class CTriangle: public CPolygon {
public:
int area (void)
{ return (width * height / 2); }
};

int main () {
CRectangle rect;
CTriangle trgl;
CPolygon * ppoly1 = ▭
CPolygon * ppoly2 = &trgl;
ppoly1->set_values (4,5);
ppoly2->set_values (4,5);
ppoly1->area();
ppoly2->area();
return 0;
}

Abstract Class vs. Interface

Abstract Class: can have non-abstract method; can have member variables; all the abstract methods must be overwritten in the extended classes.

Interface: describe some common rules, thus all methods are abstract; all member variables must be final static; In java, interface can be used for multi-inheritance purpose.

Montag, 21. Juli 2008

Geodetic coordinates translation - useful links

http://psas.pdx.edu/CoordinateSystem/Latitude_to_LocalTangent.pdf

http://en.wikipedia.org/wiki/Geodetic_system

http://www.cplusplus.com/reference/clibrary/cmath/

Montag, 14. Juli 2008

IMP and EXP with data pump

$ expdp hr/hr DIRECTORY=exp_dir DUMPFILE=hr_exp.dmp LOGFILE=hr_exp.log

$ CREATE DIRECTORY dir_dump AS 'D:/tmp'

create user hr2

$ GRANT READ, WRITE ON DIRECTORY dir_dump TO hr2

$ impdp hr2/hr2 SCHEMAS=hr2 DIRECTORY=dir_dump LOGFILE=hr2_imp.log DUMPFILE=hr_exp.dmp