AW: [postgis-users] postgis query results to shape
Marco Lechner
marco.lechner at geographie.uni-freiburg.de
Wed Feb 22 07:00:23 PST 2006
Hi Jorge,
even if it's M$ Windows it should make a difference between the options -p and -P.
exec("pgsql2shp -f $new_shp_filename -h $host -p $port -u $user -P $password $database_name" \" $query \" ") should work on your
machine.
Try pgsql2shp.exe --help !
Marco
sometimes solutions are pretty near!
---------------------------------
Marco Lechner
office:
Department of Physical Geography
University of Freiburg
Werderring 4
D-79085 Freiburg
Germany
phone +49 (0)761 / 203-3548
email marco.lechner at geographie.uni-freiburg.de
-----Ursprüngliche Nachricht-----
Von: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net]Im Auftrag von Jorge
Arigony
Gesendet: Mittwoch, 22. Februar 2006 15:18
An: PostGIS Users Discussion
Betreff: Re: [postgis-users] postgis query results to shape
Muchas Gracias Réne,
But I still have two problems:
(1) I am using PostgreSQL/PostGIS on WinXP, so the DOS does not differentiate "-p" from "-P"...
any suggestion?
(2) When I don't use a password to connect to the database, I receive the following message:
'FATAL: database "username" does not exist' , but "username" is not the database, it is my username for this computer.
I'm trying:
pgsql2shp -f test.shp database table
Does someone have an advice?
Thank you very much,
Jorge
At 01:41 22.02.2006, you wrote:
Hi Jorge, you can try this:
<?
$new_shp_filename = "...system_path/new.shp";
$host = "localhost"; // or your host name or IP Adress
$port = "5432"; // may be another
$user = "postgres"; // or your postgres user
$password = "*******"; // top secret :)
$database_name = "gisdata"; // the database with the geomatries and the tabular data
$query = "SELECT some_geom_function(the_geom) AS the_geom, field1, field2, ..., fieldN FROM table_name WHERE ... some condition";
exec("pgsql2shp -f $new_shp_filename -h $host -p $port -u $user -P $password $database_name" \" $query \" ")
?>
Best Regards from Chile
René Felipe Viancos
2006/2/21, Jorge Arigony <arigony at web.de>:
Hi listers,
how can i export automatically each row from a query result to a different new shape?
I am using php to query the database from a browser.
Thanks in advance,
Jorge Arigony
______________________________________________________________________
XXL-Speicher, PC-Virenschutz, Spartarife & mehr: Nur im WEB.DE Club!
Jetzt gratis testen! http://freemail.web.de/home/landingpad/?mc=021130
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
--
René F. Viáncos S.
Director de Geomática y TIC
Vicerrectoría de Investigación y Desarrollo
Universidad de Chile
Tel (56-2) 632 62 09
Cel (56 9) 933 72 66
rviancos at uchile.cl
rviancos at gmail.com
www.investigacion.uchile.cl
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
More information about the postgis-users
mailing list