MySQL Forums
Forum List  »  GIS

Geometry building and C++ UDF library
Posted by: Sebastien Thomas
Date: June 29, 2009 08:08AM

Hello,
I'm using mysql-5.1.23-beta-GIS to develop some function in C++ (the goal is to get something faster than stored procedures)

Everything seems to be alright as long as i'm using POINT parameters, but i got into trouble with more complex Geometries. Being given a polygon, i want to access its "exterior_ring". I'm using something like this :

Geometry *g, *g2;
GeometryBuffer buffer;
String s, s_tmp;
uint32 n_points;
...
g->exterior_ring(&s);
g2 = Geometry::create_from_wkb(&buffer, s.ptr(), s.length(), &s_tmp);
g2->num_points(&n_points);
Log(n_points : %d", n_points);

g2 seems to be created, but n_points returns 39314552 whereas calling : "select numpoints(exteriorring(geom))" in sql returns 2504 points, which is much more correct.

Is there anything i do wrong creating g2 ? I couldn't find any information on how to use the string i got from g->exterior_ring(&s);



Edited 2 time(s). Last edit at 06/29/2009 08:17AM by Sebastien Thomas.

Options: ReplyQuote


Subject
Views
Written By
Posted
Geometry building and C++ UDF library
4922
June 29, 2009 08:08AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.