Re: [postgis-users] Difficult Problem with Polygons

2012-10-29 Thread Mike Toews
On 29 October 2012 21:33, Ed Linde edoli...@gmail.com wrote: Hi All, I need help with 2 hard problems. I store triangles in a table as POLYGON. 1. I want to know for a given triangle, which triangles share an edge (adjacent) with this triangle. Sounds like you have a finite element mesh with

Re: [postgis-users] PostgreSQL HStore and PostGIS

2012-10-26 Thread Mike Toews
On 26 October 2012 12:26, Blair Deaver blairdea...@gmail.com wrote: Can anyone comment on successful or unsuccessful attempts to implement such a technology approach integrating PostGIS with HStore? Here are some links of interest that pair up PostGIS + HStore:

Re: [postgis-users] Finding extra points

2012-10-25 Thread Mike Toews
Sure, use linear referencing functions[1] to interpolate along a line between the two input points. For example, to find 10 points in-between 'POINT(2 8)' and 'POINT(3 5)': select ST_AsText(ST_Line_Interpolate_Point(ST_MakeLine(ST_MakePoint(2, 8), ST_MakePoint(3, 5)), f::float/10)) from

Re: [postgis-users] Invalid endian flag value encountered on Postgis 2.0.1, Postgres 9.x, Windows XP

2012-10-21 Thread Mike Toews
I get the same invalid endian flag value encountered error with your example on PostGIS 2.0. However, if I remove the escapes and use dollar quoting instead, it works: SELECT ST_AsEWKT(ST_GeomFromEWKB($$\001\001\000\000

Re: [postgis-users] Invalid endian flag value encountered on Postgis 2.0.1, Postgres 9.x, Windows XP

2012-10-21 Thread Mike Toews
Oh, I just realized that your example would have worked fine with escape strings prefixed with E: select st_astext(ST_GeomFromEWKB(E'\\001\\001\\000\\000 \\263\\216\\001\\000\\000\\000\\000\\000\\252\\326''\\301\\000\\000\\000\\000X\\025.\\301'::bytea)) (note the above has a space character in

Re: [postgis-users] service field in postgres

2012-10-11 Thread Mike Toews
On 12 October 2012 06:17, Sandro Santilli s...@keybit.net wrote: You can leave that field blank. I've actually no idea what it is used for. From what I understand, it is used for a PostgreSQL service connection. See: http://hub.qgis.org/issues/3522

Re: [postgis-users] Spatial Reference ID

2012-10-10 Thread Mike Toews
From the pastebin text: NAD27 UTM Zone 10N http://spatialreference.org/ref/epsg/26710/ SRID=26710 Try it! -Mike On 10 October 2012 20:18, Ed Linde edoli...@gmail.com wrote: Hi All, I have this file I downloaded from geocomm and I am trying to figure out what the SRID for it in postgis would

Re: [postgis-users] How to install Postgresql + Postgis 2.0 on Ubuntu 12-04 LTS

2012-10-02 Thread Mike Toews
On 3 October 2012 02:07, José María jmamu...@gmail.com wrote: Thanks Stefano, But when I try to follow the steps I get errors. If you could to install everything without problems Could you help me? Please. Thanks again, Hi José, I wrote those instructions, and I frequently test them out on

Re: [postgis-users] where is postgis.sql?

2012-10-01 Thread Mike Toews
On 2 October 2012 13:53, Vince Miller vincentpmil...@yahoo.com wrote: Thanks Mike, but your method produces the following message: ERROR: could not open extension control file /usr/share/postgresql/9.1/extension/postgis.control: No such file or directory. My OS is Ubuntu server 12.04,

Re: [postgis-users] where is postgis.sql?

2012-09-29 Thread Mike Toews
Hi Vince, What operation system? What method did you install? If you have pg_config installed (part of the development package of postgres), you can find the share and contrib directory: $ ls `pg_config --sharedir`/contrib But, since you are using 9.1, you should use the extension method of

Re: [postgis-users] SRID in geometry_columns view

2012-07-24 Thread Mike Toews
On 25 July 2012 09:49, Richard Greenwood richard.greenw...@gmail.com wrote: I am having difficulty getting my views' SRIDs into the geometry_columns view in PostGIS 2.0. The doc's [1] suggest casting the geometry in the view so I tried: wkb_geometry::geometry(3739) which generates the

Re: [postgis-users] SRID in geometry_columns view

2012-07-24 Thread Mike Toews
On 25 July 2012 13:48, Richard Greenwood richard.greenw...@gmail.com wrote: Okay, but there is an example in the doc's showing just geometry(srid) which doesn't work for me. Guess that's what you're saying? I now see what you are looking at, and it's a typo in the docs. I'm dealing with a

Re: [postgis-users] Error compiling postgis 2.0.1 in Centos 6.3

2012-07-18 Thread Mike Toews
On 19 July 2012 08:44, Nahum Castro pedro1...@yahoo.com wrote: The problem with the postgresql.org repo is that do not have gdal and raster capabilities. Hi Nahum, A few days ago I finished some instructions for CentOS 6, using PGDG and EPEL.

Re: [postgis-users] Error compiling postgis 2.0.1 in Centos 6.3

2012-07-18 Thread Mike Toews
On 19 July 2012 11:28, Devrim GÜNDÜZ dev...@gunduz.org wrote: Yes, I am aware of those dependencies, and as you wrote, it is too many RPMs to copy to our repo -- so I'm not inclined to copy them, sorry :( OK, I've reworded instructions to reflect this situation with respect to CentOS. -Mike

Re: [postgis-users] spatialreference.org srid insert error

2012-07-17 Thread Mike Toews
On 18 July 2012 07:19, Peter Tittmann ptittm...@gmail.com wrote: Seems a little strange that spatialreference.org would produce an invalid insert statement. Regardless, thanks for the pointer. Personally, I feel that spatialreference.org is a bit broke (but otherwise an excellent resource!).

Re: [postgis-users] oddity with computing areas

2012-07-17 Thread Mike Toews
Hi Eric, Are your geometries valid? See the following example to illustrate my point: with data as (select 'POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))'::geometry AS geom1, 'POLYGON((0 0, 1 0, 1 1, 0 1, 0 0, 1 0, 1 1, 0 1, 0 0))'::geometry AS geom2) select st_isvalid(geom1), st_area(geom1),

Re: [postgis-users] oddity with computing areas

2012-07-17 Thread Mike Toews
On 18 July 2012 09:46, Mike Toews mwto...@gmail.com wrote: with data as (select 'POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))'::geometry AS geom1, 'POLYGON((0 0, 1 0, 1 1, 0 1, 0 0, 1 0, 1 1, 0 1, 0 0))'::geometry AS geom2) select st_isvalid(geom1), st_area(geom1), st_isvalid(geom2), st_area

Re: [postgis-users] Make a 3D table in PostGIS

2012-07-16 Thread Mike Toews
If you are using PostGIS 2.0, you can use the typmod syntax by adding Z to the geometry type. For example, Point - PointZ: CREATE TABLE my3d( gid serial primary key, geom geometry(PointZ), name character varying(20) not null ); Then you can use functions like ST_MakePoint [1] to construct

Re: [postgis-users] Bounding Box intersection

2012-07-14 Thread Mike Toews
On 14 July 2012 00:35, Ed Linde edoli...@gmail.com wrote: Hi All, I have a table with linestring geometries, and I have the co-ordinates of a rectangle/ bounding box. I want to get only a restricted set of geometries that lie within or intersect with this box. Is there a way to construct

Re: [postgis-users] Casting a point and a polygon to geometry

2012-07-09 Thread Mike Toews
On 10 July 2012 06:53, Roba Binyahib roba.binya...@kaust.edu.sa wrote: ST_Crosses(geometry g1, geometry g2); but I want g1 to be column of points and g2 a column of geometry, so how can I convert them to geometry enable to use the function By column of points, do you mean a PostGIS type, or a

Re: [postgis-users] Create topologic layers from simple geometries

2012-06-28 Thread Mike Toews
On 27 June 2012 23:51, celati laurent lcel...@latitude-geosystems.com wrote: Hello Mike, I renaming my table Land_cover table to land_cover. This fixed the object naming problem; your new issue is not related. I have a new error message : INSERT INTO nei_topo(nei, topo) SELECT

Re: [postgis-users] Fwd: geos_3.3.3-1_i386.changes ACCEPTED into unstable

2012-05-24 Thread Mike Toews
On 24 May 2012 20:10, Paolo Cavallini cavall...@faunalia.it wrote: Done. Thanks Francesco Lovergine, and the Debian staff. Could someone update the howto? All the best. I've added a wiki page: http://trac.osgeo.org/postgis/wiki/UsersWikiPostGIS20Debian70src and updated the series: install

Re: [postgis-users] Installing on Debian

2012-05-21 Thread Mike Toews
On 21 May 2012 23:04, Paolo Cavallini cavall...@faunalia.it wrote: Hi all. The Debian package for 2.0 is still not done (any volunteer here?). Is there a clean install howto for Debian unstable/testing? I only found outdated/incomplete instructions. All the best, and thanks. Hi Paolo,

Re: [postgis-users] use index for order by xmin(geom)

2012-05-16 Thread Mike Toews
Hi Melchior, xmin is actually a PostgreSQL system column used for transactions, not a PostGIS function. http://www.postgresql.org/docs/current/static/ddl-system-columns.html The KNN nearest neighbour feature that I think you are describing is the - and # operators. Check out the documentation

Re: [postgis-users] use index for order by xmin(geom)

2012-05-16 Thread Mike Toews
On 17 May 2012 09:10, Melchior Moos melchior.m...@gmail.com wrote: Sorry, actually st_xmin is the function I'm after. I want to select the whole table ordered by minimum x coordinate of the gemertries. When I do it the naive way postgresql needs half an hour to prepare the ordering before the

Re: [postgis-users] Closing polylines

2012-05-12 Thread Mike Toews
On 12 May 2012 09:53, george wash gws...@hotmail.com wrote: Hi, does anyone know of a function or algorithm which will help me in closing open multilinestrings (contours) (I am using Postgis 2.0, Win 7 64). My contours are made up of several segments, all multilinestrings, which sometime are

Re: [postgis-users] building a polygon with variables

2012-05-08 Thread Mike Toews
On 9 May 2012 02:26, Gold, Jack L (US SSA) jack.g...@baesystems.com wrote: I want to be able to replace l, b, r, and t with variable values in a plpgsql function like so: It looks like you want to make a polygon from 'left', 'bottom', 'right' and 'top'. Rather than formatting WKT, you could

Re: [postgis-users] POSTGIS Security

2012-05-08 Thread Mike Toews
On 9 May 2012 04:45, Valerie Reinert vcrein...@gmail.com wrote: I've been told that POSTGIS has a new security package.  Someone said it was called POSTGIS ES?  Can anyone point me to the information on line or send me documentation. I think you heard about SE-PostgreSQL or Security-Enhanced

Re: [postgis-users] DE-9IM question

2012-05-08 Thread Mike Toews
On 9 May 2012 03:46, fork forkandw...@gmail.com wrote: Does anyone know of an exhaustive reference of DE-9IM matrices, with pictures? A really handy visual tool to work with DE-9IM is JTS TestBuilder. You can interact with the geometries and the results, which makes it a pretty good educational

Re: [postgis-users] Convert MySql to Postgres

2012-05-06 Thread Mike Toews
On 6 May 2012 19:23, Smaran Harihar smaran.hari...@gmail.com wrote: Could you provide me with a good resource or guide me so that I can do this successfully the first time? I don't have any recent experience with this, but there is a pretty good list of free tools and scripts on the PostgreSQL

Re: [postgis-users] Using PosGIS in one dimension

2012-04-26 Thread Mike Toews
On 27 April 2012 00:05, Alvaro Tejero Cantero alv...@minin.es wrote: Hi Mike! Thank you. Your tip about loading numpy data into PostgreSQL will be key for my application (http://stackoverflow.com/questions/8144002/use-binary-copy-table-from-with-psycopg2) Great it's helpful! It probably

Re: [postgis-users] Using shp2pgsql

2012-04-25 Thread Mike Toews
For future reference, when loading an SQL script with psql, to stop and exit on the first error, add the option: -v ON_ERROR_STOP=1 This is off by default, which is why you saw the repeated (and useless) error messages. With this option enabled, you will only see the first error, so you will

Re: [postgis-users] Using PosGIS in one dimension

2012-04-25 Thread Mike Toews
On 26 April 2012 07:41, David William Bitner bit...@gyttja.org wrote: If you follow PostgreSQL development, you can see that 9.2 is bringing a whole suite of range data types for dealing with one dimensional intervals with the same expressivity as PostGIS. Not there yet, but coming soon

Re: [postgis-users] Adding constraint

2012-04-25 Thread Mike Toews
Add a check constraint with the logic: ALTER TABLE test ADD CONSTRAINT aaa_atrib_2_not_null CHECK ( CASE WHEN attrib_1 = 'AAA'::text THEN attrib_2 IS NOT NULL ELSE true END); -Mike On 26 April 2012 08:34, Piotr Pachół piotrpac...@gmail.com wrote: Hello, Is it possible to add

Re: [postgis-users] Using PosGIS in one dimension

2012-04-25 Thread Mike Toews
On 26 April 2012 09:54, Alvaro Tejero Cantero alv...@minin.es wrote: David, Mike, thank you very much for this spot-on information! I have two follow-up questions: 1/ is there an estimated release date for pg 9.2? (in its stead: are Postgres pre-release versions usually 'stable enough' - I

Re: [postgis-users] compiling documentation

2012-04-23 Thread Mike Toews
The Make targets are listed and described in the doc/README file: http://trac.osgeo.org/postgis/browser/trunk/doc/README -Mike ___ postgis-users mailing list postgis-users@postgis.refractions.net

Re: [postgis-users] configure error: could not find gdal

2012-04-18 Thread Mike Toews
On 18 April 2012 20:32, Simon Ortet simon.or...@gmail.com wrote: Hi, I'm trying to install postgis 2.0 from source and I get this error when running ./configure --with-pgconfig=/usr/local/pgsql/bin/pg_config: RASTER: Raster support requested checking for GDAL = 1.6.0... found checking

Re: [postgis-users] configure error: could not find gdal

2012-04-18 Thread Mike Toews
On 18 April 2012 20:32, Simon Ortet simon.or...@gmail.com wrote: I'm running a Debian 6.0.4 64bits. GDAL is installed from source and gdal-config is in the path. A gdal-config --version command returns 1.9.0 Oh sorry, missed that. I've seen other issues with GDALAllRegister, so you aren't

Re: [postgis-users] configure error: could not find gdal

2012-04-18 Thread Mike Toews
Here is one of the issues with GDALAllRegister: http://postgis.refractions.net/pipermail/postgis-users/2012-March/033043.html Do you remember the details of building GDAL? What version of GEOS do you have, and did you also install it from source for GDAL? $ geos-config --prefix $ geos-config

Re: [postgis-users] Strange ST_Area problem

2012-03-25 Thread Mike Toews
On 25 March 2012 12:19, Eric Ladner eric.lad...@gmail.com wrote: Would EPSG:32230 be appropriate?  (WGS 72, UTM zone 30N)  I'm dealing with things roughly in the 30.0 to 31.0N range. EPSG:32630 is a better projected reference, since it shares the same spheroid, WGS 84, as EPSG:4326 (rather than

Re: [postgis-users] Removed double quotes from column and table names

2012-03-20 Thread Mike Toews
On 21 March 2012 11:52, Simon Greener si...@spatialdbadvisor.com wrote: Thanks all for the suggestions. S If you are using postgres 9.0 or later, try something like this to rename tables: DO $$DECLARE r record; BEGIN FOR r IN (SELECT relname, regexp_replace(lower(relname),

Re: [postgis-users] creating a grid; transform error

2012-03-15 Thread Mike Toews
On 16 March 2012 15:47, Puneet Kishor punk.k...@gmail.com wrote: I am trying to create a simple 1 deg x 1 deg grid and transform it to spherical mercator        SELECT ST_Transform(ST_MakeEnvelope(minx, miny, maxx, maxy, 4326), 900913) the_geom        FROM (                SELECT lng

Re: [postgis-users] creating a grid; transform error

2012-03-15 Thread Mike Toews
On 16 March 2012 16:48, pcr...@pcreso.com wrote: Because the Mercator projects the poles at infinity, Google Maps cannot show the poles. Instead it cuts off coverage at 85° north and south. Brent Wood This looks like sound advice. You can update your query to respect that latitude range

Re: [postgis-users] creating a grid; transform error

2012-03-15 Thread Mike Toews
On 16 March 2012 16:52, Puneet Kishor punk.k...@gmail.com wrote: Thanks Mike... works. I just noticed there was something funny going on with the generate_series cross product, so it wasn't producing as many rows. It should be: SELECT ST_Transform(ST_MakeEnvelope(minx, miny, maxx, maxy, 4326),

Re: [postgis-users] update a geometry field from real fields from postgis datatable

2012-03-13 Thread Mike Toews
You can avoid float8 - text - float8 conversions with something like: update mytable set geom = ST_SetSRID(ST_MakePoint(lon, lat), 4326) (I'm guessing SRID=4326, but yours could be different) -Mike On 14 March 2012 09:52, francis francis.mil...@free.fr wrote: hello, I have a table with

Re: [postgis-users] Spatial column from text via a VIEW, Possible?

2012-03-06 Thread Mike Toews
On 7 March 2012 06:10, Bob Basques bob.basq...@ci.stpaul.mn.us wrote: ...    ST_AsText(ST_Transform(ST_SetSRID(ST_MakePoint(part3::numeric, part4::numeric),4326)), 200068) as geom_city ... ERROR:  function st_transform(geometry) does not exist LINE 4:   

Re: [postgis-users] Calling pgsql2shp.exe via python

2012-02-20 Thread Mike Toews
On 21 February 2012 13:39, David Quinn daithiqu...@gmail.com wrote: Thanks for the link, Stefan. After testing out a few approaches this worked: import subprocess subprocess.call(['C:/Program Files (x86)/PostgreSQL/9.1/bin/pgsql2shp.exe', '-f', 'D:\testShapefile.shp', '-h localhost', '-u

Re: [postgis-users] importing shapefile error

2012-02-15 Thread Mike Toews
On 16 February 2012 10:17, Zelio Fernandes zelio.f...@gmail.com wrote: zelio@zelio-desktop:~$ /usr/lib/postgresql/9.1/bin/shp2pgsql -s 4326 -i -I /home/zelio/Desktop/Final(2)/FOREST.shp public.FOREST | psql -d prakasam bash: syntax error near unexpected token `(' zelio@zelio-desktop:~$ This

Re: [postgis-users] radius of buffer parameter issue at st_buffer function...

2012-01-17 Thread Mike Toews
Are you sure your coordinates are projected? Could you get an example EWKT from you dataset using: SELECT ST_AsEWKT(geom) FROM mytable LIMIT 1; If you are seeing something like POINT(147.65625 -33.046875), which has linear units of degrees (not metres), then you need to properly set the SRID and

Re: [postgis-users] new functions

2012-01-09 Thread Mike Toews
Also another comment for your transrotate function: you can use 1 call to ST_Affine, rather than 3 indirect calls with st_rotate(st_translate(st_rotate(. You just need to wrangle the trigonometry in the affine transformation matrix correctly. I have an enhancement for a st_rotate with a point of

Re: [postgis-users] Error on updating geometry column from two columns value

2011-12-01 Thread Mike Toews
ST_GeomFromText turns WKT into a geometry, not SQL. You can either format WKT (text) using: ST_GeomFromText('POINT(' || NEW.koordinat_x || ', ' || NEW.koordinat_y || ')', 32748) Or, a simpler/faster/lossless geometry constructor would be to pass the floating point values directly to a point

Re: [postgis-users] Building GEOS 3.3.1 on Ubuntu

2011-11-26 Thread Mike Toews
Skip the autogen.sh step, since you didn't download via SVN (that's what the instructions say). Here are your steps for Ubuntu from the geos-3.3.1 directory: ./configure make make check sudo make install sudo ldconfig -Mike On 27 November 2011 18:47, Aren Cambre a...@arencambre.com wrote: I

Re: [postgis-users] Problems installing PostGIS 2.0SVN on PostgreSQL 9.1

2011-11-19 Thread Mike Toews
On 18 November 2011 17:11, webs...@web.de wrote: cd postgis-2.0.0SVN ./configure --with-pgconfig=/usr/local/pgsql/bin/pg_config make make install It's a good idea to also run a [sudo] ldconfig command here createdb db createlang plpgsql db When loading postgis.sql definitions with...

Re: [postgis-users] The use of substring()

2011-10-23 Thread Mike Toews
On 24 October 2011 15:01, Andy Colson a...@squeakycode.net wrote: Assuming your data looks something like: filename --- high pass 1/1/2011.ecw low pass 5/13/1999.ecw I'd use something like: update raster set date_of_creation = substring(filename from '\d+/\d+/\d+')::timestamp;

Re: [postgis-users] representing 3D shapes, e.g. gml:AbstractSolidType in PostGIS?

2011-10-13 Thread Mike Toews
On 14 October 2011 05:49, Courtin Olivier olivier.cour...@oslandia.com wrote: Global aim, is to have a 3D topological library. So something acting like GEOS, but for surfaces and solid. First step will be to look closer if available 3D library could be an help, yes or no. (December 2011 -

Re: [postgis-users] Why is my PostGIS query not using a spatial index?

2011-09-12 Thread Mike Toews
What version of PostGIS/PostgreSQL? With 1.5/9.0, my explain analyze results are different than yours, where line 4 from EXPLAIN ANALYZE for both queries show: Index Scan using geoplanet_place_bbox_id on geoplanet_place -Mike ___ postgis-users mailing

Re: [postgis-users] ST_Transform troubles

2011-06-27 Thread Mike Toews
On 27 June 2011 19:54, Frans Knibbe frans.kni...@geodan.nl wrote: To me the argument We are ignoring the standard because everyone else is doing the same comes across as rather weak. The whole point of standards is that you comply with them, otherwise they are useless. I fully agree that

Re: [postgis-users] ST_Transform troubles

2011-06-23 Thread Mike Toews
On 24 June 2011 01:19, Frans Knibbe frans.kni...@geodan.nl wrote: POINT(6.86264236062518 53.3160795502069) There are two things wrong with this result: 1) The coordinates are in the wrong order (EPSG:4326 uses latitude, longitude). They are in the correct order. Standards say X, Y which are

Re: [postgis-users] terminated server connection during st_isvalid()

2011-06-07 Thread Mike Toews
On 8 June 2011 01:26, Birgit Laggner birgit.lagg...@vti.bund.de wrote: But I am still curious why this crashes the server connection... It looks like a bug. With a recent SVN version of PostGIS on PG 8.4 here is the moment before the crash: NOTICE: [lwgeom.c:lwgeom_release:571] releasing type

Re: [postgis-users] Enter details into Geom column

2011-05-30 Thread Mike Toews
If you have a table named CLEANEDCAMDENGPS (in public), and you want a column GPS_POINTS: SELECT AddGeometryColumn('CLEANEDCAMDENGPS', 'GPS_POINTS', 4326, 'POINT', 2); works fine. There is some confusion in your first message with another table CAMDENGPS and another geometry column geom. Also,

Re: [postgis-users] [postgis-devel] In-place upgrade to 2.0 (New features in postgreSQL 9.1. - trigram)

2011-05-24 Thread Mike Toews
On 25 May 2011 11:47, Paragon Corporation l...@pcorp.us wrote: Paul That's really excellent, and boy I wish I knew what file I should be reading to know all these new features... what file should I be reading? Probably the best one to look at is this one since it has examples as well.

Re: [postgis-users] ogr dxf

2011-05-22 Thread Mike Toews
Here is the main resource: http://www.gdal.org/ogr/drv_dxf.html And Frank's blog regarding the driver: http://fwarmerdam.blogspot.com/search/label/dxf -Mike On 20 May 2011 06:13, Bob Pawley rjpaw...@shaw.ca wrote: Hi Has anyone used OGR to convert DXF to Postgis and Postgis to DXF?

Re: [postgis-users] encryption of PostGIS databases

2011-05-12 Thread Mike Toews
Hi Paul, This is more of a PostgreSQL question, see: http://www.postgresql.org/docs/9.0/static/encryption-options.html You can require that all connections use SSL and make sure all users have strong passwords. -Mike On 13 May 2011 00:30, Malm Paul paul.m...@saabgroup.com wrote: Hi, Is there

Re: [postgis-users] GeomFromText in a user function.

2011-04-26 Thread Mike Toews
On 27 April 2011 05:46, Charles E. Deaton cdea...@corp.realcomp.com wrote: I have been trying to create a user function that I can call as needed by passing in bbox coordinates. Are you trying to select items in a box-shaped geometry? There are a few better ideas to construct a simple box

Re: [postgis-users] please help convert raster problem

2011-04-01 Thread Mike Toews
pgAdmin has a confusing behavior to show a blank data cell if the number of characters is above some threshold in size. You can query the character length of a text result to see if it at leasts exists in some form: select character_length(st_astext(rast)) from tablename; hopefully you'll see a

Re: [postgis-users] a couple of procedural questions for populating tables programmatically

2011-03-08 Thread Mike Toews
On 9 March 2011 03:07, Mr. Puneet Kishor punk.k...@gmail.com wrote: I have a couple of procedural questions. I am populating my table with point and cell geometries programmatically. First question: When I INSERT values other than the geometry in rows and then UPDATE the geometry in a second

Re: [postgis-users] meters to degrees

2011-03-07 Thread Mike Toews
You are using EPSG:3044, correct? http://spatialreference.org/ref/epsg/3044/ http://spatialreference.org/ref/epsg/3044/This projection has units of metres. ST_DWithin and related functions use the same units of length as defined in the projection, which in this case is metres, not degrees. You

Re: [postgis-users] meters to degrees

2011-03-07 Thread Mike Toews
 select getallpointsincircle(56.162882,10.203944,45000.0), all the indexes are returned. Approximately the distance between these places is 40 km. But when I exchange 45000.0 with 0.46 i will get proper index(16 in this case). 2011/3/7 Mike Toews mwto...@gmail.com You are using EPSG:3044

Re: [postgis-users] A way to split polygons?

2011-03-03 Thread Mike Toews
Take a look at ST_Simplify http://postgis.refractions.net/docs/ST_Simplify.html Or ST_SimplifyPreserveTopology if you want to preserve boundaries: http://postgis.refractions.net/docs/ST_SimplifyPreserveTopology.html -Mike On 4 March 2011 09:44, Peter N. Schweitzer pschweit...@usgs.gov wrote:

Re: [postgis-users] Error Installation

2011-01-11 Thread Mike Toews
Hi, Do you have the development files for PostgreSQL installed? Did the ./configure step show any warnings or errors? -Mike On 12 January 2011 04:13, mahadzar ayala mahadzar_ay...@yahoo.com wrote: Hi, I'm using Linux Suse SUSE Linux Enterprise Server 11 (ia64) 2.6.27.45-0.1-default kernel

Re: [postgis-users] Query using ST_transform fails

2010-11-04 Thread Mike Toews
expect problems doing so as i installed PostGis after Proj 4 ? Best regards, Torsten. Am Dienstag, 2. November 2010 22:34:05 schrieb Mike Toews: It appears the grid shift files are missing. These are not necessarily installed by default. Are you using http://www.pgrpms.org/ ? Is proj-nad

Re: [postgis-users] Query using ST_transform fails

2010-11-02 Thread Mike Toews
It appears the grid shift files are missing. These are not necessarily installed by default. Are you using http://www.pgrpms.org/ ? Is proj-nad installed? Did you install proj.4 from source? If so, did you get the ZIP files and put them in the right place before configuring? -Mike On 2 November

Re: [postgis-users] Query using ST_transform fails

2010-11-02 Thread Mike Toews
Also, what is the source SRID of your geometry column(s)? If you're not sure, check the geometry_columns table, the constraints used in the DDL, or try: select distinct st_srid(way) from planet_osm_point; -Mike On 2 November 2010 14:09, Torsten Mohr tm...@s.netic.de wrote: Hello, (i

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 Mike Toews
,-54.5029907226562 -25.4447135925293). I tried ST_Affine but I don't know the correct parameters, I tried ST_Scale but I had the same problem. My idea was transform and set srid. On Tue, Oct 26, 2010 at 11:44 PM, Mike Toews mwto...@gmail.com wrote: Hi Wagner, I'm not sure what you mean by geo

Re: [postgis-users] Basic duplicating database question

2010-10-21 Thread Mike Toews
On 21 October 2010 04:38, lplateandy a...@centremaps.co.uk wrote: Of course, even better would be a way to reindex whilst a database is in use but i'm under the impression that this is not possible at the moment? If you DROP/CREATE your index then reads are blocked. But if you use REINDEX then

Re: [postgis-users] Basic duplicating database question

2010-10-21 Thread Mike Toews
On 21 October 2010 07:24, lplateandy a...@centremaps.co.uk wrote: Hi Mike, OK - that's really useful. Does that only work for 9 or does it just happen you're pointing to the 9 document? The doc says It also takes an exclusive lock on the specific index being processed, which will block

Re: [postgis-users] AddGeometryColumn BOX3D

2010-10-19 Thread Mike Toews
Hi Jan, Here is a wrapper function to directly pass the double precision values to minimize any precision error due to text conversion: CREATE OR REPLACE FUNCTION ST_MakeBox3D(minx double precision, miny double precision, minz double precision, maxx double precision, maxy double precision, maxz

Re: [postgis-users] create xml file from sql table

2010-10-19 Thread Mike Toews
From a user's standpoint, PostgreSQL (and PostGIS) does not write files. In order to read/write files, you need tools (psql, pgAdminIII, pgsql2shp, etc.). You need to write a custom tool for your situation in PHP. Ignoring details, you will need a database connection from PHP to PostgreSQL, run

Re: [postgis-users] AddGeometryColumn BOX3D

2010-10-18 Thread Mike Toews
Hi Jan, box3d is not a geometry, but it is it's very own type (along with box2d). If you have pgAdminIII, you can browse these types (you may need to enable visibility of types in the options), or if you use psql then the command \dT will show all types. Since it isn't a geometry, you can

Re: [postgis-users] pgsql2shp

2010-10-11 Thread Mike Toews
As far as I know, all versions of pgsql2shp work just fine on Win7, and they should do exactly what they are documented to do for the situation you describe. What exactly are your problems? If the command had an error and didn't produce any files, what did you type? -Mike On 10 October 2010

Re: [postgis-users] Hello

2010-10-02 Thread Mike Toews
You can try making a map visually in QGIS, then export it to MapServer using a plugin: http://spatialserver.net/qgis2ms/ The conversion isn't always 1-to-1, but it a good visual start to developing MAP files. -Mike On 1 October 2010 23:17, Nitesh Phadatare nsp@gmail.com wrote: how to use

Re: [postgis-users] Geography type

2010-09-23 Thread Mike Toews
You need PostGIS version 1.5.x and you can read about the geography type here: http://postgis.refractions.net/documentation/manual-1.5/ch04.html#PostGIS_Geography and see supported functions here: http://postgis.refractions.net/documentation/manual-1.5/ch08.html#PostGIS_GeographyFunctions -Mike

Re: [postgis-users] How remove a single part from a multipart geometry

2010-09-23 Thread Mike Toews
There aren't any delete/remove/drop geometry functions, so you would need dissect and re-create the geometry. But, if you want to do this visually, this is easy. If you have a recent version of QGIS, just start editing and use the Delete part edit tool. -Mike On 23 September 2010 10:28, Andrea

Re: [postgis-users] GEOS pointonsurface() threw an error!

2010-08-17 Thread Mike Toews
On 17 August 2010 22:02, Ricardo Bayley ricardo.bay...@gmail.com wrote: I have other 96 invalid geometries in a table of 22k records. From those 96, only 1 has the Self-intersection invalid reason. The rest of them have a Ring Self-intersection. These last dont through an error exception, only

Re: [postgis-users] st_transform, irreversible?

2010-08-12 Thread Mike Toews
Hi, Your coordinates may be flipped. Was it 59N 18E? If so, use x,y notation: 'POINT(18 59)', which results in 'POINT(18.6 58.99905)', which is close enough. Also keep in mind that you are outside the projection bounds: http://spatialreference.org/ref/epsg/3021/ (just a bit

Re: [postgis-users] postgres data tables package (ORACLE Forms replacement?)

2010-08-05 Thread Mike Toews
Hi John, For the desktop, the best I've seen is MS Access, but it is certainly not FOSS. It is well used, documented, supported, easy form development, etc. A runner up is OpenOffice.org, but I haven't been able to develop too much on it, because I run into odd GUI behaviours that are

Re: [postgis-users] How to get geometry enabled Tables form Postgresql/postgis

2010-07-29 Thread Mike Toews
You can either assume that they are all listed in geometry_columns or geography_columns. Or you can do a more complicated query to include other tables than in geometry/geography, (this is from QGIS code[1]): select f_table_name, f_table_schema, upper(type), pg_class.relkind from

Re: [postgis-users] How to get geometry enabled Tables form Postgresql/postgis

2010-07-29 Thread Mike Toews
/qgspgsourceselect.cpp?rev=13922#L714 -Mike On 29 July 2010 06:34, Mike Toews mwto...@gmail.com wrote: You can either assume that they are all listed in geometry_columns or geography_columns. Or you can do a more complicated query to include other tables than in geometry/geography, (this is from

Re: [postgis-users] How to import SHP without superuser permission?

2010-07-28 Thread Mike Toews
Is your user account the owner of geometry_columns? (often this is postgres) If not, then use the commands to allow permissions: GRANT ALL ON TABLE geometry_columns TO someuser; -- And while you are at it: GRANT ALL ON TABLE spatial_ref_sys TO someuser; If you have multiple users, you might

[postgis-users] PostGIS to SpatiaLite

2010-07-24 Thread Mike Toews
Hi all, I need to copy several PostGIS tables to a SpatiaLite file, so it can be used on field laptops. A similar question appeared a year ago[1], but there were no solutions. I understand that ogr2ogr has support for SpatiaLite using GDAL 1.7.x, however I cannot seem to configure the GDAL

Re: [postgis-users] PostGIS to SpatiaLite

2010-07-24 Thread Mike Toews
=mypass myschema.my2ndtable The resulting file work with viewers, including SpatiaLite GUI/GIS, Quantum GIS. I've started http://trac.osgeo.org/postgis/wiki/SpatiaLite -Mike On 24 July 2010 10:43, Mike Toews mwto...@gmail.com wrote: Hi all, I need to copy several PostGIS tables to a SpatiaLite file

Re: [postgis-users] Record permission

2010-07-23 Thread Mike Toews
You after something called row level permissions. Search that term and see some examples on how to implement it. It is possible, but it is difficult to set up and maintain. PostgreSQL does not support it out of the box. Basically, you need to have a table of users, which mirrors your pg_user

Re: [postgis-users] making a line from a known point and direction

2010-07-20 Thread Mike Toews
Except that you need radians .. not degrees, so multiply your degrees by pi()/180 to convert to radians. See this similar discussion: http://postgis.refractions.net/pipermail/postgis-users/2010-January/025752.html -Mike On 20 July 2010 04:57, Fred Lehodey leho...@gmail.com wrote: Hi ahmet,

Re: [postgis-users] Multipoint thresold

2010-07-02 Thread Mike Toews
What tells you there is nothing in your multipoint geometry? Client software can be buggy with large unexpected numbers, so the error may be with whatever tool you are using. Can you verify the number of points using SQL? -Mike On 2 July 2010 08:49, Biddy newska...@riomhphost.net wrote: Hi,

Re: [postgis-users] whats the different between ST_Extent() and ST_Estimated_Extent()

2010-06-28 Thread Mike Toews
ST_Estimated_Extent for large tables can be faster, since it uses cached statistics from the last VACUUM ANALYZE. The time difference is not evident with only a few rows of data. Also, ST_Estimated_Extent only works on tables, and not VIEWs (an error is returned). I had to overwrite the

Re: [postgis-users] Converting a LineString to MultiPoint

2010-06-17 Thread Mike Toews
If you have PostGIS 1.5, then you can use ST_DumpPoints: http://postgis.refractions.net/docs/ST_DumpPoints.html E.g.: SELECT gid, ST_AsText(ST_Collect(ST_AsText(geom))) FROM ( SELECT gid, (ST_DumpPoints(g.geom)).* FROM (SELECT 1 as gid, 'LINESTRING (0 0, 0 3, 3 4)'::geometry AS geom

Re: [postgis-users] Converting a LineString to MultiPoint

2010-06-17 Thread Mike Toews
UNION ALL SELECT 2 as gid, 'LINESTRING (1 1, 2 6, 7 7)'::geometry AS geom) AS g; Again, this is a complete hack, and assumes you have all LINESTRING types. I use ST_AsEWKT in case you have more than 3 dimensions and/or an SRID. -Mike On 17 June 2010 16:36, Mike Toews mwto...@gmail.com wrote

Re: [postgis-users] Using grids transformation method with PostGis

2010-06-15 Thread Mike Toews
The problem is probably with the grid files and proj.4. Is there any way to download the GSB files for testing? You can test with cs2cs to see if the proj4 string works or not. For example, with Canada's NTv2 grid file, I can test to see if I installed it correctly: cs2cs -v +proj=latlong

[postgis-users] Swap Z and M in a geometry with three dimensions

2010-06-15 Thread Mike Toews
Hi, I have a geometry with three dimensions that was incorrectly encoded as LINESTRINGM, but it is a spatial 3D object. How do I swap out the M coordinate and use it for the Z coordinate? Is there a simple way? Thanks. -Mike ___ postgis-users mailing

  1   2   >