Re: [postgis-users] Not what I was expecting....

2012-10-11 Thread Jeff Lake
Thank you !!! set the column 'the_geom' to the correct SRID .. and now this works SELECT ST_AsText(ST_Transform(ST_GeomFromText(the_geom,3347),4326)) FROM canada WHERE name LIKE 'Caledon' *Jeff Lake* MichiganWxSystem AllisonHouse

Re: [postgis-users] Not what I was expecting....

2012-10-11 Thread Paul Ramsey
Find the .prj file next to your .shp file and plug it into here http://prj2epsg.org/search P On Thu, Oct 11, 2012 at 4:38 PM, Jeff Lake wrote: > I obtained a shape file from Environment Canada, > imported it into a postGIS enabled database with shp2pgsql with no problem. > > queried the table an

[postgis-users] Not what I was expecting....

2012-10-11 Thread Jeff Lake
I obtained a shape file from Environment Canada, imported it into a postGIS enabled database with shp2pgsql with no problem. queried the table and noticed the SRID was -1, reset it with UpdateGeometrySRID to 4326 now when query the table I get the following (had the same results before updati

Re: [postgis-users] "service" field in postgres

2012-10-11 Thread Andreas Neumann
Hi, The service field allows to tie a connection to a service name instead of to a fixed hostname/port connection. If you want to move around QGIS projects between different machines (sometimes the database is on local host, sometimes it is in production environment on a dedicated db server), it i

Re: [postgis-users] "service" field in postgres

2012-10-11 Thread Mike Toews
On 12 October 2012 06:17, Sandro Santilli wrote: > You can leave that field blank. I've actually no idea what it is used for. >From what I understand, it is used for a PostgreSQL service connection. See: http://hub.qgis.org/issues/3522 http://www.postgresql.org/docs/current/static/libpq-pgservice

Re: [postgis-users] "service" field in postgres

2012-10-11 Thread Francois Hugues
I left it blank and it works To import shape to postgis you will have to use shp2pgsql Did you made an install of postgis : it works with postgresql but is not included in postgresql. It is another install process. Hugues. De : postgis-users-boun...

Re: [postgis-users] "service" field in postgres

2012-10-11 Thread chathura silva
I have a shapefile of road network. Do you know how to import it to postgreSQL ? ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users

Re: [postgis-users] "service" field in postgres

2012-10-11 Thread Sandro Santilli
On Thu, Oct 11, 2012 at 11:10:30PM +0530, chathura silva wrote: > I try it by making it blank, but does not work :( I suggest you carefully read the qgis user manual and if you still have troubles ask on the qgis-users mailing list. It will help, if you ask, to include more information about _how

Re: [postgis-users] "service" field in postgres

2012-10-11 Thread chathura silva
I try it by making it blank, but does not work :( On Thu, Oct 11, 2012 at 10:47 PM, Sandro Santilli wrote: > On Thu, Oct 11, 2012 at 06:05:10PM +0530, chathura silva wrote: > > hi all, > > > > when I try to connect postgresQL via Quantumgis (QGIS) , it asks for a > > service field to connect to

Re: [postgis-users] "service" field in postgres

2012-10-11 Thread Sandro Santilli
On Thu, Oct 11, 2012 at 06:05:10PM +0530, chathura silva wrote: > hi all, > > when I try to connect postgresQL via Quantumgis (QGIS) , it asks for a > service field to connect to the server. What is the value of the field > "service" ?? You can leave that field blank. I've actually no idea what i

Re: [postgis-users] Select polygons within polygon with PostGIS 2.0

2012-10-11 Thread Sandro Santilli
On Thu, Oct 11, 2012 at 01:21:25PM +0200, Michal Zimmermann wrote: > Yep, I have TopoGeometry fields. > -- counties > "Topology topo_kraje (12), SRID 4326, precision 0 > 36 nodes, 48 edges, 14 faces, 14 topogeoms in 1 layers > Layer 1, type Polygonal (3), 14 topogeoms > Deploy: edpp.kraje.topo > "

[postgis-users] Confused about results of spherical vs spheroidal area calculations

2012-10-11 Thread Peter Clark
Hi: I'm surprised at the discrepancy of area calculations from this query: --- WITH shapes as ( select 1 as rownum, ST_GeogFromText('POLYGON((-144 -63,-144 -54,-126 -54,-126 -63,-144 -63))') as shape union select 2 as rownum, ST_GeogFromText('POLYGON((-90 -63,-90 -54,-72 -54,-

Re: [postgis-users] Geographies, geometries, international date line

2012-10-11 Thread Maxime Poulin
Quote from Paul: --- Not if your table is using the geography type. Geography doesn't care about datelines or poles, it laughs in the faces of cartesian singularities. --- Yes, I saw that. The thing is the way our polygons are created. They are created by geographers and historically they used a

Re: [postgis-users] Geographies, geometries, international date line

2012-10-11 Thread Paul Ramsey
On Wed, Oct 10, 2012 at 1:27 PM, Maxime Poulin wrote: > I was expecting the geometry version to be much faster, but I actually find > that performance is somewhat the same. Both queries use the special index, > perform the index scan and so on. So how can this be possible, how can I be > sure tha

Re: [postgis-users] Geographies, geometries, international date line

2012-10-11 Thread Paul Ramsey
On Thu, Oct 11, 2012 at 12:12 AM, Nicolas Ribot wrote: > Hi Maxime, > > Yes indeed, the new geography type take advantage of a very fast Gist > index,often leading to queries faster than their geometry equivalent > (see Paul Ramsey's blog about this new type). > St_distance might also benefit from

[postgis-users] "service" field in postgres

2012-10-11 Thread chathura silva
hi all, when I try to connect postgresQL via Quantumgis (QGIS) , it asks for a service field to connect to the server. What is the value of the field "service" ?? thank you chathura ___ postgis-users mailing list postgis-users@postgis.refractions.net ht

Re: [postgis-users] Select polygons within polygon with PostGIS 2.0

2012-10-11 Thread Michal Zimmermann
Yep, I have TopoGeometry fields. -- counties "Topology topo_kraje (12), SRID 4326, precision 0 36 nodes, 48 edges, 14 faces, 14 topogeoms in 1 layers Layer 1, type Polygonal (3), 14 topogeoms Deploy: edpp.kraje.topo " -- districts "Topology topo_orp (13), SRID 4326, precision 0 962 nodes, 1611 edg

Re: [postgis-users] Select polygons within polygon with PostGIS 2.0

2012-10-11 Thread Sandro Santilli
On Thu, Oct 11, 2012 at 12:10:34PM +0200, Michal Zimmermann wrote: > Sandro, > earlier you said > >One benefit is making the spatial relationships explicit, so that > > you could encode your counties as being composed by the districts, > > and the districts would be composed by faces, which would b

Re: [postgis-users] Select polygons within polygon with PostGIS 2.0

2012-10-11 Thread Michal Zimmermann
Sandro, earlier you said >One benefit is making the spatial relationships explicit, so that > you could encode your counties as being composed by the districts, > and the districts would be composed by faces, which would be defined > by (shared) edges. > At that point querying for "all districts in

Re: [postgis-users] Select polygons within polygon with PostGIS 2.0

2012-10-11 Thread Michal Zimmermann
ALTER ROLE postgres IN DATABASE postgistemplate SET search_path="$user", public, topology; seems to do the magic. On 10/11/12, Sandro Santilli wrote: > On Thu, Oct 11, 2012 at 09:49:03AM +0200, Michal Zimmermann wrote: >> Got it! There was no username associated with the search_path and it >> see

Re: [postgis-users] Select polygons within polygon with PostGIS 2.0

2012-10-11 Thread Michal Zimmermann
I'm digging deeper into topology model of storing spatial data, but what I can't see is HOW I can use it for the purpose I started this thread for. Assuming I have a topology created for the counties... I'm sort of stuck what to do next. How do I go for my original goal - selecting all districts of

Re: [postgis-users] Select polygons within polygon with PostGIS 2.0

2012-10-11 Thread Sandro Santilli
On Thu, Oct 11, 2012 at 09:49:03AM +0200, Michal Zimmermann wrote: > Got it! There was no username associated with the search_path and it > seems that was causing the trouble. I don't understand it, can you please tell us more about how you fixed it ? The search_path `` "$user", public, topology `

Re: [postgis-users] Select polygons within polygon with PostGIS 2.0

2012-10-11 Thread Michal Zimmermann
Got it! There was no username associated with the search_path and it seems that was causing the trouble. On 10/11/12, Michal Zimmermann wrote: > Variable search_path for postgistemplate DB has the following values: > "$user", public, topology. > > On 10/11/12, Michal Zimmermann wrote: >> How do

Re: [postgis-users] Select polygons within polygon with PostGIS 2.0

2012-10-11 Thread Michal Zimmermann
Variable search_path for postgistemplate DB has the following values: "$user", public, topology. On 10/11/12, Michal Zimmermann wrote: > How do I find out? > > On 10/11/12, Sandro Santilli wrote: >> On Thu, Oct 11, 2012 at 09:30:30AM +0200, Michal Zimmermann wrote: >>> On 10/11/12, Sandro Santil

Re: [postgis-users] Select polygons within polygon with PostGIS 2.0

2012-10-11 Thread Michal Zimmermann
How do I find out? On 10/11/12, Sandro Santilli wrote: > On Thu, Oct 11, 2012 at 09:30:30AM +0200, Michal Zimmermann wrote: >> On 10/11/12, Sandro Santilli wrote: >> > On Thu, Oct 11, 2012 at 09:02:58AM +0200, Michal Zimmermann wrote: >> >> Hi, >> >> I tried with SELECT CreateTopology('kraje_top

Re: [postgis-users] Select polygons within polygon with PostGIS 2.0

2012-10-11 Thread Sandro Santilli
On Thu, Oct 11, 2012 at 09:30:30AM +0200, Michal Zimmermann wrote: > On 10/11/12, Sandro Santilli wrote: > > On Thu, Oct 11, 2012 at 09:02:58AM +0200, Michal Zimmermann wrote: > >> Hi, > >> I tried with SELECT CreateTopology('kraje_topo', 4326); and got the > >> following error: ERROR: AddGeometry

Re: [postgis-users] Select polygons within polygon with PostGIS 2.0

2012-10-11 Thread Michal Zimmermann
No, if I try select * from spatial_ref_sys where srid=4326, I get exactly one result. The topology table belongs to topology scheme, while the spatial_ref_sys belongs to public scheme, could that be a problem? On 10/11/12, Sandro Santilli wrote: > On Thu, Oct 11, 2012 at 09:02:58AM +0200, Michal

Re: [postgis-users] Select polygons within polygon with PostGIS 2.0

2012-10-11 Thread Sandro Santilli
On Thu, Oct 11, 2012 at 09:02:58AM +0200, Michal Zimmermann wrote: > Hi, > I tried with SELECT CreateTopology('kraje_topo', 4326); and got the > following error: ERROR: AddGeometryColumn() - invalid SRID. Is there > something special I need to do before creating topology? The SRID must be in spati

Re: [postgis-users] Geographies, geometries, international date line

2012-10-11 Thread Nicolas Ribot
Hi Maxime, Yes indeed, the new geography type take advantage of a very fast Gist index,often leading to queries faster than their geometry equivalent (see Paul Ramsey's blog about this new type). St_distance might also benefit from this new code. Concerning polygons crossind dateline, yes you wil

Re: [postgis-users] Select polygons within polygon with PostGIS 2.0

2012-10-11 Thread Michal Zimmermann
Hi, I tried with SELECT CreateTopology('kraje_topo', 4326); and got the following error: ERROR: AddGeometryColumn() - invalid SRID. Is there something special I need to do before creating topology? On 10/10/12, Paolo Corti wrote: > On Wed, Oct 10, 2012 at 12:16 PM, Sandro Santilli wrote: >> >> O