summaryrefslogtreecommitdiff
path: root/sql/spatial.h
diff options
context:
space:
mode:
authorunknown <jani@ua141d10.elisa.omakaista.fi>2005-10-31 11:54:36 +0200
committerunknown <jani@ua141d10.elisa.omakaista.fi>2005-10-31 11:54:36 +0200
commit5f6b100ed0eaacd644352972939a77f0a964c1af (patch)
treedb7782f75178512900e6e862142d57d3d0d96cf4 /sql/spatial.h
parent6de8b295a7dd53b47f7e0d4ebc109dabb07c6397 (diff)
parenta006453fad260a35df973a8785f0d9a8977c1cac (diff)
downloadmariadb-git-5f6b100ed0eaacd644352972939a77f0a964c1af.tar.gz
Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-4.1
into ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0-tmp client/mysqlimport.c: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/r/gis.result: Auto merged mysql-test/t/mysqldump.test: Auto merged sql/field.cc: Auto merged sql/item_geofunc.cc: Auto merged sql/spatial.cc: Auto merged sql/spatial.h: Auto merged support-files/my-huge.cnf.sh: Auto merged support-files/my-innodb-heavy-4G.cnf.sh: Auto merged support-files/my-large.cnf.sh: Auto merged mysql-test/mysql-test-run.sh: Merged from 4.1. mysql-test/r/mysqldump.result: Merged from 4.1. mysql-test/t/gis.test: Merged from 4.1.
Diffstat (limited to 'sql/spatial.h')
-rw-r--r--sql/spatial.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/sql/spatial.h b/sql/spatial.h
index b5ea7d641d1..6189d5c1462 100644
--- a/sql/spatial.h
+++ b/sql/spatial.h
@@ -207,6 +207,10 @@ public:
virtual const Class_info *get_class_info() const=0;
virtual uint32 get_data_size() const=0;
virtual bool init_from_wkt(Gis_read_stream *trs, String *wkb)=0;
+
+ /* returns the length of the wkb that was read */
+ virtual uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo,
+ String *res)=0;
virtual bool get_data_as_wkt(String *txt, const char **end) const=0;
virtual bool get_mbr(MBR *mbr, const char **end) const=0;
virtual bool dimension(uint32 *dim, const char **end) const=0;
@@ -236,11 +240,13 @@ public:
return my_reinterpret_cast(Geometry *)(buffer);
}
- static Geometry *create_from_wkb(Geometry_buffer *buffer,
- const char *data, uint32 data_len);
+ static Geometry *construct(Geometry_buffer *buffer,
+ const char *data, uint32 data_len);
static Geometry *create_from_wkt(Geometry_buffer *buffer,
Gis_read_stream *trs, String *wkt,
bool init_stream=1);
+ static int Geometry::create_from_wkb(Geometry_buffer *buffer,
+ const char *wkb, uint32 len, String *res);
int as_wkt(String *wkt, const char **end)
{
uint32 len= get_class_info()->m_name.length;
@@ -254,7 +260,7 @@ public:
return 0;
}
- inline void init_from_wkb(const char *data, uint32 data_len)
+ inline void set_data_ptr(const char *data, uint32 data_len)
{
m_data= data;
m_data_end= data + data_len;
@@ -298,6 +304,7 @@ class Gis_point: public Geometry
public:
uint32 get_data_size() const;
bool init_from_wkt(Gis_read_stream *trs, String *wkb);
+ uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res);
bool get_data_as_wkt(String *txt, const char **end) const;
bool get_mbr(MBR *mbr, const char **end) const;
@@ -344,6 +351,7 @@ class Gis_line_string: public Geometry
public:
uint32 get_data_size() const;
bool init_from_wkt(Gis_read_stream *trs, String *wkb);
+ uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res);
bool get_data_as_wkt(String *txt, const char **end) const;
bool get_mbr(MBR *mbr, const char **end) const;
int length(double *len) const;
@@ -369,6 +377,7 @@ class Gis_polygon: public Geometry
public:
uint32 get_data_size() const;
bool init_from_wkt(Gis_read_stream *trs, String *wkb);
+ uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res);
bool get_data_as_wkt(String *txt, const char **end) const;
bool get_mbr(MBR *mbr, const char **end) const;
int area(double *ar, const char **end) const;
@@ -394,6 +403,7 @@ class Gis_multi_point: public Geometry
public:
uint32 get_data_size() const;
bool init_from_wkt(Gis_read_stream *trs, String *wkb);
+ uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res);
bool get_data_as_wkt(String *txt, const char **end) const;
bool get_mbr(MBR *mbr, const char **end) const;
int num_geometries(uint32 *num) const;
@@ -415,6 +425,7 @@ class Gis_multi_line_string: public Geometry
public:
uint32 get_data_size() const;
bool init_from_wkt(Gis_read_stream *trs, String *wkb);
+ uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res);
bool get_data_as_wkt(String *txt, const char **end) const;
bool get_mbr(MBR *mbr, const char **end) const;
int num_geometries(uint32 *num) const;
@@ -438,6 +449,7 @@ class Gis_multi_polygon: public Geometry
public:
uint32 get_data_size() const;
bool init_from_wkt(Gis_read_stream *trs, String *wkb);
+ uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res);
bool get_data_as_wkt(String *txt, const char **end) const;
bool get_mbr(MBR *mbr, const char **end) const;
int num_geometries(uint32 *num) const;
@@ -461,6 +473,7 @@ class Gis_geometry_collection: public Geometry
public:
uint32 get_data_size() const;
bool init_from_wkt(Gis_read_stream *trs, String *wkb);
+ uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res);
bool get_data_as_wkt(String *txt, const char **end) const;
bool get_mbr(MBR *mbr, const char **end) const;
int num_geometries(uint32 *num) const;