PostgreSQL supports Geometric types and I have a database full of them. I'd like to use Perl with DBIx:Class to retrieve them.
For example the point type is defined as '(x,y)' and thats how DBIx::Class retrieves it. As a string.
I'd like to parse this into an array or some other more tangible datatype.
My current parsing attempts have involved stripping the brackets and then splitting which works fine for point but NOT for polygon:
(( x1 , y1 ) , ... , ( xn , yn ))
( x1 , y1 ) , ... , ( xn , yn )
( x1 , y1 , ... , xn , yn )
x1 , y1 , ... , xn , yn
My next thought was replacing ('s for ['s and then JSON parsing them which also works but I don't like it.
Does anyone have any suggestions for a cleaner parsing method?
Thanks