[postgis-users] UNION

Obe, Regina robe.dnd at cityofboston.gov
Tue Sep 11 08:47:49 PDT 2007


Ravi,
 
Still not quite clear what question you are trying to answer.
 
I am guessing that you are getting duplicates because you have a one to
many going on here.  But I'm not sure which is the one and which is the
many.
 
Also you don't need coalesce here since that is only useful if you
expect one of your fields to be null.  In this case since you are doing
an inner join, neither will be NULL.  Or perhaps you don't want to do an
inner join.
 
It might be that you really want to use the aggregate form of geomunion
 
Something like
 
SELECT strubuf.struclass, geomunion(geof.geometry) AS geofac 
FROM geof INNER JOIN strubuf ON (geof.geometry && strubuf.geometry AND
 intersects(strubuf.geometry, geof.geometry))
GROUP BY strubuf.struclass
 
Just a guess.  But perhaps that doesn't answer the question you were
trying to ask.

________________________________

From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of RAVI
KUMAR
Sent: Tuesday, September 11, 2007 6:26 AM
To: jump-users at lists.jump-project.org
Cc: postgis
Subject: [postgis-users] UNION


Hi,
I have prepared a course material for training in Jump for
Geoscientists.
Added a minerological theme in which the final output results in
prospectivity map.

I have used Post-GIS where ever complex bullion operators are needed.
This was done smoothly.

But Iam now held-up in UNION and Intersection. Jump gives an OVERLAY
which equals intersection. But the problem needs both
Intersected portion and
Non intersecting portion together.

Followed the advise given on this list to get the result. But the result
OPENJUMP
1.Overlay Layers A, B
2. Make union of the result (to use as a mask)
3. A-Union and B-union and combine theses two layers
4. Add Overlay to this.

This does the work but you have duplicate geometries which are filled
with different attributes in different instances.
POSTGIS:
Followinf the suggestions on the Postgis list I have tried this query.
SELECT strubuf.struclass, COALESCE(geomunion(strubuf.geometry,
 geof.geometry), geof.geometry) AS geofac FROM geof INNER JOIN strubuf
ON (geof.geometry && strubuf.geometry AND
 intersects(strubuf.geometry, geof.geometry));

But this doesnt result in a table geofac



This is where I am..
But for this additional exercise every thing else is ready.
However Proof of Concept for Geoscientists lies in THIS.


Cheers
Ravi Kumar 

________________________________

Be a better Heartthrob. Get better relationship answers
<http://us.rd.yahoo.com/evt=48255/*http://answers.yahoo.com/dir/_ylc=X3o
DMTI5MGx2aThyBF9TAzIxMTU1MDAzNTIEX3MDMzk2NTQ1MTAzBHNlYwNCQUJwaWxsYXJfTkl
fMzYwBHNsawNQcm9kdWN0X3F1ZXN0aW9uX3BhZ2U-?link=list&sid=396545433> from
someone who knows.
Yahoo! Answers - Check it out. 



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


More information about the postgis-users mailing list