Re: [postgis-users] Kyng chaos Postgis -- PostGIS requires PostgreSQL 9.0.

2010-12-13 Thread Mark Cave-Ayland

fork wrote:


Hi all,

Not sure where else to ask -- I just installed Postgresql 9.0.1 from
the Kyngesbury site, now trying to install postgis, and I get this
error:

PostGIS requires PostgreSQL 9.0.

Anyone have any ideas?  Does this mean I can't find any postgres? or
I can't find the right version or ???

Thanks!


There was a bug in PostGIS 1.5.1 that would probably cause this error 
(related to the change in version number from PostgreSQL 8.5 to 9.0). 
Can you confirm that you are using PostGIS 1.5.2?



ATB,

Mark.

--
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[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:/users directory. I open the sql file copy all 
the sql query. After that I open postgres database, and paste all the query to 
sql query window, and run the query. I will have new table appear in the 
dabase. 
 
Sometimes the sql table is too large, that I cannot paste them all in the 
postgres sql query window. Postgres is always get stuck because of the query is 
too large.For instance I have road dataset of whole contry, and it has really 
millions of queries. Is there any way to import shape file or sql table to 
Postgres database automatically without any manual work? 
 
I am now developing a application in php. In php, is there method to import a 
sql table or shape file to Postgres automatically? I know with php there is way 
to connect postgres and run the query.
 
$query 1=import sql table to postgres;
pg_query($query1) or die ('query1 failed'. pg_last_erro());
 
Is there any query could import sql table to postgres automatically? 
 
Thanks a lot:)
  ___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


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

2010-12-13 Thread Mark Cave-Ayland

zhang zhe wrote:


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:/users directory. I open the sql file 
copy all the sql query. After that I open postgres database, and paste 
all the query to sql query window, and run the query. I will have new 
table appear in the dabase.
 
Sometimes the sql table is too large, that I cannot paste them all in 
the postgres sql query window. Postgres is always get stuck because of 
the query is too large.For instance I have road dataset of whole contry, 
and it has really millions of queries. Is there any way to import shape 
file or sql table to Postgres database automatically without any manual 
work?


Assuming you have the PostgreSQL client installed on your local Windows 
workstation, it sounds as if you need to pass the -f option to psql and 
then use -h to connect to your linux server instead, e.g:


psql.exe -h mylinuxserver -d mydatabase -U myuser
-f c:/users/sqlfile.sql

HTH,

Mark.

--
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


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

2010-12-13 Thread Robert Buckley
Hi,

I find it easyest with the built in GUI from the opengeosuite. You can download 
the community edition and use the whole Shape2postgis import tool as part of 
the 
deal

here is the link to the download.
http://opengeo.org/community/suite/download/

Simply install the desktop version and start the dashboard. In PGAdmin3 for 
Opengeo there is the llink to the postgis importer tool.

Hope this helps,

Robert Buckley


___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Kyng chaos Postgis -- PostGIS requires PostgreSQL 9.0.

2010-12-13 Thread William Kyngesburye
On Dec 13, 2010, at 5:06 AM, Mark Cave-Ayland wrote:

 fork wrote:
 
 Hi all,
 Not sure where else to ask -- I just installed Postgresql 9.0.1 from
 the Kyngesbury site, now trying to install postgis, and I get this
 error:
 PostGIS requires PostgreSQL 9.0.
 Anyone have any ideas?  Does this mean I can't find any postgres? or
 I can't find the right version or ???
 Thanks!
 
 There was a bug in PostGIS 1.5.1 that would probably cause this error 
 (related to the change in version number from PostgreSQL 8.5 to 9.0). Can you 
 confirm that you are using PostGIS 1.5.2?
 
That looks like it's straight from my OS X installer, so PostGIS itself hasn't 
tried to run yet.

The installer checks for the existence of 
/usr/local/pgsql-9.0/lib/libpq.5.3.dylib.  Are you sure the Postgres install 
finished and succeeded?

Is this a new install or upgrade of Postgres/PostGIS?

-
William Kyngesburye kyngchaos*at*kyngchaos*dot*com
http://www.kyngchaos.com/

Those people who most want to rule people are, ipso-facto, those least suited 
to do it.

- A rule of the universe, from the HitchHiker's Guide to the Galaxy


___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] Converting Geometry to WKT

2010-12-13 Thread Adam Eskreis
Hey all,

I was wondering if there was any documentation out there on how to convert
PostGIS geometry to WKT.  The reason that I need this is I am looking to
write a PHP library that will allow me to pull PostGIS geometry directly
from the database (without having to use the AsText() function) and put the
resulting geometries into PHP objects (such as a Point object, Polygon
object, ect).  This is essential for my application.  I have written the PHP
class already to accept WKT, but I want to take it to the next level and
actually parse the raw geometry.  I've done a lot of searching on google and
haven't been able to find anything similar nor could I find any
documentation about how PostGIS stores geometry.  Can anyone who has
undertaken this before give me a nudge in the right direction?  Thanks.

-Adam
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Converting Geometry to WKT

2010-12-13 Thread strk
On Mon, Dec 13, 2010 at 12:41:47PM -0500, Adam Eskreis wrote:

 I was wondering if there was any documentation out there on how to convert
 PostGIS geometry to WKT.  

selet asWKT(geometry) ?

--strk;

  ()   Free GIS  Flash consultant/developer
  /\   http://strk.keybit.net/services.html
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Converting Geometry to WKT

2010-12-13 Thread Adam Eskreis
Thank you so much Paul, this was exactly what I was looking for.

And strk, thank you for your response, but I am well aware of the asWKT and
asText functions, what I am trying to do is AVOID using these functions, and
parse the geometry myself.

On Mon, Dec 13, 2010 at 12:55 PM, strk s...@keybit.net wrote:

 On Mon, Dec 13, 2010 at 12:41:47PM -0500, Adam Eskreis wrote:

  I was wondering if there was any documentation out there on how to
 convert
  PostGIS geometry to WKT.

 selet asWKT(geometry) ?

 --strk;

  ()   Free GIS  Flash consultant/developer
  /\   http://strk.keybit.net/services.html
 ___
 postgis-users mailing list
 postgis-users@postgis.refractions.net
 http://postgis.refractions.net/mailman/listinfo/postgis-users

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Converting Geometry to WKT

2010-12-13 Thread strk
On Mon, Dec 13, 2010 at 01:00:55PM -0500, Adam Eskreis wrote:
 Thank you so much Paul, this was exactly what I was looking for.
 
 And strk, thank you for your response, but I am well aware of the asWKT and
 asText functions, what I am trying to do is AVOID using these functions, and
 parse the geometry myself.

Ah, sorry.
Btw, have you looked at the GEOS PHP binding ?
It does have an HEXEWKB parser up to 3d.

--strk;

  ()   Free GIS  Flash consultant/developer
  /\   http://strk.keybit.net/services.html
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Converting Geometry to WKT

2010-12-13 Thread Adam Eskreis
Thank you for that tip strk, I will look into that.

On Mon, Dec 13, 2010 at 1:25 PM, strk s...@keybit.net wrote:

 On Mon, Dec 13, 2010 at 01:00:55PM -0500, Adam Eskreis wrote:
  Thank you so much Paul, this was exactly what I was looking for.
 
  And strk, thank you for your response, but I am well aware of the asWKT
 and
  asText functions, what I am trying to do is AVOID using these functions,
 and
  parse the geometry myself.

 Ah, sorry.
 Btw, have you looked at the GEOS PHP binding ?
 It does have an HEXEWKB parser up to 3d.

 --strk;

  ()   Free GIS  Flash consultant/developer
  /\   http://strk.keybit.net/services.html
 ___
 postgis-users mailing list
 postgis-users@postgis.refractions.net
 http://postgis.refractions.net/mailman/listinfo/postgis-users

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Kyng chaos Postgis -- PostGIS requires PostgreSQL 9.0.

2010-12-13 Thread fork
 That looks like it's straight from my OS X installer, so PostGIS itself 
 hasn't tried to run yet.

 The installer checks for the existence of 
 /usr/local/pgsql-9.0/lib/libpq.5.3.dylib.  Are you sure the Postgres install 
 finished and succeeded?

Yes, but it installs as an app, not in that directory

 Is this a new install or upgrade of Postgres/PostGIS?

New, and I *think* i used your binary.

 -
 William Kyngesburye kyngchaos*at*kyngchaos*dot*com
 http://www.kyngchaos.com/

 Those people who most want to rule people are, ipso-facto, those least 
 suited to do it.

 - A rule of the universe, from the HitchHiker's Guide to the Galaxy






-- 
Asking a question on a newsgroup?  Read this first:
http://www.catb.org/~esr/faqs/smart-questions.html
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


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

2010-12-13 Thread Ben Madin
Can you not just pipe it in : (from the manual)

shp2pgsql shaperoads.shp myschema.roadstable | psql -d roadsdb

or use the \i metacommand to run the created script.

cheers

Ben



On 13/12/2010, at 10:22 PM, zhang zhe wrote:

 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:/users directory. I open the sql file copy 
 all the sql query. After that I open postgres database, and paste all the 
 query to sql query window, and run the query. I will have new table appear in 
 the dabase. 
  
 Sometimes the sql table is too large, that I cannot paste them all in the 
 postgres sql query window. Postgres is always get stuck because of the query 
 is too large.For instance I have road dataset of whole contry, and it has 
 really millions of queries. Is there any way to import shape file or sql 
 table to Postgres database automatically without any manual work? 
  
 I am now developing a application in php. In php, is there method to import a 
 sql table or shape file to Postgres automatically? I know with php there is 
 way to connect postgres and run the query.
  
 $query 1=import sql table to postgres;
 pg_query($query1) or die ('query1 failed'. pg_last_erro());
  
 Is there any query could import sql table to postgres automatically? 
  
 Thanks a lot:)
  
 ___
 postgis-users mailing list
 postgis-users@postgis.refractions.net
 http://postgis.refractions.net/mailman/listinfo/postgis-users

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Kyng chaos Postgis -- PostGIS requires PostgreSQL 9.0.

2010-12-13 Thread William Kyngesburye
On Dec 13, 2010, at 2:15 PM, fork wrote:

 That looks like it's straight from my OS X installer, so PostGIS itself 
 hasn't tried to run yet.
 
 The installer checks for the existence of 
 /usr/local/pgsql-9.0/lib/libpq.5.3.dylib.  Are you sure the Postgres install 
 finished and succeeded?
 
 Yes, but it installs as an app, not in that directory
 
Ah, my Postgres installer does not install as an application.  And my PostGIS 
package only supports my Postgres package (or other Postgres built from source 
in the standard way in /usr/local/pgsql-9.0).

 Is this a new install or upgrade of Postgres/PostGIS?
 
 New, and I *think* i used your binary.

-
William Kyngesburye kyngchaos*at*kyngchaos*dot*com
http://www.kyngchaos.com/

Oh, look, I seem to have fallen down a deep, dark hole.  Now what does that 
remind me of?  Ah, yes - life.

- Marvin


___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Diagram of Voronoï to Squelettis ation of polygon

2010-12-13 Thread Daniel Kastl
Hi Jérôme,

As you said the idea would be to add a function that calculates a skeleton
from a polygon.

Currently pgRouting contains a couple of functions (
http://www.pgrouting.org/docs/1.x/index.html), but all of them require
network data with at least information about start and end ID of a
linestring. If the information about start and end ID doesn't exist yet,
you can run a function called assign_vertex_id. But what you need is
network data.

Your skeleton function now would allow users to add one more step before and
retrieve a network from polygon data. So one could first run the skeleton
function, then the  assign_vertex_id function and finally have all the
routing functions available even if the original data was of polygon shape.

pgRouting has it's source code on GitHub (https://github.com/pgRouting/).
The assign_vertex_id function is here:
https://github.com/pgRouting/pgrouting/blob/master/core/sql/routing_topology.sql.
Though I'm not sure it wouldn't be a good idea to reorganize this a bit.
Well, I think we might better discuss details on the pgRouting list:
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

Best regards,
Daniel



2010/12/11 j.rolland jrmroll...@aol.com


 Hi Daniel,

 Of course that I am interested, say me how I can contribute my share.
 As I indicate it in my blog, I can develop a function which turns over the
 skeleton from a polygon. Give me your specifications and I would study
 them.


 cordially,
 Jérôme


 Daniel Kastl-3 wrote:
 
  Salut Jérôme,
 
  Thank you for sharing your blog article!
  I tried to recall my French from high school and thanks to nice
  screenshots
  and code samples I think I could mostly understand.
 
  Well, I thought your functions might be an interesting contribution to
  pgRouting project (http://www.pgrouting.org).
  We're trying to collect various routing and network analysis related
  functionality. Some voronoi and skeleton addition would for sure suite
  well.
  That way users could build some routable network out of river polygons
 for
  example. It might also help to build a routable graph for  maritime
  navigation. Probably there are a lot more use cases.
 
  Let me know if you're interested.
 
  Daniel
 
 
  2010/12/9 j.rolland jrmroll...@aol.com
 
 
  hi,
 
  I have just set up on my blog at the following address
  http://ageoguy.blogspot.com/2010/12/squ… ation.html
  http://ageoguy.blogspot.com/2010/12/squ… ation.html  a tutorial (in
  french)
  which presents an algorithm of surface squelettisation of waterway
  (POLYGON).
  I provide an example like all the necessary functions and requests which
  will enable you to obtain the skeleton of the waterway as you can see it
  in
  the capture below :
 
  http://old.nabble.com/file/p30413623/skeleton5.jpg
 
 
  regards,
  Jérôme
  --
  View this message in context:
 
 http://old.nabble.com/Diagram-of-Vorono%C3%AF-to-Squelettisation-of-polygon-tp30413623p30413623.html
  Sent from the PostGIS - User mailing list archive at Nabble.com.
 
  ___
  postgis-users mailing list
  postgis-users@postgis.refractions.net
  http://postgis.refractions.net/mailman/listinfo/postgis-users
 
 
 
 
  --
  Georepublic UG  Georepublic Japan
  eMail: daniel.ka...@georepublic.de
  Web: http://georepublic.de
 
  ___
  postgis-users mailing list
  postgis-users@postgis.refractions.net
  http://postgis.refractions.net/mailman/listinfo/postgis-users
 
 

 --
 View this message in context:
 http://old.nabble.com/Diagram-of-Vorono%C3%AF-to-Squelettisation-of-polygon-tp30413623p30428747.html
 Sent from the PostGIS - User mailing list archive at Nabble.com.

 ___
 postgis-users mailing list
 postgis-users@postgis.refractions.net
 http://postgis.refractions.net/mailman/listinfo/postgis-users




-- 
Georepublic UG  Georepublic Japan
eMail: daniel.ka...@georepublic.de
Web: http://georepublic.de
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users