Re: Semi-newbie - postgres polygon/points and PHP?

From: Date: Sat, 16 Feb 2002 09:41:08 +0000
Subject: Re: Semi-newbie - postgres polygon/points and PHP?
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-16989@lists.php.net to get a copy of this message
Ok Roger, > Ok, a kinda newbie question. I set up a Postgres DB with a table that had a > Point and a Polygon in it (to hold XY and shape settings for munging a jpeg > image in php). > > I could not easily figure out how to extract the data into a reasonably easy > to use format in PHP. The best I could do seemed like it was extracted > into a string, and then I had to parse that. > While this works, it seems like a BIG hack to me, and the docs have been > less then forthcoming. > I've also tried the usual google search of "php postgres polygon" to see if > I could get an idea. > > For example, I stored the Point as: (432, 120) > And I got "(432, 120)" as a string, and had to parse it: If I understand you correctly, the cartesian coordinates are stored in the tbl as a string, eg CREATE TABLE room... id... xy tinytext... but each coordinate whilst a single entity is defined by two numbers. Why not store them as integers/reals on a single row, eg CREATE TABLE room... id... x int, y int... Regards, =dn

« previous php.db (#16989) next »