[postgis-users] st_contains() function with polygon doesn´t work

2011-03-11 Thread zhang zhe
Hello, I am programming php application with postgres. I need to select the points which locate inside the polygon. Here is my code But it doesn´t work. I wonder, does the polygon()function only take integer/float as input? Sinct $stringPolygonCoordinate variable is string? I also tried to m

[postgis-users] query error when combining UPDATE, CASE and WHERE

2010-12-31 Thread zhang zhe
Hello, I try to update one column value based the other two column values´s conditions. This code works select book, case when table1.price>200 and table1.price<400 then '40'else book end from table 1 where table1.catalog='112'; Now I want to update the table1, so the book value will

Re: [postgis-users] import shape or sql to postgres automatically

2010-12-17 Thread zhang zhe
.cave-ayl...@siriusit.co.uk > To: postgis-users@postgis.refractions.net > Subject: Re: [postgis-users] import shape or sql to postgres automatically > > zhang zhe wrote: > > > Hello, > > > > Does anyone know how to import sql table or shape file to postgres >

Re: [postgis-users] import shape or sql to postgres automatically

2010-12-14 Thread zhang zhe
Hello, I might works this way. But I want to import the sql or shape file to postgres automaticlly without any manual work. I have php file, Í want to find the postgres query that could import a sql table to post gis. My php code could execute the query when user visit my web page. Do yo

Re: [postgis-users] import shape or sql to postgres automatically

2010-12-14 Thread zhang zhe
Hello, Thanks. Actually, I have windows and apache server installed in my computer. In this case how the code should look like? What´s the mylinuxserver ? is it the IP adress of the server? or name of the server? Will my code changed into psql.exe -h mywindowsServer -d postgres -U zhe -f

[postgis-users] import shape or sql to postgres automatically

2010-12-13 Thread zhang zhe
Hello, Does anyone know how to import sql table or shape file to postgres database automatically? What I did before is: I have shpe file save in C:/users I go to terminal in linux, and go to the directory C:/users C:/users shp2pgsql shapefile.shp > sqlfile.sql I will get sql file saved into c

[postgis-users] postgres case(conditional)statement problem

2010-12-04 Thread zhang zhe
Hello, Does anyone familiar with postgres case statement. I have a tale called selling1.sql, inside table there are two columns item(1,1,2,3,3,3,4,4,4) and price(234, 243, 245, 342, 124, 245, 343, 123,455.). I want to select the price where item id is equal to 1, and if its price is

Re: [postgis-users] How to select points within circle, thanks it works

2010-10-19 Thread zhang zhe
instead: select gid, the_geom, floorarea from "building" as m where ST_DWithin(m.geom,'POINT(306404701,6755737)'::geometry, 200.0); HTH Nicklas 2010-10-19 zhang zhe wrote: Hello, > > I have one table called building.sql which contains points. I want to select >

Re: [postgis-users] create xml file from sql table

2010-10-19 Thread zhang zhe
ption in pgAdmin. Regards, Josh From: postgis-users-boun...@postgis.refractions.net [mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of zhang zhe Sent: Tuesday, 19 October 2010 9:37 PM To: postgis-users@postgis.refractions.net Subject: [postgis-users] create xml file from sql table

Re: [postgis-users] create xml file from sql table

2010-10-19 Thread zhang zhe
alf Of zhang zhe Sent: Tuesday, 19 October 2010 9:37 PM To: postgis-users@postgis.refractions.net Subject: [postgis-users] create xml file from sql table Hello, Does anyone knows how to generate xml file from postgres table. select table_to_xml(‘building3’,true,true,’’); will print xml file

Re: [postgis-users] How to select points within circle

2010-10-19 Thread zhang zhe
-users] How to select points within circle Your syntax is a little backwards an it is better to use st_dwithin instead: select gid, the_geom, floorarea from "building" as m where ST_DWithin(m.geom,'POINT(306404701,6755737)'::geometry, 200.0); HTH Nicklas 2010-10-19 zha

[postgis-users] create xml file from sql table

2010-10-19 Thread zhang zhe
Hello, Does anyone knows how to generate xml file from postgres table. select table_to_xml(‘building3’,true,true,’’); will print xml file in data output . How can I generate a file, and save it to directory automatically. I want to write this function in php code. Thank you very much.

[postgis-users] How to select points within circle

2010-10-19 Thread zhang zhe
Hello, I have one table called building.sql which contains points. I want to select building which fall within a circle. This circle is not a sql table but instead only coordinate and radius such as circle(point '(0,0)', 2.0). My sql query is like this select gid, the_geom, floorarea from

[postgis-users] convert sql table to xml by using java script

2010-09-17 Thread zhang zhe
Hello, I want to convert postgres sql table to XML document automatically by using javascript code. For instance, if user open the URL,it will pop-up a window that allow user to save the XML file that converted from postgres table to any directory. I found some information from the Postgres h