MySQL Forums
Forum List  »  GIS

Re: Cannot get geometry object from data you send to the GEOMETRY field
Posted by: Albert Rovira
Date: September 07, 2012 02:20PM

Hi,

You must ensure you build a valid WKT geometry. If you have a simple polygon you must format like:

POLYGON((x0 y0, x1 y1, x2 y2, ... , xn yn, x0 y0))

so something like

insert into tbl_bdy_geom (code,bdy,geoloc)
select code,bdy,polyFromText(concat( 'POLYGON((', REPLACE(`bdy`, '|', ',') , '))' ) from `tbl_bdy;

does the job if on your coordinate sequence has the same point on the first and the last position.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Cannot get geometry object from data you send to the GEOMETRY field
6588
September 07, 2012 02:20PM


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.