[postgis-users] postgis query results to shape

René F. Viancos S. rviancos at gmail.com
Tue Feb 21 16:41:24 PST 2006


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20060221/355f7736/attachment.html>


More information about the postgis-users mailing list