#POSTGIS IRC Log - 2008-07-27

For logs after Feb 3, 2007, all times are GMT-8. Prior logs are GMT-9.
Back to Logs
01:09:36 arkygeek: hi everyone
01:10:05 arkygeek: basic question .... ---> How do I add a primary key to a table?
01:10:47 arkygeek: I have a column i want to use, but it is of type real at the moment.
03:39:13 grobda24: Is there a way of getting text from polygon type without doing this .... http://etutorials.org/SQL/Mastering+Oracle+SQL/Chapter+17.+Regular+Expressions/17.3+Advanced+Regular+Expression+Syntax/ ...( pulls hair out ).
03:39:15 sigq: Title: 17.3 Advanced Regular Expression Syntax :: Chapter 17. Regular Expressions :: Mastering Oracle SQL :: SQL :: eTutorials.org ( at etutorials.org )
03:44:19 mloskot: grobda24: text of polygon type?
03:44:32 mloskot: You mean name of geometry type or geometry content in WKT form ?
03:53:23 grobda24: mloskot, hello. WKT = text ? If so then yes. The content of a Polygon type as text. Syntax: polygonfromtext( 'POLYGON( ( 0 0, 1 0, 1 1, 0 0 ) )', -1 ); ... of course the point numbers would come from a *POSTGRESQL* polygon column.
03:55:21 mloskot: grobda24: you know what is WKT aka Well-Known-Text ?
03:56:39 grobda24: mlostkot ... I think so. Basic text ? I'm learning here as well as I'm from a MySQL background.
03:57:36 mloskot: grobda24: WKT is defined by OpenGIS Simple Feature Specification, so it's not specific to any DBMS
03:58:01 grobda24: k
03:58:09 mloskot: If you are not sure about WKT, my suggestion is to learn about it first, otherwise you are likely going to struggle with using spatial stuff in postgis/mysql
03:58:13 mloskot: http://www.postgis.org/documentation/manual-1.3/ch04.html#id2978551
03:58:14 sigq: Title: Chapter 4. Using PostGIS ( at www.postgis.org )
03:58:29 mloskot: http://www.opengeospatial.org/standards/sfs
03:58:30 sigq: Title: Simple Feature Access - Part 2: SQL Option | OGCĀ® ( at www.opengeospatial.org )
03:59:03 grobda24: I'm just going to import my source as text. It doesn't look as easy to reference a polygon. A point can be referenced as an array.
03:59:50 mloskot: 1. understand what WKT is
04:00:09 mloskot: 2. read postgis manual and its functions reference
04:00:16 mloskot: 3. learn about ST_AsText to get textual representation of geometry
04:00:38 mloskot: http://www.postgis.org/documentation/manual-1.3/ch06.html
04:00:39 sigq: Title: Chapter 6. PostGIS Reference ( at www.postgis.org )
04:01:02 grobda24: k
04:13:24 grobda24: No, no. I don't think mlostkot got what I was saying. I'm wanted to get text from a standard PostgreSQL polygon column NOT a PostGIS one.
04:13:46 grobda24: Anyway, I have another solution : )
09:26:19 darkblue_B: well, for whatever reason.. I just changed the test files at svg.cc/pg/occ so they actually display correctly in my browsers
09:26:28 darkblue_B: my set of those files I should say
09:27:10 darkblue_B: just about everything was wrong with them.. as far as I could tell, I tried a few browsers and none of them showed the svg correctly
09:27:19 darkblue_B: now it works
09:29:51 darkblue_B: hi mloskot
09:30:07 mloskot: hi
09:31:27 darkblue_B: do you have a way you execute PostGIS queries and see the results visually? for example, the OGC SFS Test suite, in Postgis exmaples
09:31:52 mloskot: not really
09:32:02 mloskot: JTS validation suite may be helpful
09:32:09 mloskot: to understand geometry engine
09:32:10 darkblue_B: yeah.. ok
09:32:18 mloskot: it's available on the web
09:32:41 darkblue_B: I found a set of generated svg at svg.cc/pg/occ
09:32:59 darkblue_B: just wondering about tools and visualizations
09:33:17 darkblue_B: thx
09:34:07 mloskot: http://www.vividsolutions.com/jts/tests/index.html
09:34:09 sigq: Title: JTS Validation Suite ( at www.vividsolutions.com )
09:36:01 darkblue_B: hmm vividsolutions is not responding for me
09:36:12 darkblue_B: but no matter... not important right now
11:12:10 sigq: geosfeed: Ticket #187 ( defect updated ): ST_Buffer crashes on WinXP, PostgreSQL 8.3, PostGIS 1.3.3, GEOS 3.0.0-CAPI-1.4.1 <http://trac.osgeo.org/geos/ticket/187#comment:2>
12:04:20 johto: hello. how could I "substract" a geometry from another geometry?
12:06:27 mloskot: johto: give some example
12:14:34 johto: mloskot; for example, I had a smaller rectangle inside a bigger rectangle and only wanted the part around the smaller rectangle
12:15:30 mloskot: johto: check this
12:15:31 mloskot: http://www.postgis.org/documentation/manual-1.3/ch06.html#id2982990
12:15:32 sigq: Title: Chapter 6. PostGIS Reference ( at www.postgis.org )
12:15:55 mloskot: I suppose you will want to play with functions like ST_InteriorRingN, etc.
12:16:09 mloskot: or ST_GeometryN
12:16:15 mloskot: and others from this category
15:11:30 johto: getting number of vertices in a multipolygon?
15:13:00 tazle: sum( st_numpoints( st_dump( mp_geom_column ).geom ) ) or something
15:13:16 tazle: you'd also need group by, I think
15:13:54 tazle: ie. there is no direct way - explode the multipolygon into polygons, count the points of those and sum
15:14:34 darkblue_B: cheating completely, I read the polys AsText( ) and counted commas and parens
15:15:12 johto: yeah but I'd need them in an ORDER BY clause
15:15:14 darkblue_B: using a scripting language..
15:15:50 johto: and transferring millions of points isn't something i want to consider
15:16:21 darkblue_B: millions?
15:16:37 johto: well, I think it's closer to billions
15:17:05 darkblue_B: I was asked to run some checkng on a data set..
15:17:20 darkblue_B: so I wrote in python.. did the Valid( ) and Simple( ) queries
15:17:41 darkblue_B: as above, AsText( ).. and then did my analysis in python
15:18:13 johto: maybe I should share my scenario..
15:18:15 darkblue_B: if you really have billions them write back to a new table
15:18:28 tazle: johto: please do
15:18:55 tazle: johto: also, is globepointer.com in Finland and doing something interesting?- )
15:19:13 johto: I have a polygon which describes the whole land area, and a number of polygons which describe the water area
15:19:19 johto: tazle; yes, and yes
15:19:29 tazle: johto: the material from MML?
15:19:33 johto: mml?
15:19:35 darkblue_B: ooh I remember this data set from last Fall
15:19:37 tazle: Maanmittauslaitos
15:19:42 johto: tazle; no, tele atlas
15:20:27 johto: so I have to remove the water parts from the land. now I'm just calculating the ST_Difference( landpoly, waterpoly ) for every water polygon
15:20:31 darkblue_B: so the land poly really is some huge number of vertices
15:20:40 johto: no, the water polys are
15:20:47 tazle: johto: perhaps I should ask "why?"
15:21:00 johto: tazle; for rendering.
15:21:17 tazle: johto: render the land polygon first, then the water polygons on it
15:21:28 darkblue_B: rasterize it sooner rather than later
15:21:31 johto: if I first render the land polygon and then the water polygons on top of it, antialiasing gives me ugly outer rings
15:21:47 tazle: johto: example?
15:21:53 johto: tazle; sec
15:22:48 darkblue_B: didnt we talk about slicing the data set....
15:23:06 darkblue_B: into subsets...
15:23:33 johto: http://www.neonaspect.com/~rnn/ugly.png
15:24:02 tazle: johto: oah yes - cobmine your water polygons
15:24:43 tazle: johto: also, are you supposed to render in real-time, or just once into tiles?
15:25:05 johto: prerender quarterly into tiles
15:25:27 johto: ( i.e. every time tele atlas provides us with new data )
15:25:41 tazle: ok, then just combining the water polygons is likely the quickest solution
15:26:08 johto: quickest processing or rendering?
15:26:17 tazle: both, most likely
15:26:38 tazle: a land polygon with all the lakes of Finland carved out of it would be huge
15:28:13 johto: well, that way we wouldn't have to render all the land and water on top of each other
15:28:20 johto: ( the way I'm thinking right now )
15:28:42 tazle: also, just combining the water areas produces huge polygons, I have some ideas, but since you are a competitor, I'm somewhat wary of sharing them
15:28:43 johto: and it wouldn't have to be one huge polygon, all the islands for example could be taken out
15:28:55 johto: tazle; ; )
15:29:03 johto: tazle; what company are you working for?
15:29:07 tazle: johto: Indagon
15:29:11 johto: oh
15:29:22 tazle: yeah : )
15:30:00 johto: do you use google maps btw.?
15:30:30 tazle: not us, the map on the front page is from a partner
15:31:04 johto: what did you use for rendering the tiles?
15:31:06 johto: or do you
15:31:09 johto: *do use
15:31:34 tazle: no, we ship vector maps
15:31:57 johto: oh. so you don't have any browser interface?
15:33:08 tazle: not a general browser interface, no
15:36:15 tazle: if I were doing a web interface, I would look into Google Maps, though
15:36:42 tazle: for a limited user base, the terms are not *so* bad
15:37:39 johto: yeah. but it's too late now
15:38:04 tazle: yeah, if you've already shelled out the cash for TeleAtlas material, I woul dsay you're stuck with them for a while at least : )
15:46:31 johto: btw. there is an ST_npoints( ) function
15:46:38 johto: which seems to return the number of vertices
16:11:50 tazle: so it would seem, a postgis extension
19:04:17 TheSteveMonkey: I want to check my thinking on a query - I have a zoning tables and a parcel table and if I want to find all the parcels within a certain zone - do I need to union the zone geometries first?
19:04:31 TheSteveMonkey: It seems like most of the spatial join functions do not accept geometry collections
19:04:41 TheSteveMonkey: here is what I am using but it is incredibly slow
19:04:53 TheSteveMonkey: select p.gid from parcels as p, zoning as z where ST_Within( ( select ST_Union( z.the_geom ) from zoning as z where z.comb_zn like 'A%' ), p.the_geom );
19:24:46 TheSteveMonkey: anyone?
21:28:10 jcooke: Could anyone recommend a good tutorial/eBook/paper book for getting started with PostGIS or GIS in general, for someone with no kind of GIS experience at all.
21:28:35 TheSteveMonkey: http://www.bostongis.com/?content_name=postgis_tut01#20
21:28:38 sigq: Title: Part 1: Getting Started With PostGIS: An almost Idiot's Guide ( at www.bostongis.com )
21:28:49 TheSteveMonkey: jcooke: where are you located?
21:28:59 jcooke: Austin
21:29:16 TheSteveMonkey: I am giving an intro preso at LinuxWorld SF on tuesday next week
21:29:28 TheSteveMonkey: thought if you were close you might stop by - it's free
21:29:41 jcooke: TheSteveMonkey, I've looked at that before, but it seems to assume some level of experience with GIS data.
21:30:04 jcooke: SF is a bit out of the way : ) but thank you.
21:30:54 jcooke: If that article is the best to start with though, that's fine, I'll just have to do a bit of research on some of the jargon, etc.
21:34:42 TheSteveMonkey: You could do one of the Free ESRI intro to GIS tutorials - there is some ESRI lingo in their but there is also some general GIS Concepts
21:35:31 jcooke: TheSteveMonkey, sweet, thanks!
23:27:09 darkblue_B: hmmm I just used an AND in the WHERE
23:30:27 darkblue_B: z.comb_zn like 'A%' and ST_Within( p.the_geom, z.the_geom )
23:30:42 darkblue_B: seems to work fine