Re: [postgis-users] How to eliminate small gaps produced by ST_union?

2012-10-25 Thread pcreso
My impression is that working topologies is slow, especially with large datasets - lots of computation involved. How effective would this be with hundreds of thousands or millions or small polygons? Just running ST_Union() takes hours to days. Thanks Brent Wood --- On Fri, 10/26/12, Sandro

Re: [postgis-users] Creating a simple polygon encompassing a given number of points

2012-09-10 Thread pcreso
Hi Rene, Perhaps something like this? select region, ST_simplify(ST_buffer(ST_convexhull(ST_collect(geom), n),n/3)) from table group by region; ST_simplify removes extraneous vertices - increase the n/3 parameter to remove more vertices, but you'll also need to increase n to ensure all the

[postgis-users] Concave hull problem delaunay triangulation - help needed please

2012-08-31 Thread pcreso
Hi, I'm trying to come up with an approach using Postgis to come up with a polygon representing the outer bounds of a set of points, ie: a polygon passing through all the outer points. Much useful info (as usual - thanks guys!!) at spatialdbadvisor bostongis but my limited understanding is

Re: [postgis-users] Concave hull problem delaunay triangulation -help needed please

2012-08-31 Thread pcreso
Thanks, All things come to those who wait :-) My data is 2D at present... If I can't get thr PL/R solution working I think I'm better off waiting for GEOS 3.4/Postgis 2.1 Cheers,   Brent --- On Sat, 9/1/12, Paragon Corporation l...@pcorp.us wrote: From: Paragon Corporation l...@pcorp.us

Re: [postgis-users] Creating points along a line for every second?

2012-08-17 Thread pcreso
Hi James, I'd do this fairly easily under Linux with a script to iterate through the tasks. In fact I've done it, we have tracklines recorded for an underwater cammera. It takes a picture every 15 seconds, so I navigate along the line in 15 second intervals to get the points. As you describe,

Re: [postgis-users] st_area yields negative value for multi-part polygon

2012-08-17 Thread pcreso
Hi George, That is not a multi-part polygon (multipolygon). It is a polygon with a hole, the hole lies outside the polygon boundary so it is going to give weird results. I'm guessing that what you actually mean to do is not: psql -d test -c SELECT st_area(ST_GeomFromText('POLYGON((-1 -1, 2

Re: [postgis-users] Vector overviews in postgis

2012-08-03 Thread pcreso
On Thu, Aug 02, 2012 at 05:41:23PM -0400, Jean-Daniel Sylvain wrote: Hi, Is it possible to create overviews in postgis to optimise the speed of display for very big vectorial dataset (10 000 000) ? The aim is to be able to look quickly the dataset via a GIS tool like Quantum GIS or GV

Re: [postgis-users] Need help constructing a query

2012-07-20 Thread pcreso
You have not just a spatial dataset but a temporal one as well. You need to define how near the buoy you consider is going past it (a pass) You could wrap an SQL around this, but if you were to use a script to carry out the query, the logic would be something like: 1. get the minimum time for

Re: [postgis-users] Why should these boxes intersect?

2012-07-12 Thread pcreso
Coming from New Zealand, near 180, I think it is fair to say that a geometry with left lon right lon is not wrong. Just that Postgis fails to interpret such correctly. A polygon such as POLYGON((179 -45,181 -45,181 -46,179 -46,179 -45)) is obviously crossing the dateline, and is

Re: [postgis-users] RE : get unique values from raster intersecting apolygon

2012-05-28 Thread pcreso
You could try something like gdal2xyz.py on you raster to create points for each raster cell which can be imported directly into postgis as point geometries, like: psql create table xyz (id serial,x decimal, y decimal, z decimal) gdal2xyz.py raster file | psql copy xyz (x,y,z) from stdin...

Re: [postgis-users] Closing polylines

2012-05-16 Thread pcreso
which you can use as topopolygons or extract as conventional geometries. --- On Tue, 5/15/12, george wash gws...@hotmail.com wrote: thank you pcreso, I had a look at the topology section

Re: [postgis-users] Closing polylines

2012-05-15 Thread pcreso
You can work around this problem by using the Postgis topology capability. It will build polygons (faces) from such lines which you can use as topopolygons or extract as conventional geometries. --- On Tue, 5/15/12, george wash gws...@hotmail.com wrote: From: george wash gws...@hotmail.com

Re: [postgis-users] toTopoGeom performance tips

2012-05-13 Thread pcreso
OK, In my case the linestrings I was constructing polygons from did not have aligned start/end points (nodes), so I loaded them sequentially snapped nodes to pre-existing ones, to generate faces in the topology. I did not use a topogeometry column at all, but extracted the topology faces

Re: [postgis-users] PostGIS Raster with Map Server

2012-05-11 Thread pcreso
It looks like you are missing a quote in your data statement  after 'asdf and my have an extra one at the end? That might help... Brent Wood --- On Sat, 5/12/12, abhishek bansal discover...@gmail.com wrote: From: abhishek bansal discover...@gmail.com Subject: [postgis-users] PostGIS Raster

Re: [postgis-users] Size of a multipolygon

2012-05-01 Thread pcreso
Hey Ben, How goes it? Does http://postgis.refractions.net/documentation/manual-1.5/ST_NumGeometries.html do what you want? FYI, I was interested in this post, as a PL/R user it may interest you as well?

Re: [postgis-users] Adding geometry to an existing table

2012-04-28 Thread pcreso
Hi Shaun, You add a geometry column to the table, then run an update sql to populate it. eg, assuming your table is called mytable, located in the public schema, you want to create a two dimensional point with lat/long coordinates (EPSG:4326) called geom: select

[postgis-users] LWGEOM notice message - what does it mean?

2012-04-23 Thread pcreso
Hi, Can anyone explain this message to me whether it indicates anything I should be concerned about? The stations table contains some 47,000 undersea sample sites. The other tables represent points of observations of various properties such as depth or temperature. The query is to return an

Re: [postgis-users] LWGEOM notice message - what does it mean?

2012-04-23 Thread pcreso
Found the answer Thanks list :-) http://postgis.17.n6.nabble.com/LWGEOM-gist-joinsel-called-with-incorrect-join-type-td3535176.html --- On Tue, 4/24/12, pcr...@pcreso.com pcr...@pcreso.com wrote: From: pcr...@pcreso.com pcr...@pcreso.com Subject: [postgis-users] LWGEOM notice message - what

[postgis-users] help wanted with performance/GIST index question

2012-04-23 Thread pcreso
I'm doing some left outer spatial joins using the operator, which should be relatively quick. When I join across 5 tables, the result is fast enough, explain shows index scans are being applied to the spatial tables. When I add another table, explain shows a seq scan is used, despite the

Re: [postgis-users] How to design a database for continents, countries, regions, cities and POIs?

2012-04-10 Thread pcreso
Hi Michal, One suggestion... There are two ways (at least :-) to do this in a RDBMS. You can have the spatial relationship implicit in the feature geometries, so a spatial query is used, for example, to determine the cities within a country: select * from polygons a, polygons b where a.type

Re: [postgis-users] How to design a database for continents, countries, regions, cities and POIs?

2012-04-09 Thread pcreso
Are you planning to store multiple versions of these polygons, for zoom layers? Generally you need a high res version (eg: coastline) when zoomed in (large scale) and a lower resolution version when zoomed out (you can't see don't need the detail. This may or may not have an impact on your

[postgis-users] Topology working example (was: Postgis topology help)

2012-04-08 Thread pcreso
Hi, The attached script creates a Postgres database, adds Postgis with topology uses linestring geometries as the underlying data to create topologies, then extracts the generated faces as simple polygon geometries. It was a useful learning exercise for me to put this together, with advice

Re: [postgis-users] simplifying a polygon

2012-04-06 Thread pcreso
Hi Dave, I would have thought ST_Simplify() would met your requirements. If you use it with a buffer distance of zero, then the full resolution is retained, but any points on a straight boundary segment which are redundant are removed. This is the minimum number of vertices required to define

Re: [postgis-users] Postgis topology help

2012-04-04 Thread pcreso
Following on from the reply by strk (thanks!!) I'm still working through how to use topologies. I have a script which creates a topology, adds 5 linestrings looking like:      |  |  |  ---    |  |  |  ---    |  |  | validates the result and then

Re: [postgis-users] Postgis topology help

2012-04-04 Thread pcreso
Thanks again for a prompt reply. QGIS is showing the results of the inserts polygonise in the attached image. So, yes, just as you sketched it. I had assumed Polygonize was constructing polygon TopoGeometries ?? Obviously I've missed something somewhere. I can find no info at all on the

[postgis-users] Postgis topology help

2012-04-01 Thread pcreso
I'm after some pointers on how I might use topology in this case: We regularly undertake random stratified two phase trawl surveys for fisheries stock assessments. This requires the survey area to be divided into arbitrary strata, with sample sites randomly defined for each strata. Generally

Re: [postgis-users] St_intersection

2012-03-19 Thread pcreso
Whenever the intersection of two lines is a linestring. eg: select astext(ST_intersection(ST_makeline(ST_Makepoint(0,0), ST_Makepoint(1,1)),ST_Makeline(ST_Makepoint(0.5, 0.5), ST_Makepoint(1.5,1.5; astext  -  LINESTRING(0.5 0.5,1 1) (1 row) Brent

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

2012-03-15 Thread pcreso
Hi, No mercator projection can encompass the poles, as they are asymptotic the latitude values approach infinity. 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 --- On Fri, 3/16/12,

Re: [postgis-users] How to make this invalid polygon valid one

2012-03-10 Thread pcreso
Hi Nicolas, Change your SQL to insert a buffered version of your polygon with a buffer distance of zero. You should get a topologically correct polygon (in this particular case anyway), which is a tracing of the perimeter with any duplicate vertices resolved. eg: insert into test_polygon

Re: [postgis-users] How to make this invalid polygon valid one

2012-03-10 Thread pcreso
I forget where I learned that... probably from Regina Obe at Boston GIS. Also note that from the picture, it should perhaps be a multipolygon, to store a single feature comprising two polygons sharing a point... rather than a single polygon. Cheers,   Brent --- On Sun, 3/11/12, Puneet

Re: [postgis-users] Voronoi in PostGIS

2012-03-09 Thread pcreso
See the tutorials here: http://www.bostongis.com/PrinterFriendly.aspx?content_name=postgresql_plr_tut01 http://www.bostongis.com/PrinterFriendly.aspx?content_name=postgresql_plr_tut02 http://www.bostongis.com/PrinterFriendly.aspx?content_name=postgresql_plr_tut03 They may be of some help.

Re: [postgis-users] Forming a BAND around a linestring

2012-03-02 Thread pcreso
ST_Buffer(linestring, distance) http://www.postgis.org/docs/ST_Buffer.html Note that if your data is lat/long (such as EPSG:4326) with units in degrees, then you will get somewhat distorted buffer distances, and a better result by transforming your linestring to a more suitable projection for

Re: [postgis-users] Forming a BAND around a linestring

2012-03-02 Thread pcreso
I use a custom equal area projection for some large oceanic regions I work in, but depending on the extent of your linestrings, it is likely that the UTM projection for your part of the globe will give a reasonable result, if you are not too near the poles. You may even find native lat/long

Re: [postgis-users] Bogus unknown geometry error from ST_Transform

2012-02-19 Thread pcreso
Does this work? UPDATE gis.gz_2010_48_160_00_500k SET the_geom_3081 = ST_Transform((ST_Setsrid(the_geom, 4326),3081); ie:: is the problem finding the srid from geometry_columns or finding it but ST_Transform() fails even when given the srid? Even if there is a bug, this

Re: [postgis-users] Need help detecting lassos

2012-02-18 Thread pcreso
Hi, Not having tried this, but perhaps: Use ST_Polygonize() on the linestrings as in the example here: http://postgis.org/docs/ST_Polygonize.html You could use ST_Dump() to return the polygons wrap it up in count() for the where clause, so only linestrings able to generate one or more

Re: [postgis-users] advice for quicker display?

2012-02-14 Thread pcreso
Also, In Postgis you can use the ST_Simplfy() function in mapserver zoom (scale dependent) layers. So you have one dataset, and as you zoom out you display features represented by progressively fewer vertices. You don't need every headland of a global coastline dataset plotted until you  until

Re: [postgis-users] advice for quicker display?

2012-02-14 Thread pcreso
That is the name you are giving the index. It is good practice for the name to include the table column(s) the index applies to in the name you give it. --- On Wed, 2/15/12, Bistrais, Bob bob.bistr...@maine.gov wrote: From: Bistrais, Bob bob.bistr...@maine.gov Subject: Re: [postgis-users]

Re: [postgis-users] Trouble seeinglisting tables

2012-02-13 Thread pcreso
Nothing obvious that I can see. psql -d db \d  # should list the tables \d mytable # should list the structure of the table mytable select * from mytable;  # should list the contents of mytable. If you can post the outputs from these commands (the text before the #) we

Re: [postgis-users] Postgis for Postgres 64 bits

2012-02-03 Thread pcreso
For Linux, it has been available for some years. If you need 64bit support, you might consider upgrading :-) Cheers Brent Wood --- On Sat, 2/4/12, CARLOS MUÑOZ cjmun...@yahoo.com wrote: From: CARLOS MUÑOZ cjmun...@yahoo.com Subject: [postgis-users] Postgis for Postgres 64 bits To:

Re: [postgis-users] tool to load dbf into postgresql table

2012-01-29 Thread pcreso
When did this become available? I'm using pgsql2shp from Postgis version 1.5.3 for Linux, which is pretty current, and that is not a listed command line option. Cheers,    Brent Wood --- On Mon, 1/30/12, Richard Greenwood richard.greenw...@gmail.com wrote: From: Richard Greenwood

Re: [postgis-users] Geographic Coordinates

2011-12-31 Thread pcreso
Hi Daniel, The GUI is only available for Windows, which I haven't used much for some years now. So I can't help with that aspect. I would assume the GUI has some way for you to enter the same parameters. As often as not, I find a GUI is an intermediary between me the application I want to

Re: [postgis-users] Geographic Coordinates

2011-12-30 Thread pcreso
pgsql2shp -s 4326 -I shapefile mytable | psql -d mydb where shapefile is the name of your shapefile, eg: myfile.shp mytable is the name of the POstgis table to create populate mydb is the name of od the Postgis database (Postgres with Postgis installed) -s 4326 tells pgsql to create a table

Re: [postgis-users] How to configure Postgis/Postgresql to use with QGIS

2011-12-29 Thread pcreso
Hi Daniel, There are two common ways to do this, using ogr2ogr or shp2pgsql. I suggest you try shp2pgsql as it has a simpler command line. It is a utility bundled with Postgis. If you run it with no arguments it provides help with the syntax. The default ouput goes to stdout, and comprises a

Re: [postgis-users] postgis removed from latest postgres' stack builder?

2011-12-28 Thread pcreso
Hmmm I believe Ubuntu, Debian, OpenSuse, Fedora, etc all have Postgis in 32 64bit prepackaged ready to install. https://wiki.ubuntu.com/UbuntuGIS http://wiki.debian.org/DebianGis/PackageList http://fedoraproject.org/wiki/GIS

Re: [postgis-users] How to configure Postgis/Postgresql to use with QGIS

2011-12-28 Thread pcreso
Hi Daniel, The docs are a good place to start, but here is the simple version, from the command line... If you have got Postgres installed OK, you need to create a new database, then install Postgis into it, so I'm assuming you have a working Postgres superuser account you can use.  Then: #

Re: [postgis-users] speeding up simple pt-in-poly lookups

2011-12-21 Thread pcreso
Puneet, Chopping polygons is pretty simple, with a grid st_intersection(), but you can certainly generalise polygons to reduce the number of vertices size of objects to de-toast... beware however that if you do this then you are actually moving the polygon boundary, therefore a point very

Re: [postgis-users] speeding up simple pt-in-poly lookups

2011-12-20 Thread pcreso
Try this: Create a table with chopped up polygons derived from your continents table. Say you have continents (continent_id, name, the_geom) then you have continents_chopped(chop_id, continent_id, continent_name, the_geom) Spatial index on continents_chopped.polygon SELECT Count(distinct

Re: [postgis-users] Linux installation

2011-11-11 Thread pcreso
Hi Steve, I figure I'll give you the long version :-) We use SLES 11 at work (NIWA, New Zealand) for several servers running postgis/mapserver/etc. The public web mapping portal at http://www.os2020.org.nz has most of it's map layers served from a SLES VM running postgis/mapserver. (The slow

Re: [postgis-users] Query: find the country of a location / city

2011-11-06 Thread pcreso
try something like select placename from table where ST_Contains(geom,point);   This will return the placename for all polygons (geom) which contain the specified point. HTH,    Brent Wood --- On Mon, 11/7/11, Torsten Mohr tm...@s.netic.de wrote: From: Torsten Mohr tm...@s.netic.de Subject:

Re: [postgis-users] ArcGIS GRID data

2011-09-30 Thread pcreso
I have converted such grids to XYZ points using GDAL stored them as Postgis points, but ensure you are clear about your pixel vs grid registration (are the XY coords at cell origin or centre?) I'll leave it to you to determine whether upgrading to a version supporting PGRASTER is viable or

Re: [postgis-users] Unique IDs in Views and Quantum GIS

2011-09-16 Thread pcreso
Hi Phil, If your view is large, you will get sluggish performance with QGIS. One solution is a materialised view, which is not directly supported in Postgres, but can be made to work. This does create a physical table representing the view, which can have appropriate indexes applied. The

Re: [postgis-users] Problem moving database

2011-09-09 Thread pcreso
The issue is that you are trying to install an old version of postgis into the new database. My normal approach (yet to fail - for me at least): create the new database install the appropriate/current version of Postgis in that db (this may require plpgsql as well as running postgis.sql

Re: [postgis-users] Problem with convex hulls that cross the dateline

2011-09-08 Thread pcreso
Welcome to maritime GIS around New Zealand :-) The standard problem! Work in a 0-360 space instead of +-180. EPSG4326 supports both extents (according to EPSG anyway). The problem is the lack of a flag to specify which you want. Improvements in the geography datatype will help in this area.

Re: [postgis-users] converting to lat long

2011-07-15 Thread pcreso
Not quite. You need to reproject the lat long coords to 29101 before writing them to your table. Your first SQL creating the column is fine, the second update needs changing. UPDATE tablename SET geom_col = st_transform(st_setsrid(makepoint(long_dd,lat_dd),4326),29101); this: creates a point

Re: [postgis-users] converting to lat long

2011-07-14 Thread pcreso
Hi, Yes you can, you use the case statement. Here is an example: create table ttt (id serial primary key,   geocode varchar(12),                   lat int,                   lon int); insert into ttt values (default, '1234/5678', null, null); insert into ttt values (default,

Re: [postgis-users] converting to lat long

2011-07-13 Thread pcreso
Glad it helped. You can do that, but that is simply using Postgres columns, you do not require Postgis geometry capabilities to do that. I recommend you avoid upper case characters in table column names, otherwise you'll need to quote them. alter table tablename add column lat_dms int;

Re: [postgis-users] converting to lat long

2011-07-12 Thread pcreso
Instead of storing lat long columns of numbers, create a point geometry with Postgis, you can still select the lat long values as shown below. select addgeometrycolumn('','tablename','geom',4326,'POINT',2); To run this change 'tablename' to the name of the table with the geocode column.

Re: [postgis-users] QGIS - PostGIS - ArcGIS Interaction

2011-06-17 Thread pcreso
Hi Paolo, A quick reply, I don't think this is the place for a long discussion :-) Have a look at the cartographic capabilities of GMT. Framed, annotated borders; legend composer; A0 poster size, etc; rotated extents, 3D perspective views; global projected maps; etc. I can send you plenty of

Re: [postgis-users] QGIS - PostGIS - ArcGIS Interaction

2011-06-16 Thread pcreso
Yep, someone thinks QGIS can clip better than Arc, so can Postgis AFAIK. That doesn't make either more powerful than ArcGIS. I've been using QGIS in a production environment, since v0.2, Postgis since v0.7, GMT since 2.x (I think). I work in what is largely an ESRI house for GIS purposes,

Re: [postgis-users] help with spatial query

2011-06-13 Thread pcreso
Hi, Assuming your cities are point features and you have some column to aggregate on (like name?) try something like this: select setsrid(makepoint(avg(x(geom)),avg(y(geom))),4326) as geom,    sum(pop_1990) as pop_1990,    name from cities group by name ORDER BY pop_1990 DESC LIMIT

Re: [postgis-users] multiline with with to polygon

2011-06-03 Thread pcreso
Use ST_buffer, as below: create table mline (gid serial primary key, name varchar(10)); select addgeometrycolumn('','mline','geom',4326,'MULTILINE',2); insert into mline (name,geom ) values ('one',setsrid(geometryfromtext((174 -45,175 -44),(174 -44,175 -45)),4326)); insert into mline (name,geom

Re: [postgis-users] Create circles using a formula

2011-06-01 Thread pcreso
I'm not conversant with geoserver but have used mapserver to do this sort of thing often enough. I assume your data is in PostGIS, which means your mapserver DATA statement can be an embedded SQL query or a PostGIS view. You can create a view on your table, along the lines of: create view

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

2011-05-29 Thread pcreso
Hi James, I suggest you avoid upper case letters in table column names if you can. It makes a few things easier The syntax in both SQL statements is wrong. Try: select ST_CreateGeometryColumn('public','CLEANEDCAMDENGPS','geom',4326,'POINT',2); the fields are (in order): schema where

Re: [postgis-users] polygon of sphere

2011-05-26 Thread pcreso
Hi Mike, Look at case in your SQL, might meet your needs if the ST_contains()/ST_covers() function reuslt is cached in a select statement, which I think it is now, will be reasonably effective. http://www.postgresql.org/docs/9.0/interactive/plpgsql-control-structures.html select case when

Re: [postgis-users] Fwd: Hello everyone, That is my first message.I am using PostGIS not so long and so I ask you to help me.

2011-05-22 Thread pcreso
This query from http://postgis.refractions.net/pipermail/postgis-users/2009-April/023265.html should give you an idea of how to do this. The radius is an arbitrary value to avoid a full table scan. If you already know which feature is closest just want the closest vertex from that feature,

Re: [postgis-users] how to keep geometry_columns in sync with tables and views

2011-05-18 Thread pcreso
I foubd this an unfortunately ambiguous name. it doesn't populate geometry columns so much as update the geometry_columns table. But irrespective of the name, it is nice to have :-) Cheers   Brent Wood --- On Thu, 5/19/11, Ben Madin li...@remoteinformation.com.au wrote: From: Ben Madin

Re: [postgis-users] Postgis - Mapserver white background

2011-04-27 Thread pcreso
I'm not sure if is just the email doing it or if your CONNECTION string is entirely on one line or not. You might try having a single line if it is wrapped. You can enable DEBUG in the mapfile see any error messages. http://mapserver.org/optimization/debugging.html eg: MAP ... CONFIG

Re: [postgis-users] Calculating variance of a set of points

2011-04-24 Thread pcreso
Hi Aren, If I understand the question, then off the top of my head, untested without getting into calculating spheroidal distances instead of cartesian ones :-) ... given a table loc_table with columns: ref_mark_id location (point geometry) something like: select ref_mark_id,  

Re: [postgis-users] Unique Constraint on Spatial Point violated

2011-04-22 Thread pcreso
I'd try a different approach to loading your data into the table. Try loading your lat/lon values using copy. This will be fastest (specify the field delimiter char): eg: cat file | psql -d db -c copy table from STDIN with delimiter '?'; Then add your geometry column to the table. select

Re: [postgis-users] Unique Constraint on Spatial Point violated

2011-04-22 Thread pcreso
It is likely to be the fastest waty to initially populate the table as a bulk insert. There is nothing stopping you adding rows later however you like. I have populated tables with 250,000,000+ rows like this. The advantage is that once the data is loaded without constraints, you can run

Re: [postgis-users] [postgis-devel] PSC Vote to officially drop support for PostgreSQL 8.3 in PostGIS 2.0

2011-04-21 Thread pcreso
02c worth strictly from a user's perspective: New users will generally start with current latest versions. So they should be fine. Old users who have difficulty upgrading. (Oft times me :-) my call. If I need Postgis to work with 8.3, I use v1.5, if I need later Postgis functionailty, I

Re: [postgis-users] How to create a point geometry from two text fields?

2011-03-25 Thread pcreso
Concatenation of strings geomfromtext or cast to numeric makepoint, I'm not sure which would be faster, but both will work. So (as below)  update mytable set the_geom=ST_GeometryFromText('POINT(' || long || ' ' || lat || ')',4326) or update mytable set

Re: [postgis-users] Publishing WMS from PostTGIS table with ARRAY type field

2011-03-19 Thread pcreso
Hi Oscar, Unless I'm missing something here... Can you open the array up in a query/view so the elements become columns for the web service? While an array is convenient within Postgres, it is a non-standard not widely supported capability, as is the user defined composite data type. It

Re: [postgis-users] images in postgresql

2011-03-06 Thread pcreso
Hi Robert, Can you do turbines as WFS with one of the fields the URL for the image, so the client has the image URL readily available? Or if you stick with WMS, you can still query the feature to get the URL of the image, see how to set up a query layer via your WMS server application. Brent

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

2011-03-03 Thread pcreso
Hi Peter, It sounds like you are wanting to tile your polygons. Not really ideal, as each polygon is rendered via tiles, so you need to render them without borders to hide the tiles, then often plot the border as well, which still has all the vertices. Lots more work. You might look at

Re: [postgis-users] How to locate adjacent polygons?

2011-02-16 Thread pcreso
Hi Colin, Given your definition of adjacent, you are probably better off with a script using sqls to retrieve data/write result the script to implement the logic, iterating through the polygons:   foreach polygon (a)    foreach different polygon (b)   foreach a.vertex      foreach

Re: [postgis-users] How to locate adjacent polygons?

2011-02-15 Thread pcreso
Would it not be simpler to use ST_Distance? Unless I'm missing something, the tolerance is the minimum distance between two polygons, so: select a.id as poly_a,   b.id as poly_b from mypolys a, mypolys b where a.id != b.id    and ST_Distance(a.geom, b.geom) = tolerance; to add some

Re: [postgis-users] E-N to Long Lat

2011-02-12 Thread pcreso
Hi Ravi, Sounds like you are dealing with point features, with a single coordinate pair. So if that is case this should help. If you know the coordinate system they are in, you can tell Postgis to use that transform the points to a lat/long geometry, as below. Posdtgis cannot detect a

Re: [postgis-users] Postgresql, postgis and PHP

2011-02-02 Thread pcreso
Hi, You can use simple SQL to extract core values which you manipulate analyse in PHP/Javascript, or you can do more of the work in SQL. Given your skills, it seems likely that you would find it easier to use simple SQL more script based processing. One initial point to note: If you are

Re: [postgis-users] Traverse set distance along a multiline becoming multiple storage columns?

2010-12-28 Thread pcreso
Hi Ben, I'm interested in what an authoritative answer is to this :-) I know that several years ( Postgis/Postgres versions) ago running a query on this setup, then dropping the original column vacuuming re-running the query didn't make a significant difference, coz I tried it, but this was

Re: [postgis-users] Traverse set distance along a multiline?

2010-12-28 Thread pcreso
Hi Aren, for start end points you can use ST_StartPoint ST_EndPoint, should be faster than 0 100% values. It may also be useful to optimise your working data, by pre ordering the points so that the startpoint is always the southern or western one, so your algorithm does not need to check

Re: [postgis-users] Polygon from point query

2010-12-28 Thread pcreso
Hi, You need to have your points already in a table, then you can run a single query to identify the county each lies within. SELECT p.point, c.county_nam FROM county c, points p WHERE  ST_Within(p.the_geom, c.the_geom); You can also wrap this in an update statement to have a

Re: [postgis-users] Traverse set distance along a multiline?

2010-12-27 Thread pcreso
Hi Aren, In this sort of case I usually prefer to keep my source data as a reference, as well as an indexed reprojected (working) version of the geometry. Instead of doing it as you have done, and create a new table, I add a new geometry column of the appropriate type SRID to the original

Re: [postgis-users] Shifting linestrings left

2010-12-22 Thread pcreso
Hey Ben... Seasons greetings!! You have a couple of options: ST_Translate() is the simplest, but if your lines are horizontal you may want a Y shift as well? http://postgis.refractions.net/documentation/manual-svn/ST_Translate.html Having done this, I suggest you also use ST_reverse() to

Re: [postgis-users] Version 9, x86- 64

2010-12-20 Thread pcreso
On ubuntu, some issues as postgres 9 required postgis 1.5.2, which when I installed it had to be built from source as a package was not available. I followed ( corrected) these instructions

Re: [postgis-users] Determining clusters of points

2010-12-08 Thread pcreso
Hi Kevin, I'm increasingly impressed with the analytical capability of Postgis, and with how fast it is increasing. I can do ( have done) pretty substantial analytical processing totally within the db, and have tools like QGIS to visualise the results GMT for publication quality cartography.

Re: [postgis-users] Determining clusters of points

2010-12-07 Thread pcreso
Hi Sébastien , One way I clustered points in the (distant) past for a zoom-layer mapping solution was to create multiple geometries, by reducing the number of decimal points in the X Y coords and grouping by these locations. Simplistic not especially statistical, but given a random point

Re: [postgis-users] postgis from ubuntu to suse

2010-12-07 Thread pcreso
Hi Vinicius, If SuSE created a Postgis enabled template, you could use that as the basis for your new database, so it will already have Postgis installed. Otherwise use the usual commands to install Postgis in a Postgres database: createlang plpgsql new db  (not needed with Postgres v9.0+)

Re: [postgis-users] Determining clusters of points

2010-12-07 Thread pcreso
Hi Sébastien, Sounds like an interesting situation :-) You might look at the newish (v8.4+ ?) RECURSIVE/WITH capabilities of Postgres. Given Postgis allows you to create arbitrary buffer zones around your points, the RECURSIVE query capability allows you to write an SQL that will recursively

Re: [postgis-users] postgis from ubuntu to suse

2010-12-06 Thread pcreso
Which version of PostGIS is on each box? One q'n'd approach which works for me is to create the target db manually, install Postgis into this manually, then use pg_dump src db params | psql target db params Brent Wood --- On Tue, 12/7/10, Vinicius vinicius...@gmail.com wrote: From: Vinicius

Re: [postgis-users] New to postgis...

2010-12-06 Thread pcreso
If you simply want to reduce the number of features to load in each iteration, why do you need to use a spatial predicate, you can determine the count of records (~130,000) then use:  select ... limit offset ; Iterate through until done. Your features will not be spatially grouped,

Re: [postgis-users] Postgis R language

2010-11-17 Thread pcreso
Hi David, You can use PL/R to access R functionality from a Postgres SQL command line, or you can use rgdal to read Postgis data into R. So it depends on whether you want to work in the DB add R capabilities, or work in R access Postgis data. See:

Re: [postgis-users] Selecting polygons circled by one only polygons

2010-10-28 Thread pcreso
Hi, If I understand the question correctly, you want to identify polygons which are outside of a polygon (including inside the hole of another polygon) but within the outer polygon perimeter. You can do this with a self relation (join a table to itself). Something like: select t1.name from

Re: [postgis-users] Point in Polygon Problem

2010-10-22 Thread pcreso
Paul I suggest you chaeck the XY coords in your data, it looks like you have mislabeled lat lon, your lat values are 90 180. If you have loaded these into Postgis with the coords reversed, then they will not be in the correct location, which could be why ST_contains fails Brent Wood ---

[postgis-users] How best to build a regular grid from points

2010-10-17 Thread pcreso
Hi, I have a set of 155,000,000 points on a regular grid. I need to convert these to a set of square polygons covering the area represented by the points. Can anyone suggest how this could be done in Postgis? Thanks, Brent Wood ___ postgis-users

Re: [postgis-users] Programmatically generate maps zoomed to extent of shapes?

2010-09-24 Thread pcreso
 Or look at using GMT (Generic Mapping Tools) to render your maps. Pretty easy to script up something like: for dataset in table ; do   get data (ogr2ogr)   render map done GMT is perhaps the most powerful Open Source cartographic tool available, but does not integrate particularly well with

Re: [postgis-users] Backup and Restore of a PostGis database

2010-08-04 Thread pcreso
Hi Luis, With option 2, all the errors are about a failure to create objects (postgis functions spatial_ref_sys entries I assume). Why is this a problem for you? They already exist so do not need to be reinstalled, the rest of your database should be installed, so you should have a fully

Re: [postgis-users] ESRI union (analysis) in Postgis

2010-07-10 Thread pcreso
V 8.4 of postgres supports recursive (heirarchical) queries, which may be able to do something useful in this area. Cheers,   Brent Wood --- On Thu, 7/8/10, Birgit Laggner birgit.lagg...@vti.bund.de wrote: From: Birgit Laggner birgit.lagg...@vti.bund.de Subject: Re: [postgis-users] ESRI

[postgis-users] PostGIS geography question: wrapping the globe

2010-06-14 Thread pcreso
This is also an issue for geometries, but I'm looking for a geography solution here. How can I create a geography that goes from -90 to 90 crosses the dateline vs one that goes the other way around the globe crosses the 0 degree meridian? Either/both is defined by: POLYGON((-90 10, -90

Re: [postgis-users] Dot Density idea

2010-05-06 Thread pcreso
Hi, We use an application much like this for generating random sample points for 2-phase random stratified trawl biomass surveys. Specify polygon name, number of points, minimum distance from the boundary, minimum distance between points in a file, then iterate through the file. The code has

  1   2   >