java - Extract BLOB polygon from MySQL database? -


i developing web application stores polygons in database using jsf. able store polygon in field of row using polygon datatype in mysql, polygon appears blob in database.

however unsure on how access polygon in each row using row-sets in jdbc. ideally convert data polygon blob latlng array.

i aware can returned wkt using mysql

(select * st_astext(markers) paddock)  

but i'm unsure how access in java. if has ideas, please feel free share, thank you.

i have found answer question. used above mysql statement returns string value , used java regular expression in order extract coordinates

                    polygon polygon = new polygon();                     string value = rs.getstring(1);                     string valuereal = value.replaceall("[^0-9 .,]+", "");                     arraylist<string> mylist = new arraylist<string>(arrays.aslist(valuereal.split(","))); 

the regular expression above allows numbers, dots , commas blob polygon type in mysql, split used store in string array.


Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -