No subject
Tue Oct 7 10:08:30 PDT 2008
vided after ST_Intersection) and 'the_geom' (obtained from v.*, bc_=
voting_areas.the_geom).<br>
<br>
You mentioned that you tried to add 'the_geom' to the geometry_colu=
mns table to help out QuantumGIS. =A0You may want to do the same for 'i=
ntersection_geom' so you can visualize the clipped data, not just the v=
oting areas.<br>
<br>
I'm not very familiar with QuantumGIS, but it sounds like it gets confu=
sed with tables that have more than one geometry column - you mentioned Qua=
ntum recognized this table as having two geometry columns with the same nam=
e ... as I pointed out, this is not the case. =A0Try selecting the 'int=
ersection_geom' from pg_voting_areas into a separate table and try to v=
isualize that.<br>
<br>
Hope this helps,<br>
Kevin<br>
<br>
Andre Oliveira wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class=3D"im"=
>
Hi Everybody,<br>
<br>
I was trying to use the ST_Intersection function to overlay (clip) a poygon=
by another, with the following code from the workshop at foss4g2007:<br>
<br>
CREATE TABLE pg_voting_areas AS<br>
SELECT<br>
=A0ST_Intersection(v.the_geom, m.the_geom) AS intersection_geom,<br>
=A0ST_Area(v.the_geom) AS va_area,<br>
=A0v.*,<br></div>
=A0<a href=3D"http://m.name" target=3D"_blank">m.name</a> <<a href=3D"h=
ttp://m.name" target=3D"_blank">http://m.name</a>><div class=3D"im"><br>
FROM<br>
=A0bc_voting_areas v,<br>
=A0bc_municipality m<br>
WHERE<br>
=A0ST_Intersects(v.the_geom, m.the_geom) AND<br></div>
=A0<a href=3D"http://m.name" target=3D"_blank">m.name</a> <<a href=3D"h=
ttp://m.name" target=3D"_blank">http://m.name</a>> =3D 'PRINCE GEORG=
E';<div class=3D"im"><br>
=A0After this operation I restarted pgAdminIII, generated an index for pg_v=
oting_areas, run vacuum analyze, and defined GID as the primary key for pg_=
voting_areas.<br>
<br>
But when I try to connect with QuantumGIS to visualize the data, two datase=
ts where recognized with the same name, one bearing the expected result, bu=
t the other a display with more objects than expected for a clip.<br>
<br>
Then I tried to inserted the dataset's line into table geometry_columns=
: <br>
INSERT INTO geometry_columns (f_table_catalog, f_table_schema, f_table_name=
,f_geometry_column, coord_dimension, srid, type)<br>
<br>
SELECT '', 'public', 'pg_voting_areas', 'the_ge=
om',<br>
ST_CoordDim(the_geom),<br>
ST_SRID(the_geom),<br>
GeometryType(the_geom)<br>
<br>
FROM public.pg_voting_areas LIMIT 1;<br>
<br>
After I did this, one of the datasets recognized by QuantumGIS disappeared,=
but it was the undesired one that survived. Also, I noticed that some of t=
he measurements in the workshop are not totally equal to the ones I obtain =
(for instance, when I query the clipped poygon's area and the clipping =
municipality's area, they are not exactly equal - 326579103.825073 vers=
us 326579103.825928). =A0I am using the last versions of postgre, postgis a=
nd quantumgis.<br>
When I installled postgre I chose locale by default and created the postgis=
database manually, bearing UTF8 encoding.<br>
<br>
I would really appreciate a hand here.<br>
Thanks<br>
<br>
<br></div>
------------------------------------------------------------------------<br=
>
<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href=3D"mailto:postgis-users at postgis.refractions.net" target=3D"_blank">=
postgis-users at postgis.refractions.net</a><br>
<a href=3D"http://postgis.refractions.net/mailman/listinfo/postgis-users" t=
arget=3D"_blank">http://postgis.refractions.net/mailman/listinfo/postgis-us=
ers</a><br>
</blockquote>
_______________________________________________<br>
postgis-users mailing list<br>
<a href=3D"mailto:postgis-users at postgis.refractions.net" target=3D"_blank">=
postgis-users at postgis.refractions.net</a><br>
<a href=3D"http://postgis.refractions.net/mailman/listinfo/postgis-users" t=
arget=3D"_blank">http://postgis.refractions.net/mailman/listinfo/postgis-us=
ers</a><br>
</blockquote></div><br>
--0015175cffac72959c0472c1949b--