Re: [postgis-users] Difference between @ and ST_WITHIN/ST_CONTAINS

2008-04-22 Thread Josh Livni
The @, and other operators such as &&, work on the bounding boxes of geometries. The st_xxx functions additionally do calculations using the actual geometries themselves... -Josh Frank Durstewitz wrote: Hi, can someone please explain, what the difference between WHERE ST_CONTAINS(b.geom, e

Re: [postgis-users] Meant to ask for PostGIS/Google Maps API using Python

2008-01-25 Thread Josh Livni
There's two ways to overlay data from PostGIS into Google Maps. As an image overlay (eg WMS), or as vector overlays (if you don't have tons of complex data in one view). WMS: Assuming you are gonna use Google Maps proper, versus OpenLayers (which would make things easier), check out wms236.js

Re: [postgis-users] I've got a silly question about performance

2008-01-18 Thread Josh Livni
ries overlap. I guess it would depend on how parcels are "really" assigned to disticts - ie can the assignment be replicated algorithmically? Josh Livni wrote: Well, and again assuming he doesn't mind getting the list of parcels whose centroids intersect each district rather than

Re: [postgis-users] I've got a silly question about performance

2008-01-17 Thread Josh Livni
Well, and again assuming he doesn't mind getting the list of parcels whose centroids intersect each district rather than the list of parcels that intersect each district, checking for point-polygon intersection is going to be faster than checking for polygon-polygon intersection. So for speed

Re: [postgis-users] Geocode opinions

2008-01-11 Thread Josh Livni
What are you trying to accomplish? Do you need to have a duplicate style geometry in the people table, or can you just make a join table and get people and geometries associated more dynamically each query? I guess I'm confused about what your end goal is. Of course others may not be... but

Re: [postgis-users] Area calculation oh two polygon that they are overlapping

2008-01-10 Thread Josh Livni
Not sure if this is the recommended solution, but I sometimes do a buffer(geom,0) in this type of situation. SELECT Area(ST_Buffer(GeomFromText('MultiPolygon( ((0 0,0 3,3 3,3 0,0 0)),((1 1,1 4,4 4,4 1,1 1)))'),0)) -Josh [EMAIL PROTECTED] wrote: Hi, I'd like to compute the total area of

Re: [postgis-users] Decomposing geometries

2007-12-16 Thread Josh Livni
Assuming you have a postgis database, a table called 'lines' and a table called 'polys', and in each there is a field called 'id' and a field called 'the_geom' which holds the geometry, then you could try: 'SELECT id, AsText(the_geom) from lines' - which would give you two columns back, one of

Re: SPAM: [postgis-users] need restore assistance

2007-12-10 Thread Josh Livni
Kirk, Of course I'm not sure how your database was backed up, but chances are you can get your data back somehow. I would first try a few things - if one in particular fails, it may help others isolate the trouble if you can give specific errors it failed with. The command examples in paren

Re: [postgis-users] intersection/within queries - newbie basicspatial queries

2007-12-07 Thread Josh Livni
Kevin, Thanks for the followup - I guess I knew the ST_ functions wrapped the spatial queries and wasn't thinking straight - however I never did the actual tests to see that I've probably been slowing myself down where keep my old habits and include the && in there. Interesting. Thanks! -

Re: [postgis-users] intersection/within queries - newbie basic spatial queries

2007-12-06 Thread Josh Livni
Ah - that's probably what he meant - in which case I guessed wrong both times :) Since you mentioned the GiST index (and it may well be of use -- perhaps he's got millions of sec_catch polygons), I just figured I'd point out to Craigie that if indeed he does have such an index, to take advanta

Re: [postgis-users] intersection/within queries - newbie basic spatial queries

2007-12-06 Thread Josh Livni
Craigie, Not 100% sure I parsed your question right. It's possible others may also be confused. You say 'all the polys in sec_catch fall within a single record of prim_catch' .. are you then wondering which polygon of sec_1 it is that they all fall within? Or maybe, what you're trying to a

Re: [postgis-users] geomunion revisited....

2007-11-12 Thread Josh Livni
I think running buffer(bunch_of_geoms,0) rather than geomunion(bunch_of_geoms) might be faster. That said, still seems it takes a bit long. If it were me I'd try playing around by first creating a table with your results, eg: '''create table simple_buffers as ( select simplify(buffer(simplif

Re: [postgis-users] Surface maps from point interpolation

2007-08-31 Thread Josh Livni
Not exactly sure what you specifically mean by 'surface map', but assuming it's raster based, you'll need to step outside of PostGIS to create it. You may be interested in this response from Bill Binko to a tangential question I had some time ago: http://postgis.refractions.net/pipermail/pos

Re: [postgis-users] Calculating bbox/extent for set of polygons: ERROR I don't understand

2007-08-19 Thread Josh Livni
I don't know the intricacies of that error, but you have a couple easy options. For just the one county, like in your query - ditch the distinct, eg: SELECT extent(the_geom) FROM shp_precincts WHERE county_id=72; For all counties, try pulling the geom data out in different style, eg: SELECT di