[postgis-users] makepolygon with geom info

Paragon Corporation lr at pcorp.us
Sat Jul 26 22:05:35 PDT 2008


Reena,

 Not quite sure what could be the problem.  Hmm sorry about my comment
off-list - I hadn't read this e-mail.

Can you post a little bit of you Mapserver map.  Could be the extent of your
map is wrong, the projection doesn't match among a number of other problems.
All ahrd to tell without seeing the map file.

Probably worthwhile to post this to the UMN Mapserver mail list if you
haven't already since it might be more of a mapserver question than PostGIS.

Hope that helps,
Regina  

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of S.Reena
Sent: Friday, July 25, 2008 3:52 AM
To: postgis-users at postgis.refractions.net
Subject: RE: [postgis-users] makepolygon with geom info


Hi Regina,
I have made a new table with the query data as you suggested and added entry
in  geometry_columns ... I am able to see the polygon as postgis layer in
Quantum GIS...but somehow its not getting displayed in map...Can you suggest
something?

Cheers,
Reena.





Obe, Regina     DND\MIS wrote:
> 
> 
>  Typo again should be
> 
> 
>  DATA "newgeom FROM (SELECT Max(f.gid) as newgid, f.name,
> ST_MakePolygon(ST_MakeLine(f.the_geom)) As newgeom FROM (SELECT name, 
> 0 as psort, gid, the_geom
> 		FROM foll 
> 	UNION ALL
> 		SELECT fs.*
> 		FROM 
> 		(SELECT DISTINCT ON(name) name, 1 As psort, gid , the_geom
> 			FROM foll
> 		ORDER BY name, gid) fs
> 	ORDER BY 1,2,3) As f
> WHERE f.name = 'abc'
> GROUP BY  f.name) As foo USING UNIQUE newgid USING SRID=4326"   (change
> 4326 with your SRID).
> 
> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net
> [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of 
> Obe, Regina
> Sent: Wednesday, July 02, 2008 11:55 AM
> To: PostGIS Users Discussion
> Subject: RE: [postgis-users] makepolygon with geom info
> 
> I've never tried doing that complicated of a query in Mapserver so not
> sure it will fly.   Well I did try once, but it was too slow so I just
> created a table out of the statement
> 
> If you wanted to try the complex query
> 
> 
>  DATA "newgeom FROM (SELECT Max(f.gid) as newgid, f.name,
> ST_MakePolygon(ST_MakeLine(f.the_geom)) As newgeom FROM (SELECT name, 
> 0 as psort, gid, the_geom
> 		FROM foll 
> 	UNION ALL
> 		SELECT fs.*
> 		FROM 
> 		(SELECT DISTINCT ON(name) name, 1 As psort, gid , the_geom
> 			FROM foll
> 		ORDER BY name, gid) fs
> 	ORDER BY 1,2,3) As f
> WHERE f.name = 'abc'
> GROUP BY  f.name) As foo USING UNIQUE newid USING SRID=4326"   (change
> 4326 with your SRID).
> 
> 
> 
> Alternatively just create a new table
> 
> SELECT * INTO follpoly
> 	FROM
>  (SELECT Max(f.gid) as newgid, f.name,
> ST_MakePolygon(ST_MakeLine(f.the_geom)) As newgeom FROM (SELECT name, 
> 0 as psort, gid, the_geom
> 		FROM foll 
> 	UNION ALL
> 		SELECT fs.*
> 		FROM 
> 		(SELECT DISTINCT ON(name) name, 1 As psort, gid , the_geom
> 			FROM foll
> 		ORDER BY name, gid) fs
> 	ORDER BY 1,2,3) As f
> WHERE f.name = 'abc'
> GROUP BY  f.name) As foo;
> 
> ALTER TABLE follpoly
>   ADD CONSTRAINT follpoly_pkey PRIMARY KEY(newgid);
> 
> then your mapserver data part would just be
> 
> DATA "newgeom FROM follpoly USING UNIQUE newid USING SRID=4326"
> 
> You might also want to manually put in an entry in geometry_columns 
> table since some GIS apps require it.
> 
> 
> Hope that helps,
> Regina
> 
> 
> 
> 
> 
> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net
> [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of 
> S.Reena
> Sent: Wednesday, July 02, 2008 9:39 AM
> To: postgis-users at postgis.refractions.net
> Subject: Re: [postgis-users] makepolygon with geom info
> 
> 
> Yupp that is done... now im trying to include that newgeom in DATA 
> section of my map file to make a polygon ....bt it isnt wrking....this 
> newgeom can be used for this or not....
> 
> 
> 
> S.Reena wrote:
>> 
>> I have a table with foll fields( the_geom, name, latlon, ....)...i
> wanted
>> to make a polygon by using those points whose name like 'abc' and put
> it
>> in the map...
>> 
>> how to do dis?
>> 
> 
> --
> View this message in context:
> http://www.nabble.com/makepolygon-with-geom-info-tp18214128p18237679.h
> tm
> l
> Sent from the PostGIS - User mailing list archive at Nabble.com.
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> -----------------------------------------
> The substance of this message, including any attachments, may be 
> confidential, legally privileged and/or exempt from disclosure 
> pursuant to Massachusetts law. It is intended solely for the 
> addressee. If you received this in error, please contact the sender 
> and delete the material from any computer.
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 
> 

--
View this message in context:
http://www.nabble.com/makepolygon-with-geom-info-tp18214128p18646914.html
Sent from the PostGIS - User mailing list archive at Nabble.com.

_______________________________________________
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