Re: [postgis-users] Postgres Polygon to Postgis Geometry

2010-10-26 Thread Mike Toews
Ah, you are looking for this: http://postgis.refractions.net/docs/ST_Transform.html So you need to cast your object as a polygon, set the SRID to your projected coordinate system (I'm just guessing SRID=29181 for your example http://spatialreference.org/ref/epsg/29181/ .. look up the SRID for you

Re: [postgis-users] Postgres Polygon to Postgis Geometry

2010-10-26 Thread Wagner Santos
Mike, Yes, I mean georeferenced (sorry for my English). I made a cast to text and converted to postgis geometry, but I couldn't use ST_SetSRID. I would like to tranfer a polygon to correct position. I have a Polygon "BOX(743295.3125 7182512.5,744414.75 7183817.5)" and I like to transfer it to "BOX(

Re: [postgis-users] Postgres Polygon to Postgis Geometry

2010-10-26 Thread Mike Toews
Hi Wagner, I'm not sure what you mean by "geo" and "non-geo" .. you mean georeferenced, like longitude/latitude? For points, you can keep thing binary and just use ST_MakePoint(x,y). And to assign a coordinate system, use it with ST_SetSRID: SELECT ST_SetSRID(ST_MakePoint(p[0], p[1]), 4326) from

Re: [postgis-users] Postgres Polygon to Postgis Geometry

2010-10-26 Thread Wagner Santos
I created a Postgis Geometry from Postgres Polygon converting them from string and using linefromtext to create a geometry but this information isn't geo. I have non geo points and I want to convert to my correct position and set SRID, for example P(70 72) to P(-54 -25), how can I do this? Thanks

Re: [postgis-users] it would be cool if ST_Force_3DM & ST_Force_3DZ could accept a default Z or M value

2010-10-26 Thread David William Bitner
At least for the Z value you could use st_translate to adjust the value. On Tue, Oct 26, 2010 at 4:24 PM, Rhys A.D. Stewart wrote: > Hey all, > > Just a thought, it would be cool if the aforementioned functions could > accept a default value, am having to write a pl/pgsql function to do > this no

[postgis-users] it would be cool if ST_Force_3DM & ST_Force_3DZ could accept a default Z or M value

2010-10-26 Thread Rhys A.D. Stewart
Hey all, Just a thought, it would be cool if the aforementioned functions could accept a default value, am having to write a pl/pgsql function to do this now, but I'm sure a native/C function would be much faster. Regards, Rhys ___ postgis-users mail

[postgis-users] Postgres Polygon to Postgis Geometry

2010-10-26 Thread Wagner Santos
Hello, I'm new with postgis and I have a legacy database with Postgres Polygon, I want to convert this to a Postgis Geometry. Is there a way? I try to do with replace string and linefromtext with sucess, but I think doesn't better solution because I can't set a valid SRID. Thanks!

Re: [postgis-users] WKT Raster Error

2010-10-26 Thread Pierre Racine
I already saw the two first lines: c:\wktraster_pg84\bin\gdal2wktraster.py:645: DeprecationWarning: integer argumen t expected, got float hexstr = binascii.hexlify(struct.pack(fmt_little, data)).upper() But it didn't not prevent the script to create the sql file properly. I guess this is relat

Re: [postgis-users] pgsql2shp - No GID variable

2010-10-26 Thread Andreas Forø Tollefsen
Hi, I tried that, but at first it did not seem to work when loading the shapefile into ArcGIS. However, it seems that i had to restart ArcGIS to make it update the attribute table for the file. Now -r works. Thanks. Andreas 2010/10/26 Mark Cave-Ayland > Andreas Forø Tollefsen wrote: > > Hi al

Re: [postgis-users] pgsql2shp - No GID variable

2010-10-26 Thread Mark Cave-Ayland
Andreas Forø Tollefsen wrote: Hi all, When using the pgsql2shp the gid column is not included. I even tried typing a "select gid AS g_id" to include it as a different column name, but this did not work. My syntax: pgsql2shp -f pgfinal2008.shp -h localhost -u user -P pass postgis public.pgfi

Re: [postgis-users] pgsql2shp dbf file encoding

2010-10-26 Thread Mark Cave-Ayland
Denis Rykov wrote: After editing dbf file in hex editor and set value at byte 29 to 00h shapefile opens in ArcGIS without encoding troubles (get codepage value from *.cpg file). That's strange. Does anyone know what the behaviour of the psDBF->iLanguageDriver field should be in terms of how

[postgis-users] pgsql2shp - No GID variable

2010-10-26 Thread Andreas Forø Tollefsen
Hi all, When using the pgsql2shp the gid column is not included. I even tried typing a "select gid AS g_id" to include it as a different column name, but this did not work. My syntax: pgsql2shp -f pgfinal2008.shp -h localhost -u user -P pass postgis public.pgfinal2008 "SELECT *, gid as g_id FROM