#POSTGIS IRC Log - 2008-06-30

For logs after Feb 3, 2007, all times are GMT-8. Prior logs are GMT-9.
Back to Logs
04:31:39 epifanio: hi, i'm having an error in a mapfile that use a postgis layer, strange beacouse i'm using the same mapfile on an other machine and it works :-/
04:31:44 epifanio: these the error log : http://rafb.net/p/Y2JiqY29.html and the mapfile
04:31:45 sigq: Title: Nopaste - No description ( at rafb.net )
04:31:48 epifanio: i tried to debug it with shp2img
04:32:14 epifanio: no clue :-/ the layers are corrctly loaded into qgis
06:22:18 awp_: hello lads, anyone knows the unit given by the length2d( geometry ) function? I am guessing that it is 100KM, but can anyone confirm this?
06:22:19 awp_: thanks
06:24:05 awp_: length2d, ST_Length, ST_Length2d, apparently they are all synonyms
06:26:09 c0re: awp_: it's dependent upon the projection you are using.
06:26:28 c0re: awp_: if you are using a UTM projection then the distance is in meters.
06:27:01 awp_: c0re: I was hoping postgis would work it out for me, I am using WGS84, so I need to transform it to UTM then?
06:27:09 awp_: thanks, I was a bit lost on that one
06:27:20 : * awp_ looks up the transform function
06:28:00 c0re: awp_: transform it to the correct zone. google 'utmzone', which will tell you what zone the specified lat/lon is in... thats what I do..
06:28:22 awp_: great tip!
06:28:25 awp_: thanks a lot
06:28:29 c0re: np
06:44:56 intengu: i have a postgis polygon layer that has an outer boundary and two island polygons, when loading this in a viewer the island polygons are masked by the bigger one, hown can i repair this in postgis
06:56:50 awp_: c0re: hum... what if my UTM zone isn't listed in the spatial_ref_sys table? My zone is 23K
06:59:37 awp_: err, I guess I can create the projection text, but I was thinking that maybe they have specific indexes
07:05:23 awp_: anyone here has the EPSG2WKT.TXT file? googled all around for it, and really can't find it
07:05:55 awp_: postgis says I can find it on: http://www.opengis.org/techno/interop/EPSG2WKT.TXT but it doesn't exist, it seem
07:05:57 sigq: Title: Welcome to the OGC Website | OGC® ( at www.opengis.org )
07:11:08 c0re: awp_: http://spatialreference.org/
07:11:09 sigq: Title: Home -- Spatial Reference ( at spatialreference.org )
07:11:30 c0re: awp_: never heard of 23k... doesnt seem right...
07:15:57 intengu: how do you work with island polygons in postgis - I have seen the following functions ST_Exterior, ST_Interior, ST_Polygonize
07:45:28 awp_: intengu: I'm still a n00b, sorry, don't know |=
07:56:11 awp_: c0re: grid reference: 23KPQ ( http://img253.imageshack.us/my.php?image=coordinatesriodejaneiroeg7.jpg ) that's for Rio de Janeiro
07:56:13 sigq: Title: ImageShack - Hosting :: coordinatesriodejaneiroeg7.jpg ( at img253.imageshack.us )
08:17:01 awp_: oh so... that's 23S I guess
08:55:11 awp_: jalmeida: which state are you from?
08:55:34 jalmeida: i live in Brasil
08:55:41 jalmeida: awp_: and you ?
08:55:46 awp_: jalmeida: yeah, but which state are you from?
08:55:48 awp_: d-:
08:56:10 awp_: same, do you know if rio de janeiro is in UTM zone 23S?
08:56:50 jalmeida: Sao Paulo
08:56:59 c0re: awp_: http://postgis.refractions.net/support/wiki/index.php?plpgsqlfunctions
08:57:00 sigq: Title: PostGIS Wiki : plpgsqlfunctions ( at postgis.refractions.net )
08:57:06 awp_: jalmeida: do you know the UTM zone there?
08:57:27 c0re: awp_: insert that function and call it... it will tell you the zone of a lat, lon
08:57:46 awp_: c0re: wow, life saver
08:57:54 jalmeida: Rio de Janeiro and São Paulo is UTM zone 23S
10:37:29 CIA-6: robe * r2817 /trunk/doc/postgis.xml: Fixed typo
10:37:29 CIA-6: robe * r2818 /branches/1.3/doc/postgis.xml: Same changes as in trunk
12:00:29 DruidSmith: Is there any routine or standaline Windows binary ( SPIT, et cetera ) that can let me import multiple shapefiles into PostGIS?
12:01:32 DruidSmith: I have a whole bunch of shapefiles to bring in to PostGIS, was trying the SPIT plugin from QGIS - works with a few, but eventually bombs ( seems to be problem with memory handling )
12:08:25 bitner: DruidSmith: you can use shp2pgsql or ogr2ogr from GDAL/OGR from the command prompt or a batch file
12:09:13 nhv: shp2pgsql http://postgis.refractions.net/docs/ch04.html#id2592296
12:09:14 sigq: Title: Chapter 4. Using PostGIS ( at postgis.refractions.net )
12:09:15 DruidSmith: I have GDAL/OGR, can try that... Is there a Windows binary for shp2pgsql?
12:09:23 DruidSmith: Thanks, was just going to look for that : )
12:09:30 bitner: windows binary should have come with your install
12:09:46 bitner: ( shp2pgsql that is )
12:10:00 DruidSmith: great, thanks : )
12:10:42 bitner: DruidSmith: are you doing something weird with your irc client? your text shows up blue and is nearly unreadable with my shell
12:19:08 nhv: hmm DS's posts seem normal in chazilla
13:59:47 bahador: ping hobu
14:00:18 bahador: john g told me to ask you what the best way is to go from python to postrges
14:08:48 bahador: *postgis
14:58:12 hobu: bahador: I don't understand the question.... you have geometries in Python that you want to store in postgis?
15:01:36 bahador: so...
15:06:23 bahador: so there is this metagenomic server called "The SEED" that i connect to and download information from using web services ( SOAP ) all in python. The information is a series of points ( with coordinates obviously ) with a lot of data associrated to each point. I want to know what the best way to create a postgres database and put this information into it using python. I found a module called pygresql but im not sure if it is the best way to do this.
15:13:41 hobu: Use psycopg2
15:14:09 hobu: make sure one of your columns is of type 'Geometry'
15:14:41 hobu: When writing your SQL to set the value for the geometry column, use the function GeometryFromText
15:15:07 bahador: thank you very much for your time =]
15:15:36 hobu: for example, sql = """insert into mytable ( geometry ) values GeometryFromText( 'POINT( %.10f %.10f' )""" % ( float( x ), float( y ) )
15:15:51 hobu: cursor=connection.cursor( )
15:15:56 hobu: cursor.execute( sql )
15:16:03 hobu: ... or something like that...
15:17:33 bahador: ok tyvm...
19:13:03 darkblue_B: so I just got sent a SQL dump from a PostGIS db
19:13:19 darkblue_B: it has the PostGIS in it.. with links to .so's , which can never work
19:13:56 darkblue_B: when I asked the admin to dump it with -t table instead, to selectively pull out the just the data tables
19:14:15 darkblue_B: he says.. Refractions has a script to migrate versions.. use that
19:14:17 darkblue_B: ??!?
19:14:43 darkblue_B: I cant tell if he is being an obstructionist or if this script really is a better habit, and fits this situations
19:52:25 mleslie: darkblue_B: For minor or point version releases, the update script should be sufficient.