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

2012-07-17 Thread Stephen V. Mather
Since early on (perhaps always) the insert statements generated by 
spatialreference.org have appended ‘9’ to the SRID.  I’ve never understood why. 
 I think, however, that in earlier PostGIS instances, there was no enforcement 
of a maximum integer, so many would have never noticed.

 

BTW, with California State Plane you might think to see if there is an 
equivalent SRID in the official EPSGs, rather than the ESRI number for it 
(102243), but I don’t know your application here.  In Ohio, ESRI’s 102722 is 
about the same as EPSG 3734.

 

Best,

Steve

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

From: postgis-users-boun...@postgis.refractions.net 
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Peter 
Tittmann
Sent: Tuesday, July 17, 2012 3:20 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] spatialreference.org srid insert error

 

Thanks Astrid!

 

Seems a little strange that spatialreference.org would produce an invalid 
insert statement. Regardless, thanks for the pointer.

 

Peter

 

-- 

Peter Tittmann

 

 

On Tuesday, July 17, 2012 at 1:09 PM, Astrid Emde wrote:

Hello Peter,

 

there is a constraint that checks that srid is  998999

 

 

ALTER TABLE spatial_ref_sys

ADD CONSTRAINT spatial_ref_sys_srid_check CHECK (srid  0 AND srid =

998999);

 

You should set sird in the insert to 102243 instead of 9102243:

 

INSERT into spatial_ref_sys (srid, auth_name, auth_srid, proj4text,

srtext) values

( 102243, 'esri', 102243, '+proj=lcc +lat_1=37.07

+lat_2=38.43 +lat_0=36.5 +lon_0=-120.5 +x_0=200

+y_0=50 +ellps=GRS80 +units=m +no_defs ',

'PROJCS[NAD_1983_HARN_StatePlane_California_III_FIPS_0403,GEOGCS[GCS_North_American_1983_HARN,DATUM[NAD83_High_Accuracy_Regional_Network,SPHEROID[GRS_1980,6378137,298.257222101]],PRIMEM[Greenwich,0],UNIT[Degree,0.017453292519943295]],PROJECTION[Lambert_Conformal_Conic_2SP],PARAMETER[False_Easting,200],PARAMETER[False_Northing,50],PARAMETER[Central_Meridian,-120.5],PARAMETER[Standard_Parallel_1,37.07],PARAMETER[Standard_Parallel_2,38.43],PARAMETER[Latitude_Of_Origin,36.5],UNIT[Meter,1],AUTHORITY[EPSG,102243]]');

 

Astrid

 

On Tue, July 17, 2012 6:14 pm, Peter Tittmann wrote:

Hi,

 

 

Im trying to add a srid from spatial reference.org

(http://spatialreference.org/ref/esri/102243/postgis/) but i'm getting a

error using the insert statement:

 

ERROR: new row for relation spatial_ref_sys violates check constraint

spatial_ref_sys_srid_check

 

 

I saw this ticket

(http://www.google.com/url?sa=t 
http://www.google.com/url?sa=trct=jq=esrc=ssource=webcd=1ved=0CDYQ 
rct=jq=esrc=ssource=webcd=1ved=0CDYQ

FjAAurl=http%3A%2F%2Ftrac.osgeo.org%2Fpostgis%2Fticket%2F1505ei=f6gFUOy

kJcWl2AXz2eDKBQusg=AFQjCNH1dlCvTvWEYntRmqflCDtAOUT49gsig2=tch67lIoPp2IO

RZaCyOpSw) and thread

(http://www.google.com/url?sa=t 
http://www.google.com/url?sa=trct=jq=esrc=ssource=webcd=2ved=0CDgQ 
rct=jq=esrc=ssource=webcd=2ved=0CDgQ

FjABurl=http%3A%2F%2Fpostgis.refractions.net%2Fpipermail%2Fpostgis-devel

%2F2012-February%2F018485.htmlei=f6gFUOykJcWl2AXz2eDKBQusg=AFQjCNGxJREc

0HrXIbAFuKSfvjU0tbfg9Asig2=0wH8-t8hCMiuIWKDL6AeFQ) but seems lie it

should be fixed.

 

Thanks in advance!

 

 

Peter

 

 

--

Peter Tittmann

 

 

 

___

postgis-users mailing list postgis-users@postgis.refractions.net

http://postgis.refractions.net/mailman/listinfo/postgis-users

 

 

-- 

Mit freundlichen Grüßen

 

Astrid Emde

 

---

Aufwind durch Wissen!

 

Qualifizierte OpenSource-Schulungen

bei der www.foss-academy.eu

 

--

 

Astrid Emde

WhereGroup GmbH  Co.KG

Eifelstraße 7

53119 Bonn

Germany

 

Fon: +49(0)228 90 90 38 - 19

Fax: +49(0)228 90 90 38 - 11

 

astrid.e...@wheregroup.com

www.wheregroup.com

Folgen Sie der WhereGroup auf twitter: http://twitter.com/WhereGroup_com

 

Amtsgericht Bonn, HRA 6788

---

Komplementärin:

WhereGroup Verwaltungs GmbH

vertreten durch:

Olaf Knopp, Peter Stamm

---

pgp-public key:

http://pgp.mit.edu:11371/pks/lookup?search=0x06DA52D72D515284

Signierte und/oder verschlüsselte Nachrichten sind sehr willkommen

Signed and/or encrypted mail is highly appreciated

 

___

postgis-users mailing list

postgis-users@postgis.refractions.net

http://postgis.refractions.net/mailman/listinfo/postgis-users

 

image001.png___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Geography problem

2012-06-27 Thread Stephen V. Mather
Hi Bulat,

Without testing this myself, you might look to this blog
post for a potential answer:

 

http://blog.opengeo.org/2012/04/30/the-earth-is-not-flat-volume-2/

 

Best,

Steve

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Bulat
Nigmatullin
Sent: Wednesday, June 27, 2012 3:25 AM
To: postgis-users@postgis.refractions.net
Subject: [postgis-users] Geography problem

 

I'm trying to execute the following SQL:

 

SELECT ST_Covers(ST_GeogFromText('POLYGON((-22 61, 62 61, 62 48, -22 48, -22
61))'), ST_GeogFromText('POINT(37 55)'));

 

PostGIS returned me FALSE, but i'm expecting TRUE.

 

Please, tell me is this my error or PostGIS bug?


 

Best regards,

Bulat Nigmatullin

image001.png___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] break lines at intersections

2012-05-18 Thread Stephen V. Mather
Oh, that's right, but it applies the index first-- my bad.  Thinking of
ST_Expand and ST_Distance from early days... .

Stephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243
s...@clevelandmetroparks.com
clevelandmetroparks.com





-Original Message-
From: Sandro Santilli [mailto:sandro.santi...@gmail.com] On Behalf Of Sandro
Santilli
Sent: Friday, May 18, 2012 2:57 AM
To: s...@clevelandmetroparks.com; PostGIS Users Discussion
Subject: Re: [postgis-users] break lines at intersections

On Thu, May 17, 2012 at 12:17:27PM -0400, Stephen V. Mather wrote:
 Also, ST_DWithin is a bounding box test, so it's fast but not accurate.

ST_DWithin is not just a bounding box test, but considers the actual shape.

--strk;



___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] PostGIS KNN best practices

2012-05-17 Thread Stephen V. Mather
And the case with points, e.g. the distance between the nearest 3D points is
of course much simpler:

 

CREATE OR REPLACE FUNCTION _lidar_distance (geometry, geometry) RETURNS
double precision AS $$

 

SELECT ST_3DDistance($1, $2) as height

ORDER BY $1 - $2

limit 1

;

 

$$ LANGUAGE SQL;

 

DROP TABLE IF EXISTS lidar_distance;

CREATE TABLE lidar_distance AS

SELECT veg.*, _lidar_distance(veg.geom, ground.geom)

FROM

(SELECT * FROM n2180_560 WHERE class = 5) As
veg,

(SELECT * FROM n2180_560 WHERE class = 2) As
ground;

 

Best,

Steve

 

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Stephen
V. Mather
Sent: Thursday, May 17, 2012 10:43 AM
To: 'PostGIS Users Discussion'
Cc: mather.step...@gmail.com
Subject: Re: [postgis-users] PostGIS KNN best practices

 

Cool,

That approach is about twice as fast as my previous approach
for comparing points to lines, e.g.:

 

 

CREATE OR REPLACE FUNCTION angle_to_street (geometry) RETURNS double
precision AS $$

 

WITH index_query as

(SELECT ST_Distance($1,road.geom) as dist,

degrees(ST_Azimuth($1, ST_ClosestPoint($1,
road.geom))) as azimuth

FROM street_centerlines As road

ORDER BY $1 # road.geom limit 5)

SELECT azimuth

FROM index_query

ORDER BY dist

LIMIT 1;

 

$$ LANGUAGE SQL;

 

DROP TABLE IF EXISTS address_points_rot;

CREATE TABLE address_points_rot AS

SELECT addr.*, angle_to_street(addr.geom)

FROM

address_points addr;

 

 

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of
Alexandre Neto
Sent: Wednesday, May 16, 2012 7:35 AM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] PostGIS KNN best practices

 

I have been around that question to.

 

http://gis.stackexchange.com/questions/24456/nearest-neighbor-problem-in-pos
tgis-2-0-using-gist-index-function 

 

You have to do it in two steps, like is explained in the operator page
http://postgis.refractions.net/docs/geometry_distance_centroid.html . One
faster step to reduce the candidates (by using - or #) and second one to
get the real distances with ST_Distance.

 

The problem in finding the KNN for each row in a table is the fact that the
gist index - operator only works if one of the geometries is constant. The
workaround would be to create a SQL function to apply to each of the rows
using table.the_geom as a parameter.

 

Something like this:

 



CREATE OR REPLACE FUNCTION _enn2 (geometry) RETURNS double precision AS $$

 

WITH index_query as

(SELECT ST_Distance($1,f.the_geom) as dist

FROM grelha5m As f

ORDER BY $1 # g1.the_geom limit 1000)

SELECT dist

FROM index_query

ORDER BY dist;

 

$$ LANGUAGE SQL;

---

 

and I call it like this: 

 

---

Select c.gid as gid, _enn2(c.the_geom) as enn

From cosn1 as c

Order by c.gid

---

 

In this case the function returned the smallest distance, but you can choose
any other column.

 

Hope it helps

 

Alexandre Neto

 

On Tue, May 15, 2012 at 5:37 PM, Stephen V. Mather
s...@clevelandmetroparks.com wrote:

Hi All,

Pretty excited by the new operators - and #, but a bit
confused as to how to use them in a query.  The two examples from P. Ramsey
back in late 2011 (
http://blog.opengeo.org/2011/09/28/indexed-nearest-neighbour-search-in-postg
is/ ) included doing a KNN on a single point to a cloud of points, i.e. 

 

SELECT name, gid

FROM geonames

ORDER BY geom - st_setsrid(st_makepoint(-90,40),4326)

LIMIT 10;

 

or doing KNN on non-point different geometries, where the first neighbor by
- or # might not be truly the first i.e.

 

with index_query as (
  select
st_distance(geom, 'SRID=3005;POINT(1011102 450541)') as distance,
parcel_id, address
  from parcels
  order by geom # 'SRID=3005;POINT(1011102 450541)' limit 100
)
select * from index_query order by distance limit 10;

 

So, how would one grab the first nearest neighbor for all points in a
dataset?  This is how I used to do it:

 

CREATE TABLE n2180_560_height AS 

SELECT x, y, height FROM 

(SELECT DISTINCT ON(veg.gid) veg.gid as gid, ground.gid as gid_ground, veg.x
as x, veg.y as y, ground.z as z, veg.z - ground.z as height, veg.the_geom

Re: [postgis-users] break lines at intersections

2012-05-17 Thread Stephen V. Mather
Also, ST_DWithin is a bounding box test, so it’s fast but not accurate.
You’ll want to do a second test with ST_Distance to get the actual distance
after gathering up everything that results in true for ST_DWithin.

 

Best,

Steve

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Pedro
Costa
Sent: Thursday, May 17, 2012 11:54 AM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] break lines at intersections

 

i found the error. the parallels are a less then 3 meters...

thanks



Em 17-05-2012 16:43, Pedro Costa escreveu: 

I'm already tried this function but with no good results, I do not
understand why.
You can see an example in the attached image. The streets are red lines. The
parallel purple and what I want to clear yellow.

Any idea ?


I tried the st_dwithin like this:


create table street8 as (SELECT paralell.geom FROM parallel,street WHERE
st_dwithin(paralell.geom, streets.the_geom, 2.99 ))


The 'line erros' that i want to delete are a less than 3 meters from
streets...


thanks



Em 17-05-2012 16:32, Nicolas Ribot escreveu: 

Yes, it should be: 

st_dwithin will help you to find all lines from a table within a certain
distance to other lines.

 

Nicolas

 

On 17 May 2012 17:23, Pedro Costa pedrocostaa...@sapo.pt wrote:

Great Nicolos, works...

It is possible select lines from one table a less than 3 meters from lines
from another table?and delete them...

thanks


Em 17-05-2012 15:41, Nicolas Ribot escreveu: 

Hi Pedro, 

 

select (st_dump(st_union(geom))).geom from lines;

 

will cut your network of lines at intersections.

 

Nicolas

On 17 May 2012 11:57, Pedro Costa pedrocostaa...@sapo.pt wrote:

does anyone know how I can cut the lines at intersectionslike the image
attached?

I can´t install postgis 2.0 for now

I see a few examples with st_union and st_dump but i don't understand...


Thanks

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

 





___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

 


___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

 






___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

 

 

image001.png___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] PostGIS KNN best practices

2012-05-16 Thread Stephen V. Mather
Ah, I had hopes pinned on the idea that I just wasn't smart enough to figure
it out, but it's an inherent limitation.  I will be using your function
though-that is a clean way to encapsulate the functionality.

 

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of
Alexandre Neto
Sent: Wednesday, May 16, 2012 7:35 AM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] PostGIS KNN best practices

 

I have been around that question to.

 

http://gis.stackexchange.com/questions/24456/nearest-neighbor-problem-in-pos
tgis-2-0-using-gist-index-function 

 

You have to do it in two steps, like is explained in the operator page
http://postgis.refractions.net/docs/geometry_distance_centroid.html . One
faster step to reduce the candidates (by using - or #) and second one to
get the real distances with ST_Distance.

 

The problem in finding the KNN for each row in a table is the fact that the
gist index - operator only works if one of the geometries is constant. The
workaround would be to create a SQL function to apply to each of the rows
using table.the_geom as a parameter.

 

Something like this:

 



CREATE OR REPLACE FUNCTION _enn2 (geometry) RETURNS double precision AS $$

 

WITH index_query as

(SELECT ST_Distance($1,f.the_geom) as dist

FROM grelha5m As f

ORDER BY $1 # g1.the_geom limit 1000)

SELECT dist

FROM index_query

ORDER BY dist;

 

$$ LANGUAGE SQL;

---

 

and I call it like this: 

 

---

Select c.gid as gid, _enn2(c.the_geom) as enn

From cosn1 as c

Order by c.gid

---

 

In this case the function returned the smallest distance, but you can choose
any other column.

 

Hope it helps

 

Alexandre Neto

 

On Tue, May 15, 2012 at 5:37 PM, Stephen V. Mather
s...@clevelandmetroparks.com wrote:

Hi All,

Pretty excited by the new operators - and #, but a bit
confused as to how to use them in a query.  The two examples from P. Ramsey
back in late 2011 (
http://blog.opengeo.org/2011/09/28/indexed-nearest-neighbour-search-in-postg
is/ ) included doing a KNN on a single point to a cloud of points, i.e. 

 

SELECT name, gid

FROM geonames

ORDER BY geom - st_setsrid(st_makepoint(-90,40),4326)

LIMIT 10;

 

or doing KNN on non-point different geometries, where the first neighbor by
- or # might not be truly the first i.e.

 

with index_query as (
  select
st_distance(geom, 'SRID=3005;POINT(1011102 450541)') as distance,
parcel_id, address
  from parcels
  order by geom # 'SRID=3005;POINT(1011102 450541)' limit 100
)
select * from index_query order by distance limit 10;

 

So, how would one grab the first nearest neighbor for all points in a
dataset?  This is how I used to do it:

 

CREATE TABLE n2180_560_height AS 

SELECT x, y, height FROM 

(SELECT DISTINCT ON(veg.gid) veg.gid as gid, ground.gid as gid_ground, veg.x
as x, veg.y as y, ground.z as z, veg.z - ground.z as height, veg.the_geom as
geometry, veg.class as class

FROM (SELECT * FROM n2180_560 WHERE class = 5) As veg, (SELECT * FROM
n2180_560 WHERE class = 2) As ground

WHERE veg.class = 5 AND veg.gid  ground.gid AND ST_DWithin(veg.the_geom,
ground.the_geom, 10)

ORDER BY veg.gid, ST_Distance(veg.the_geom,ground.the_geom)) AS vegpoints;

 

ST_DWithin prevents a full cross join, but is a sloppy way to do this, as it
requires a priori knowledge of the end cases.  I'm hoping there's a subquery
or some such magic that would allow me to use the distance operator to a
similar end. .

 

Thanks,

Best,

Steve

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) tel:%28216%29%20635-3243  635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 


___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

 

image001.png___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] PostGIS KNN best practices

2012-05-15 Thread Stephen V. Mather
Hi All,

Pretty excited by the new operators - and #, but a bit
confused as to how to use them in a query.  The two examples from P. Ramsey
back in late 2011 (
http://blog.opengeo.org/2011/09/28/indexed-nearest-neighbour-search-in-postg
is/ ) included doing a KNN on a single point to a cloud of points, i.e. 

 

SELECT name, gid

FROM geonames

ORDER BY geom - st_setsrid(st_makepoint(-90,40),4326)

LIMIT 10;

 

or doing KNN on non-point different geometries, where the first neighbor by
- or # might not be truly the first i.e.

 

with index_query as (
  select
st_distance(geom, 'SRID=3005;POINT(1011102 450541)') as distance,
parcel_id, address
  from parcels
  order by geom # 'SRID=3005;POINT(1011102 450541)' limit 100
)
select * from index_query order by distance limit 10;

 

So, how would one grab the first nearest neighbor for all points in a
dataset?  This is how I used to do it:

 

CREATE TABLE n2180_560_height AS 

SELECT x, y, height FROM 

(SELECT DISTINCT ON(veg.gid) veg.gid as gid, ground.gid as gid_ground, veg.x
as x, veg.y as y, ground.z as z, veg.z - ground.z as height, veg.the_geom as
geometry, veg.class as class

FROM (SELECT * FROM n2180_560 WHERE class = 5) As veg, (SELECT * FROM
n2180_560 WHERE class = 2) As ground

WHERE veg.class = 5 AND veg.gid  ground.gid AND ST_DWithin(veg.the_geom,
ground.the_geom, 10)

ORDER BY veg.gid, ST_Distance(veg.the_geom,ground.the_geom)) AS vegpoints;

 

ST_DWithin prevents a full cross join, but is a sloppy way to do this, as it
requires a priori knowledge of the end cases.  I'm hoping there's a subquery
or some such magic that would allow me to use the distance operator to a
similar end. .

 

Thanks,

Best,

Steve

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

image001.png___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Is it easy to convert a PostGIS Data Model into an ArcGIS Server one?

2012-05-04 Thread Stephen V. Mather
AFAIK, PostGIS support in SDE is enterprise only, unless something has
changed.

I think Paul Ramsey made a FGDB reader (and writer?).  Not sure if that was
part of OGR or what.  Version 10 FGDBs and beyond though-- the 9.x FGDBs
have no api or published specs:

http://blog.cleverelephant.ca/2009/04/esri-formats-back-to-future.html

http://blog.cleverelephant.ca/2011/01/esri-fgdb-api-no-servers-need-apply.ht
ml

Oops-- with a search, Mr. Fee's google geospatial review foo shows up (even
in duckduckgo), ogr2ogr fgdb support:

http://spatiallyadjusted.com/2012/01/10/gdal-1-9-brings-esri-fgdb-and-google
-fusion-tables-support/

Best,
Steve

Stephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243
s...@clevelandmetroparks.com
clevelandmetroparks.com




-Original Message-
From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Nicklas
Avén
Sent: Friday, May 04, 2012 8:32 AM
To: postgis-users@postgis.refractions.net
Subject: Re: [postgis-users] Is it easy to convert a PostGIS Data Model into
an ArcGIS Server one?

Can you not just register the POstGIS table in sde?
I think so, and then you will get all extra tables and overhead that sde
can offer.

/Nicklas


On Fri, 2012-05-04 at 14:04 +0200, Mac Wind wrote:
 Hi.
 
 Using the last version of postGIS, I've got dozens of layers.
 
 I wonder if it os possible (and easy) to convert/export this Data
 Model into a ArcGIS Server one (ArcSDE or FileGeoDataBase). Any
 experience/document is welcome.
 
 Does any interexchange format exist?
 
 Thank you very much.
 ___
 postgis-users mailing list
 postgis-users@postgis.refractions.net
 http://postgis.refractions.net/mailman/listinfo/postgis-users


___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Is it easy to convert a PostGIS Data Model into an ArcGIS Server one?

2012-05-04 Thread Stephen V. Mather
More on OGR and ESRI File GeoDatabases:

http://www.paolocorti.net/2012/01/10/gdal_19_released/

Best,
Steve

Stephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243
s...@clevelandmetroparks.com
clevelandmetroparks.com





-Original Message-
From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Stephen
V. Mather
Sent: Friday, May 04, 2012 2:48 PM
To: 'PostGIS Users Discussion'
Subject: Re: [postgis-users] Is it easy to convert a PostGIS Data Model into
an ArcGIS Server one?

AFAIK, PostGIS support in SDE is enterprise only, unless something has
changed.

I think Paul Ramsey made a FGDB reader (and writer?).  Not sure if that was
part of OGR or what.  Version 10 FGDBs and beyond though-- the 9.x FGDBs
have no api or published specs:

http://blog.cleverelephant.ca/2009/04/esri-formats-back-to-future.html

http://blog.cleverelephant.ca/2011/01/esri-fgdb-api-no-servers-need-apply.ht
ml

Oops-- with a search, Mr. Fee's google geospatial review foo shows up (even
in duckduckgo), ogr2ogr fgdb support:

http://spatiallyadjusted.com/2012/01/10/gdal-1-9-brings-esri-fgdb-and-google
-fusion-tables-support/

Best,
Steve

Stephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243
s...@clevelandmetroparks.com
clevelandmetroparks.com




-Original Message-
From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Nicklas
Avén
Sent: Friday, May 04, 2012 8:32 AM
To: postgis-users@postgis.refractions.net
Subject: Re: [postgis-users] Is it easy to convert a PostGIS Data Model into
an ArcGIS Server one?

Can you not just register the POstGIS table in sde?
I think so, and then you will get all extra tables and overhead that sde
can offer.

/Nicklas


On Fri, 2012-05-04 at 14:04 +0200, Mac Wind wrote:
 Hi.
 
 Using the last version of postGIS, I've got dozens of layers.
 
 I wonder if it os possible (and easy) to convert/export this Data
 Model into a ArcGIS Server one (ArcSDE or FileGeoDataBase). Any
 experience/document is welcome.
 
 Does any interexchange format exist?
 
 Thank you very much.
 ___
 postgis-users mailing list
 postgis-users@postgis.refractions.net
 http://postgis.refractions.net/mailman/listinfo/postgis-users


___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Using shp2pgsql

2012-04-25 Thread Stephen V. Mather
I think he means run it in psql so that you can observe what line the error
occurs.  You are unlikely to see the error before loading it in psql.

 

Best,

Steve

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Paul
Maddock
Sent: Wednesday, April 25, 2012 11:02 AM
To: postgis-users@postgis.refractions.net
Subject: Re: [postgis-users] Using shp2pgsql

 

Nothing, the sql file looks beautiful.  No errors.  The interesting thing to
me is that it repeats the error when I pipe it and the error repeats for as
many time as there are rows of data.

 

What could this mean?  Might there be something wrong with my schema?  

 

 

Shp2psql is supposed to create the table which it does:

SET CLIENT_ENCODING TO UTF8;

SET STANDARD_CONFORMING_STRINGS TO ON;

BEGIN;

CREATE TABLE columbus.pole_region (gid serial PRIMARY KEY,

location_n varchar(15),

height float8,

class varchar(11),

ownership varchar(7),

owner varchar(80),

plant_acct varchar(31),

vintage_ye float8,

inservice_ varchar(12),

pole_kind varchar(31),

pole_type varchar(24),

original_t varchar(25),

design_sta varchar(18),

facility_s varchar(10),

ciac_statu varchar(8),

ciac_date varchar(12),

west_pole_ varchar(6));

SELECT
AddGeometryColumn('columbus','pole_region','geom_3754','3754','MULTIPOLYGON'
,4);

 

From: Denis Rouzaud [mailto:denis.rouz...@gmail.com] 
Sent: Wednesday, April 25, 2012 10:52 AM
To: PostGIS Users Discussion
Cc: Paul Maddock
Subject: Re: [postgis-users] Using shp2pgsql

 

You could output shp2pgsql to a SQL file, then use it in psql to see at
which line the error occurs.



On 04/25/2012 04:46 PM, Paul Maddock wrote: 

Dear all,

 

I'm using the following code to transform a shapefile I have into a table
and import it into my database:

shp2pgsql -s 3754 ~/JOE/columbus/pole_region.shp columbus.pole_region | psql
-h localhost -U postgres -p 5432 -d paul

 

When it runs I have to put my password in for postgres (expected), and I get
the following output:

 

ERROR:  current transaction is aborted, commands ignored until end of
transaction block

ERROR:  current transaction is aborted, commands ignored until end of
transaction block

ERROR:  current transaction is aborted, commands ignored until end of
transaction block

ERROR:  current transaction is aborted, commands ignored until end of
transaction block

ERROR:  current transaction is aborted, commands ignored until end of
transaction block

ERROR:  current transaction is aborted, commands ignored until end of
transaction block

ERROR:  current transaction is aborted, commands ignored until end of
transaction block

ERROR:  current transaction is aborted, commands ignored until end of
transaction block

ERROR:  current transaction is aborted, commands ignored until end of
transaction block

ERROR:  current transaction is aborted, commands ignored until end of
transaction block

ERROR:  current transaction is aborted, commands ignored until end of
transaction block

ERROR:  current transaction is aborted, commands ignored until end of
transaction block

ERROR:  current transaction is aborted, commands ignored until end of
transaction block

 

The database paul is created and the schema columbus is created and is owned
by postgres. 

 

What am I doing wrong?  Do I have to set datatypes?

 

Thanks for the help,

Paul

 

 

Paul A. Maddock

Mapping Technician

IJUS LLC

560 Officenter Place

Gahanna, OH 43230

Cell: (513) 404-6476

 http://www.ijus.net/index.html Description: Description: Home

 





___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
image002.pngimage003.gif___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] ST_MakeValid

2012-04-17 Thread Stephen V. Mather
:)  It's never so easy, is it.

 

I had reason to kill the ST_MakeValid at about 10:1, so I have no idea what
the completion time is except  10,000 seconds.  I'm rerunning now.

 

I can play with finding a subset of the data that replicates the behavior.

 

Best,

Steve

 

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Martin
Davis
Sent: Tuesday, April 17, 2012 12:11 AM
To: postgis-users@postgis.refractions.net
Subject: Re: [postgis-users] ST_MakeValid

 

Stephen, 

Do you have a final timing from your ST_MakeValid test?  The numbers you
show indicate about a 2.5:1 decrease in performance.  This could easily be
explained by an extra overlay or validity test or two.  

This isn't to say that there wouldn't be a possibility to improve the
performance of the ST_MakeValid code, but (speaking as someone who has spent
way too much time tweaking spatial algorithms for performance) this may or
may not be an easy/obvious fix.

Also, it would be helpful to know if this is a systematic difference in
performance, or whether there are big differences for specific geometry
cases.  This unfortunately will take a bit of effort to isolate - you'd
probably have to run many tests on single geometries to capture the
performance difference.

And sad to say, even if there is an obvious large difference only in
specific cases, this doesn't necessarily mean that it's easy to improve the
performance in just those cases.  One of the annoying things about spatial
algorithms is that it's often very difficult to detect particular simple
cases which can be computed quickly - at least, not any faster than the
full, slower algorithm would run anyway!

On 4/16/2012 9:33 AM, Stephen V. Mather wrote: 

Hi All,

Has anyone done any performance tests on ST_MakeValid?  I
had been using Tim Sutton's cleanGeometry function from circa 2010
(http://linfiniti.com/2010/07/cleaning-geometries-inside-postgis/) to clean
up geometries.  Works most of the time-every now and then I throw it
something too big and harry and it runs for weeks and weeks and never (AFAI
have the patience for) completes.  I've been looking forward to
ST_MakeValid.

Today, a new Postgis 2.0 instance in hand, I was playing
with a dataset with 9106 invalid geometries-all self intersecting geometries
from raster--vector conversion in an un-named proprietary package.  On a
whim, I decided to compare the speed of ST_MakeValid to Tim's code, so first
I needed the correct functions:

 

psql -U postgres -d test -f C:\Program
Files\PostgreSQL\9.1\share\contrib\postgis-2.0\legacy.sql

 

Then a quick run through cleanGeometry:

 

CREATE TABLE tpi_clean AS

 SELECT gid, id, gridcode, class name, cleanGeometry(geom)

   FROM tpi;

 

And I get back:

 

Query returned successfully: 1004952 rows affected, 955444 ms execution
time.

 

If I run as ST_MakeValid,

 

CREATE TABLE tpi_valid AS

 SELECT gid, id, gridcode, class name, ST_MakeValid(geom)

   FROM tpi;

 

At 230 milliseconds, it is still running. .

 

This is PostgreSQL 9.1, PostGIS 2.0 USE_GEOS=1 USE_PROJ=1 USE_STATS=1, on
Windows XP 32-bit.  I have not yet tested on my Ubuntu box. .

 

Thanks,
Best,

Steve

 

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 






___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users






No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.1913 / Virus Database: 2411/4940 - Release Date: 04/16/12

image001.png___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] ST_MakeValid

2012-04-17 Thread Stephen V. Mather
That seems like it would make a big performance difference in this case.

Stephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243
s...@clevelandmetroparks.com
clevelandmetroparks.com





-Original Message-
From: Sandro Santilli [mailto:sandro.santi...@gmail.com] On Behalf Of
'Sandro Santilli'
Sent: Tuesday, April 17, 2012 4:50 AM
To: Stephen V. Mather
Cc: 'PostGIS Users Discussion'
Subject: Re: [postgis-users] ST_MakeValid

On Mon, Apr 16, 2012 at 03:05:21PM -0400, Stephen V. Mather wrote:
  IIRC there's a difference with a multipolygon composed by two
  overlapping rectangles.
 
 Rereading, does ST_MakeValid also test for overlapping polygons? 

It handles those too, yes.
Basically it nodes and polygonizes all boundaries of input polygons
and then maximizes the vertices retained in output by toggling
between interior and exterior at every boundary. When impossible,
the line is retained as a linestring.

--strk; 

  ,--o-. 
  |   __/  |Delivering high quality PostGIS 2.0 !
  |  / 2.0 |http://strk.keybit.net - http://vizzuality.com
  `-o--'




___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] ST_MakeValid

2012-04-17 Thread Stephen V. Mather
Well, in the interest of full disclosure, as I interrogated the output from
the pgsql approach, it appears to have failed (silently?) on some of the
output-- so there are fewer input features vs. output, and in non-intuitive
ways (loss of some large polygon features.  In other words, it's faster at
the cost of being incorrect.  My apologies I didn't notice this before
posting.

I'll re-run tonight with the native function and report back on
functionality.

One feature request I could see useful would be to have the ability to
specify which topology problems to fix, and which to skip for performance
reasons. 

Best,
Steve

Stephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243
s...@clevelandmetroparks.com
clevelandmetroparks.com





-Original Message-
From: Sandro Santilli [mailto:sandro.santi...@gmail.com] On Behalf Of
'Sandro Santilli'
Sent: Tuesday, April 17, 2012 4:50 AM
To: Stephen V. Mather
Cc: 'PostGIS Users Discussion'
Subject: Re: [postgis-users] ST_MakeValid

On Mon, Apr 16, 2012 at 03:05:21PM -0400, Stephen V. Mather wrote:
  IIRC there's a difference with a multipolygon composed by two
  overlapping rectangles.
 
 Rereading, does ST_MakeValid also test for overlapping polygons? 

It handles those too, yes.
Basically it nodes and polygonizes all boundaries of input polygons
and then maximizes the vertices retained in output by toggling
between interior and exterior at every boundary. When impossible,
the line is retained as a linestring.

--strk; 

  ,--o-. 
  |   __/  |Delivering high quality PostGIS 2.0 !
  |  / 2.0 |http://strk.keybit.net - http://vizzuality.com
  `-o--'




___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] ST_MakeValid

2012-04-16 Thread Stephen V. Mather
Hi All,

Has anyone done any performance tests on ST_MakeValid?  I
had been using Tim Sutton's cleanGeometry function from circa 2010
(http://linfiniti.com/2010/07/cleaning-geometries-inside-postgis/) to clean
up geometries.  Works most of the time-every now and then I throw it
something too big and harry and it runs for weeks and weeks and never (AFAI
have the patience for) completes.  I've been looking forward to
ST_MakeValid.

Today, a new Postgis 2.0 instance in hand, I was playing
with a dataset with 9106 invalid geometries-all self intersecting geometries
from raster--vector conversion in an un-named proprietary package.  On a
whim, I decided to compare the speed of ST_MakeValid to Tim's code, so first
I needed the correct functions:

 

psql -U postgres -d test -f C:\Program
Files\PostgreSQL\9.1\share\contrib\postgis-2.0\legacy.sql

 

Then a quick run through cleanGeometry:

 

CREATE TABLE tpi_clean AS

 SELECT gid, id, gridcode, class name, cleanGeometry(geom)

   FROM tpi;

 

And I get back:

 

Query returned successfully: 1004952 rows affected, 955444 ms execution
time.

 

If I run as ST_MakeValid,

 

CREATE TABLE tpi_valid AS

 SELECT gid, id, gridcode, class name, ST_MakeValid(geom)

   FROM tpi;

 

At 230 milliseconds, it is still running. .

 

This is PostgreSQL 9.1, PostGIS 2.0 USE_GEOS=1 USE_PROJ=1 USE_STATS=1, on
Windows XP 32-bit.  I have not yet tested on my Ubuntu box. .

 

Thanks,
Best,

Steve

 

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

image001.png___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] ST_MakeValid

2012-04-16 Thread Stephen V. Mather
Credit where credit is due-the cleanGeometry function listed below is
written by Horst Duester.

 

Best,

Steve

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Stephen
V. Mather
Sent: Monday, April 16, 2012 12:33 PM
To: postgis-users@postgis.refractions.net
Subject: [postgis-users] ST_MakeValid

 

Hi All,

Has anyone done any performance tests on ST_MakeValid?  I
had been using Tim Sutton's cleanGeometry function from circa 2010
(http://linfiniti.com/2010/07/cleaning-geometries-inside-postgis/) to clean
up geometries.  Works most of the time-every now and then I throw it
something too big and harry and it runs for weeks and weeks and never (AFAI
have the patience for) completes.  I've been looking forward to
ST_MakeValid.

Today, a new Postgis 2.0 instance in hand, I was playing
with a dataset with 9106 invalid geometries-all self intersecting geometries
from raster--vector conversion in an un-named proprietary package.  On a
whim, I decided to compare the speed of ST_MakeValid to Tim's code, so first
I needed the correct functions:

 

psql -U postgres -d test -f C:\Program
Files\PostgreSQL\9.1\share\contrib\postgis-2.0\legacy.sql

 

Then a quick run through cleanGeometry:

 

CREATE TABLE tpi_clean AS

 SELECT gid, id, gridcode, class name, cleanGeometry(geom)

   FROM tpi;

 

And I get back:

 

Query returned successfully: 1004952 rows affected, 955444 ms execution
time.

 

If I run as ST_MakeValid,

 

CREATE TABLE tpi_valid AS

 SELECT gid, id, gridcode, class name, ST_MakeValid(geom)

   FROM tpi;

 

At 230 milliseconds, it is still running. .

 

This is PostgreSQL 9.1, PostGIS 2.0 USE_GEOS=1 USE_PROJ=1 USE_STATS=1, on
Windows XP 32-bit.  I have not yet tested on my Ubuntu box. .

 

Thanks,
Best,

Steve

 

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

image002.png___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] ST_MakeValid

2012-04-16 Thread Stephen V. Mather
Forgot to reply all... 

 The ST_MakeValid tries its best to retain all input vertices.

AFAIK, Horst's function does as well.

 Also, ST_MakeValid internally checks for input validity and avoids 
 running anything if the input is valid. Such check has a cost too.

Horst's function naturally leverages the old isValid.

I'm going to try on one of the datasets that Horst's function fails on, as I
suspect the new native function is less likely to fail.  I'll take stability
over speed (most of the time, anyway...).

FYI, an excerpt from the code from Horst's function 

-

http://www.sogis1.so.ch/sogis/dl/postgis/cleanGeometry.sql


Does the following for the polygon case:

IF (GeometryType(inGeom) = 'POLYGON' OR GeometryType(inGeom) =
'MULTIPOLYGON') THEN

-- Only process if geometry is not valid,
-- otherwise put out without change
if not isValid(inGeom) THEN

-- create nodes at all self-intersecting lines by union the polygon
boundaries
-- with the startingpoint of the boundary.  
  tmpLinestring :=
st_union(st_multi(st_boundary(inGeom)),st_pointn(boundary(inGeom),1));
  outGeom = buildarea(tmpLinestring);  
  IF (GeometryType(inGeom) = 'MULTIPOLYGON') THEN  
RETURN st_multi(outGeom);
  ELSE
RETURN outGeom;
  END IF;
else
  RETURN inGeom;
END IF;
...


Best,
Steve

Stephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243
s...@clevelandmetroparks.com
clevelandmetroparks.com




-Original Message-
From: Sandro Santilli [mailto:sandro.santi...@gmail.com] On Behalf Of Sandro
Santilli
Sent: Monday, April 16, 2012 12:41 PM
To: s...@clevelandmetroparks.com; PostGIS Users Discussion
Subject: Re: [postgis-users] ST_MakeValid

On Mon, Apr 16, 2012 at 12:33:15PM -0400, Stephen V. Mather wrote:

 Then a quick run through cleanGeometry:
...
 Query returned successfully: 1004952 rows affected, 955444 ms execution
time.
 
 If I run as ST_MakeValid,
...
 At 230 milliseconds, it is still running. .

The ST_MakeValid tries its best to retain all input vertices.

IIRC there's a difference with a multipolygon composed by two
overlapping rectangles.

Also, ST_MakeValid internally checks for input validity and avoids
running anything if the input is valid. Such check has a cost too.

--strk;

  ,--o-. 
  |   __/  |Delivering high quality PostGIS 2.0 !
  |  / 2.0 |http://strk.keybit.net - http://vizzuality.com
  `-o--'





___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] ST_MakeValid

2012-04-16 Thread Stephen V. Mather
 IIRC there's a difference with a multipolygon composed by two
 overlapping rectangles.

Rereading, does ST_MakeValid also test for overlapping polygons?  This would
explain the performance difference, as these polygons are pretty
complicated, and checking for overlap would not be well served by bounding
box indices.

Best,
Steve

Stephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243
s...@clevelandmetroparks.com
clevelandmetroparks.com





-Original Message-
From: Sandro Santilli [mailto:sandro.santi...@gmail.com] On Behalf Of Sandro
Santilli
Sent: Monday, April 16, 2012 12:41 PM
To: s...@clevelandmetroparks.com; PostGIS Users Discussion
Subject: Re: [postgis-users] ST_MakeValid

On Mon, Apr 16, 2012 at 12:33:15PM -0400, Stephen V. Mather wrote:

 Then a quick run through cleanGeometry:
...
 Query returned successfully: 1004952 rows affected, 955444 ms execution
time.
 
 If I run as ST_MakeValid,
...
 At 230 milliseconds, it is still running. .

The ST_MakeValid tries its best to retain all input vertices.

IIRC there's a difference with a multipolygon composed by two
overlapping rectangles.

Also, ST_MakeValid internally checks for input validity and avoids
running anything if the input is valid. Such check has a cost too.

--strk;

  ,--o-. 
  |   __/  |Delivering high quality PostGIS 2.0 !
  |  / 2.0 |http://strk.keybit.net - http://vizzuality.com
  `-o--'





___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Are there any Ubuntu PPAs that serve PostGIS 2.0 beta releases?

2012-04-04 Thread Stephen V. Mather
So, is the below the best way to get the goodies of 2.0.0 for Ubuntu?  It’s a 
theoretical question, as I have GEOS and GDAL in place, but for the curious… .

 

Best,

Steve

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

From: postgis-users-boun...@postgis.refractions.net 
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Charlie 
Sharpsteen
Sent: Friday, March 16, 2012 3:58 PM
To: postgis-us...@googlegroups.com
Cc: PostGIS Users Discussion
Subject: Re: [postgis-users] Are there any Ubuntu PPAs that serve PostGIS 2.0 
beta releases?

 

On Thursday, March 15, 2012 10:40:00 AM UTC-7, Charlie Sharpsteen wrote:

Ok, I now have a nightly build set up that is tracking the PostGIS trunk. 
Binaries are being built for Oneric (11.11) and Precise (12.04-dev)

 
...

 

I will ponder upgrading GEOS and GDAL and setting up a stable build for the 
most recent beta releases.

 

The PostGIS nightly builds have been augmented with GEOS 3.3.2 and now include 
the topology plugin. GDAL 1.7.x is still being used from the official Ubuntu 
repositories. The installation steps are now:

 

sudo apt-add-repository ppa:sharpie/for-science  # To get GEOS 3.3.2

sudo apt-add-repository ppa:sharpie/postgis-nightly

sudo apt-get update

 

sudo apt-get install postgresql-9.1-postgis

 

 

The build of GEOS 3.3.2 was created using the following steps:

 

  * Forking the official Ubuntu sources for GEOS 3.2.2.

  * Backporting GEOS from Debian Wheezy to get to 3.3.1 along with associated 
packaging updates.

  * Merging in 3.3.2 from the official GEOS tarball.

 

This was accomplished by:

 

bzr branch lp:ubuntu/geos

cd geos

bzr merge debianlp:wheezy/geos

# De-stage all Debian patches prior to an upstream import

quilt pop -a

bzr merge-upstream  # Finds the latest GEOS tarball and merges it in!

quilt push -a # Fix any outdated patches.

 

 

I had to fix one patch conflict caused by the last command, but otherwise 
everything went smoothly.

 

GDAL is at 1.9.0 in Debian Experimental, but backporting looks like a moderate 
headache so I'm holding off for now. I may set up a stable build of PostGIS 
beta packages, but it looks like we are pretty close to 2.0 so I may wait until 
the official release. The nightly builds against the SVN trunk _should_ be 
pretty stable in the lead up to 2.0.

 

-Charlie

image001.png___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Editing with arcgis without ArcSDE

2012-04-03 Thread Stephen V. Mather
Hi Rob,

I’ve had some luck with ST-Links with 9.3.1, although have
yet to test it in detail, and probably won’t until we upgrade to 10.1.  Some
tables loaded, and were editable, others would not load.  When I used
earlier generations of software for linking ArcMap and PostGIS,  I remember
that one thing to check for with respect to ArcGIS compatibility in general
is to ensure your integers are not 8-byte as there is no corresponding type
in ArcMap.  Most integers can safely be re-cast.  There may be other
unsupported field types as well; I don’t know if numeric falls in this
category, AFAIK ArcMap has no equivalent.  One way to test would be to start
with a simple table, add fields/field types incrementally, and figure out
where it breaks.

 

Best,

Steve

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Robert
Buckley
Sent: Monday, April 02, 2012 1:30 PM
To: Post GIS Users Discussion
Subject: [postgis-users] Editing with arcgis without ArcSDE

 

Hi,

 

I am trying to find a way to edit postgresql geospatial data with ArcGIS but
without ArcSDE.

 

I have found ST-LInks SpatialKit
(http://www.st-links.com/Pages/default.aspx) which I have installed on
ArcGIS 9.3.1 and on another PC with ArcGIS 10. After successfully installing
I can´t load a sinlge layer into ArcMap!!always an error message which
cannot be clicked off or ArcGIS Crashes!!! Really rubbish software, and they
want people to pay for it!?!

 

Anyway. does anyone else know of any other software tools that enable
connections with ArcGIS for editing geometries?

 

Thanks for any tips,

 

Rob

image001.png___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] 3D geometries

2012-03-15 Thread Stephen V. Mather
It seems like this could be addressed by overloading the function so that
whether the function builds tunnels and bridges is an option.

Steve


Stephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243
s...@clevelandmetroparks.com
clevelandmetroparks.com




-Original Message-
From: Havard Tveite [mailto:havard.tve...@umb.no] 
Sent: Thursday, March 15, 2012 4:14 AM
To: s...@clevelandmetroparks.com; PostGIS Users Discussion
Subject: Re: [postgis-users] 3D geometries

Hi,

For ST_SetMFromRaster(geom, rast), I think it would be
better to only add the Z/M value to the points of the input
geometry.  Those that want to do something like ST_Densify
should do that as a separate preprocessing step.
This would give the user more control of the process (the
user may want tunnels and bridges).

Håvard

On 3/13/2012 7:47 PM, Stephen V. Mather wrote:
 Hi Pierre,

 I could try my hand at this as a PL/pgSQL function.  Can't help with the
 C++... :)

 I'm thinking ST_Densify ala Paul deriving the densification from the cell
 size of the input raster, then use st_dumppoints and st_intersects, and
then
 reconstruct to 3D line (or am I thinking too low level to be efficient).

 Best,
 Steve


 Stephen Mather
 Geographic Information Systems (GIS) Manager
 (216) 635-3243
 s...@clevelandmetroparks.com
 clevelandmetroparks.com





 -Original Message-
 From: Pierre Racine [mailto:pierre.rac...@sbf.ulaval.ca]
 Sent: Tuesday, March 13, 2012 2:22 PM
 To: s...@clevelandmetroparks.com; PostGIS Users Discussion
 Subject: RE: [postgis-users] 3D geometries

 Hi Stephen,

 It would certainly be very nice to have a generic function doing it:

 SELECT  ST_SetMFromRaster(geom, rast)  geom
 FROM mylines, myrast
 WHERE ST_Intersects(geom, rast)

 Pierre

 -Original Message-
 From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-
 boun...@postgis.refractions.net] On Behalf Of Stephen V. Mather
 Sent: Tuesday, March 13, 2012 1:43 PM
 To: postgis-users@postgis.refractions.net
 Subject: [postgis-users] 3D geometries

 Hi All,

  Any special considerations for turning a 2D multi-line
 geometry into a
 3D geometry using a DEM as a RASTER within PostGIS?  Has anyone played in
 this arena?



 Thanks,
 Steve



 http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
 Geographic Information Systems (GIS) Manager
 (216) 635-3243

 s...@clevelandmetroparks.com
 clevelandmetroparks.comhttp://www.clemetparks.com/



___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Are there any Ubuntu PPAs that serve PostGIS 2.0 beta releases?

2012-03-15 Thread Stephen V. Mather
 Pretty slick. I will ponder upgrading GEOS and GDAL and setting up a stable 
 build for the most recent beta releases.

 

Wow.  That would be awesome.

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

image001.png___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Are there any Ubuntu PPAs that serve PostGIS 2.0 beta releases?

2012-03-14 Thread Stephen V. Mather
For compiling 2.0 for Ubuntu, I’d recommend doing a custom build of GDAL 1.9 
with GEOS 3.3.2—otherwise you’ll have the package manager bringing in GEOS 
3.2.x for GDAL 1.7, and then you’ll have two GEOS libraries floating out there… 
.  Might fix the problem below too.

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

From: postgis-users-boun...@postgis.refractions.net 
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Charlie 
Sharpsteen
Sent: Wednesday, March 14, 2012 4:01 PM
To: postgis-us...@googlegroups.com
Cc: Charlie Sharpsteen; PostGIS Users Discussion
Subject: Re: [postgis-users] Are there any Ubuntu PPAs that serve PostGIS 2.0 
beta releases?

 

On Wednesday, March 14, 2012 8:44:16 AM UTC-7, Charlie Sharpsteen wrote:

On Wednesday, March 14, 2012 8:40:22 AM UTC-7, Charlie Sharpsteen wrote:

It does look like a GDAL upgrade to 1.9 would be a good idea though if the 
final version will require it. I have plenty of experience building this stuff 
from maintaining most of the GIS stack for the Homebrew package manager on OS 
X. Entirely new to Debian packaging though, so that will slow me down quite a 
bit.

 

-Charlie

 

Actually, after re-reading the installation notes, it doesn't look like GDAL 
1.9 is mandatory---just that GDAL = 1.6 will be mandatory once PostGIS 2.0 is 
released.

 

-Charlie

 

Allright, took a few jabs at this and here is what I have found so far:

 

  - Without GEOS 3.3.2, PostGIS must be configured `--without-topology` so this 
definitely knocks out a big chunk of 2.0 functionality.

 

  - 2.0.0beta2 can compile against the dependencies supplied for PostGIS 1.5.x 
via `apt-get build-dep postgis` with the addition of GDAL 1.7.0 via `apt-get 
install libgdal1-dev`. However, 2.0.0beta3, released today, and the current SVN 
head fail during configure:

 

 

RASTER: Raster support requested

checking for GDAL = 1.6.0... found

checking gdal.h usability... yes

checking gdal.h presence... yes

checking for gdal.h... yes

checking ogr_api.h usability... yes

checking ogr_api.h presence... yes

checking for ogr_api.h... yes

checking cpl_conv.h usability... yes

checking cpl_conv.h presence... yes

checking for cpl_conv.h... yes

checking for GDALAllRegister in -lgdal... no

configure: error: could not find gdal

 

 

This is odd, because running nm against the libraries shows that the symbol is 
there:

 

vagrant@vagrant-64:~/postgis-2.0.0beta3$ nm --dynamic /usr/lib/libgdal1.7.0.so 
| grep GDALAllRegister

0021a820 T GDALAllRegister

 

 

Don't know if this is a bug in the latest beta, or a problem with Ubuntu's GDAL 
1.7.0 libraries. Any advice would be appreciated.

 

 

-Charlie

image001.png___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] 3D geometries

2012-03-13 Thread Stephen V. Mather
Hi All,

Any special considerations for turning a 2D multi-line
geometry into a 3D geometry using a DEM as a RASTER within PostGIS?  Has
anyone played in this arena?

 

Thanks,
Steve

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

image001.png___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] 3D geometries

2012-03-13 Thread Stephen V. Mather
Hi Pierre,

I could try my hand at this as a PL/pgSQL function.  Can't help with the
C++... :)

I'm thinking ST_Densify ala Paul deriving the densification from the cell
size of the input raster, then use st_dumppoints and st_intersects, and then
reconstruct to 3D line (or am I thinking too low level to be efficient).

Best,
Steve


Stephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243
s...@clevelandmetroparks.com
clevelandmetroparks.com





-Original Message-
From: Pierre Racine [mailto:pierre.rac...@sbf.ulaval.ca] 
Sent: Tuesday, March 13, 2012 2:22 PM
To: s...@clevelandmetroparks.com; PostGIS Users Discussion
Subject: RE: [postgis-users] 3D geometries

Hi Stephen,

It would certainly be very nice to have a generic function doing it:

SELECT  ST_SetMFromRaster(geom, rast)  geom
FROM mylines, myrast
WHERE ST_Intersects(geom, rast)

Pierre

 -Original Message-
 From: postgis-users-boun...@postgis.refractions.net [mailto:postgis-users-
 boun...@postgis.refractions.net] On Behalf Of Stephen V. Mather
 Sent: Tuesday, March 13, 2012 1:43 PM
 To: postgis-users@postgis.refractions.net
 Subject: [postgis-users] 3D geometries
 
 Hi All,
 
 Any special considerations for turning a 2D multi-line
geometry into a
 3D geometry using a DEM as a RASTER within PostGIS?  Has anyone played in
 this arena?
 
 
 
 Thanks,
 Steve
 
 
 
 http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
 Geographic Information Systems (GIS) Manager
 (216) 635-3243
 
 s...@clevelandmetroparks.com
 clevelandmetroparks.com http://www.clemetparks.com/
 
 
 
 
 
 
 
 




___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] PostGIS 2.0 beta 3

2012-03-12 Thread Stephen V. Mather
Hi All,

Hopefully this isn't unnecessary chatter, but I have nothing
earth-shattering to report on PostGIS 2.0 beta 3.  Installed and compiled
easily on Ubuntu 11.10 oneiric.  Thanks for all the hard work.

 

Best,

Steve

 

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

image001.png___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] pgRouting 1.5 and PostGIS 2.0beta3

2012-03-12 Thread Stephen V. Mather
Hi All,

Quick question: has anyone used pgRouting 1.5 with PostGIS
2.0beta3?  Don't want to repeat mistakes others have made. .

 

Steve

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

image001.png___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] pgRouting 1.5 and PostGIS 2.0beta3

2012-03-12 Thread Stephen V. Mather
Thanks Steve,

Steve

Stephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243
s...@clevelandmetroparks.com
clevelandmetroparks.com





-Original Message-
From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Stephen
Woodbridge
Sent: Monday, March 12, 2012 12:43 PM
To: postgis-users@postgis.refractions.net
Subject: Re: [postgis-users] pgRouting 1.5 and PostGIS 2.0beta3

On 3/12/2012 12:17 PM, Stephen V. Mather wrote:
 Hi All,

 Quick question: has anyone used pgRouting 1.5 with PostGIS 2.0beta3?
 Don't want to repeat mistakes others have made. .

Regardless of postGIS version don't use shooting star on 1.5 it is 
seriously broken. If you need turn restrictions there is new code in a 
trsp (turn restricted shortest path) branch the is faster than shooting 
star and much faster.

-Steve W

 Steve

 http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
 Geographic Information Systems (GIS) Manager
 (216) 635-3243

 s...@clevelandmetroparks.com
 clevelandmetroparks.com http://www.clemetparks.com/



 ___
 postgis-users mailing list
 postgis-users@postgis.refractions.net
 http://postgis.refractions.net/mailman/listinfo/postgis-users

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Call for Google Summer of Code (GSoC) 2012

2012-03-08 Thread Stephen V. Mather
+1 on this.  :)

Stephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243
s...@clevelandmetroparks.com
clevelandmetroparks.com




-Original Message-
From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Stephen
Woodbridge
Sent: Thursday, March 08, 2012 2:46 PM
To: postgis-users@postgis.refractions.net
Subject: Re: [postgis-users] Call for Google Summer of Code (GSoC) 2012

On 3/8/2012 2:39 PM, Stefan Keller wrote:
 Hi

 I do have a student who is interested in participating at the Google
 Summer of Code (GSoC) 2012
 Now I have the burden to look for a cool project... Any ideas?

Native implementation of Voroni polygons and/or Delaney triangles for 
postGIS. These can be created using pl/R but not everyone has the 
installed or know how to use it.

You might also look in the ticket tracker for new feature requests.

-Steve W
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] The PostGIS Blog project

2012-02-24 Thread Stephen V. Mather
Aggregation would be better for me.  The only warning I'd give is you'll
also get poorly formed and inefficient queries from blogs like mine, where
the implicit cross join is all too common :).  I cause enough damage without
being aggregated.  But hopefully, aggregation would also expose those blogs
to additional critique.

Best,
Steve

Stephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243
s...@clevelandmetroparks.com
clevelandmetroparks.com




-Original Message-
From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Paragon
Corporation
Sent: Friday, February 24, 2012 1:10 AM
To: 'PostGIS Users Discussion'
Subject: Re: [postgis-users] The PostGIS Blog project

Aggregation is better for me.  We use serendipity for both BostonGIS and
postgresonline.com sites.

 and we have postgis tags for both that are accessible as separate rss
feeds. 

http://www.bostongis.com/blog/index.php?/feeds/categories/3-postgis-postgres
ql.rss
http://www.postgresonline.com/journal/feeds/categories/16-postgis.rss


Aside from that I think it's a great idea since there are so many bloggers
out there that post about PostGIS and probably have those posts tagged
and I'm always hunting for them.

Thanks,
Regina

 -Original Message-
 From: postgis-users-boun...@postgis.refractions.net 
 [mailto:postgis-users-boun...@postgis.refractions.net] On 
 Behalf Of Sandro Santilli
 Sent: Thursday, February 23, 2012 1:42 PM
 To: PostGIS Users Discussion
 Subject: Re: [postgis-users] The PostGIS Blog project
 
 On Thu, Feb 23, 2012 at 12:51:45PM -0500, Pierre Racine wrote:
  I don't see you have a postgis category. Only GIS...
 
 You're right!
 But I have a postgis tag:
 http://strk.keybit.net/blog/tag/postgis/feed/
 
 NOTE: wordpress is free software, don't let Blogger grab you.
 
 --strk;
 
   ,--o-. 
   |   __/  |Delivering high quality PostGIS 2.0 !
   |  / 2.0 |http://strk.keybit.net - http://vizzuality.com
   `-o--'
 
 ___
 postgis-users mailing list
 postgis-users@postgis.refractions.net
 http://postgis.refractions.net/mailman/listinfo/postgis-users
 


___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


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

2012-02-14 Thread Stephen V. Mather
To expand on that, the basic understanding is that file level access to data
(e.g. shapefile) will always be faster for the entire dataset (all things
being equal) because of the management overhead of the database, but for
accessing a subset of features of the dataset (often the typical use case),
the database is faster if it has indices on the appropriate columns (the
geometry being the more important one).  Even if you are accessing all of
the records in the database at once as a common case, you probably don't
need every node in the polygons/polylines, and might create a view or column
that pre-generalizes those data before delivering them.

Best,
Steve

Stephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243
s...@clevelandmetroparks.com
clevelandmetroparks.com




-Original Message-
From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Stephen
Woodbridge
Sent: Tuesday, February 14, 2012 2:15 PM
To: postgis-users@postgis.refractions.net
Subject: Re: [postgis-users] advice for quicker display?

On 2/14/2012 1:57 PM, Bistrais, Bob wrote:
 As some of you already know, I'm a newbie to PostGIS and have just
 barely got a test PostGIS database up and running. So, my latest
 question is in regards to draw times. I created a statewide parcel layer
 from a shapefile. At statewide scale, when the application loads, the
 parcel data draws far slower than the original shapefile did. How can I
 tune this so that draw times are better?

If you are drawing all the data, it will always be slower than 
shapefiles. The trick is to not draw more than is reasonable at a given 
scale. So the answer is don't try to draw all the parcels for the whole 
state. As you zoom in and need to only draw a subset of the parcels, you 
will start to get speed advantages by using the spatial (GIST) indexes 
in postgis.

create index mytable_the_geom_gidx on mytable using gist (the_geom);

-Steve W
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] Keeping vertices from lines in order... .

2012-02-09 Thread Stephen V. Mather
Hi All,

If I'm converting from a line to its vertices, I use
something like this (ala the postgis docs):

 

SELECT 

   ST_PointN(

  the_geom,

  generate_series(1, ST_NPoints(the_geom))

   )

FROM ms_trails_test AS foo;

 

Now, if I want to make sure I keep all those vertices in order for later, I
better give them an id, so here's my original cludge:

 

SELECT 

   ST_PointN(

  the_geom,

  generate_series(1, ST_NPoints(the_geom))

   ),

generate_series(1, ST_NPoints(the_geom)) + foo.gid * 10

FROM ms_trails_test AS foo;

 

Which is fine for most cases, but not really a general solution. .

Better yet, I'll just keep my original gid as the feature id and have a
separate vertex id:

 

SELECT 

   ST_PointN(

  the_geom,

  generate_series(1, ST_NPoints(the_geom))

   ),

gid as feature_id,

generate_series(1, ST_NPoints(the_geom)) as vertex_id

FROM ms_trails_test AS foo;

 

Thus, I can play with the points and reassemble them back into lines later.
But, it seems inefficient to run generate_series twice.  Is this the best
way?

 

 

 

 

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

image001.png___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Keeping vertices from lines in order... .

2012-02-09 Thread Stephen V. Mather
Ah, and I see it's a 1.5 feature.  Thank you.

 

Steve

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

From: nicky...@gmail.com [mailto:nicky...@gmail.com] On Behalf Of Nicolas
Ribot
Sent: Thursday, February 09, 2012 4:40 PM
To: s...@clevelandmetroparks.com; PostGIS Users Discussion
Subject: Re: [postgis-users] Keeping vertices from lines in order... .

 

Hi,

 

The new st_dumppoints() function may be useful in your case. It returns an
array of (path, point) that represents the line vertices:

 

select st_dumppoints('LINESTRING(0 0, 1 1, 2 2)'::geometry);

 

  st_dumppoints   

--

 ({1},010100)

 ({2},010100F03FF03F)

 ({3},0101400040)

(3 rows)

 

Nicolas

 

On 9 February 2012 21:57, Stephen V. Mather s...@clevelandmetroparks.com
wrote:

Hi All,

If I'm converting from a line to its vertices, I use
something like this (ala the postgis docs):

 

SELECT 

   ST_PointN(

  the_geom,

  generate_series(1, ST_NPoints(the_geom))

   )

FROM ms_trails_test AS foo;

 

Now, if I want to make sure I keep all those vertices in order for later, I
better give them an id, so here's my original cludge:

 

SELECT 

   ST_PointN(

  the_geom,

  generate_series(1, ST_NPoints(the_geom))

   ),

generate_series(1, ST_NPoints(the_geom)) + foo.gid * 10

FROM ms_trails_test AS foo;

 

Which is fine for most cases, but not really a general solution. .

Better yet, I'll just keep my original gid as the feature id and have a
separate vertex id:

 

SELECT 

   ST_PointN(

  the_geom,

  generate_series(1, ST_NPoints(the_geom))

   ),

gid as feature_id,

generate_series(1, ST_NPoints(the_geom)) as vertex_id

FROM ms_trails_test AS foo;

 

Thus, I can play with the points and reassemble them back into lines later.
But, it seems inefficient to run generate_series twice.  Is this the best
way?

 

 

 

 

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) tel:%28216%29%20635-3243  635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 


___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

 

image001.png___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] merging dual carriageway motorway lines

2011-12-19 Thread Stephen V. Mather
You might also look to straight skeletons or voronoi polygons (medial axis
transform) to collapse dual lines, which would require R-stat e.g.
http://www.joeconway.com/plr/, unless someone has a script kicking around to
do it in pure postgis.

Some early work on the problem:
http://proceedings.esri.com/library/userconf/proc96/TO400/PAP370/P370.HTM
(mostly useful conceptually)

BTW, these techniques work really well for collapsing smooth lines, like
those made of human built infrastructure.  They do not work as well for
bumpy lines like rivers and such.  For these, some filtering is needed,
such as the scale axis transform
http://www.balintmiklos.com/scale-axis/algorithm_siggraph_2010.html.

Best,
Steve

Stephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243
s...@clevelandmetroparks.com
clevelandmetroparks.com




-Original Message-
From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Stephen
Woodbridge
Sent: Monday, December 19, 2011 9:21 AM
To: postgis-users@postgis.refractions.net
Subject: Re: [postgis-users] merging dual carriageway motorway lines

On 12/19/2011 7:12 AM, Lauri Kajan wrote:
 Hi all,

 I have a road network loaded to PostGIS.
 Now I'm trying to find a way to merge parallel lines of a dual
 carriageway motorway to single a line?
 Or is there any?

Lauri,

I do not think there is any automated way to do this, but here are some 
thoughts on how you might be able to do this.

1. collect the dual carriageway segments based on a common attribute 
like name

2. for each segment, extract the points of the linestring and tag them 
with the segments uid, you also might want to generate extra points 
along this linestring and tag them with the segments uid also

3. for each point find the nearest point not on this segments uid, and 
probably not on a connected segment within some limit distance and 
insert a point that is the midpoint between the reference point and the 
nearest point into a combine_point table.

4. stringify the combined_point table by connecting nearest points 
within some limit distance.

Problems that you might encounter:

a. ramps backs that might get included by mistake.

b. loops or near loops like mountain switch that might confuse the stringify

c. combine carriageway does not follow mid-point path of dual carriage 
because not all segments were selected or there were not enough points 
generated along the original paths to compute the mid point path.

I have not tried to do this but it is how I would tackle the problem. 
Others might have some good ideas also.

Thanks,
   -Steve
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] Advanced Cartographic Effects

2011-11-29 Thread Stephen V. Mather
Hi All,

PostGIS, a cartographic tool?  I have a rather vague query,
so bear with me.  I'm looking to shortcut some painful manual cartographic
work, with any luck by using PostGIS.

I want to show nearly coincident lines with exaggerated
distances between them, while maintaining their basic topology-e.g. having
lines cross when they cross.  In other words, all nodes of intersection
should be stationary, and all other vertices moved some distance away.
I'm supposing I can define away topologically (left or right), or even
along the same axis as a line drawn between the vertex and the nearest point
on a line.  Am I thinking along the right lines, and should I be using
topology rules to keep my nodes stationary, or can I keep it simpler?

 

Best,

Steve

 

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

image001.png___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Good Mac app for editing Shape (.shp) files?

2011-11-28 Thread Stephen V. Mather
Quantum GIS (QGIS)

Stephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243
s...@clevelandmetroparks.com
clevelandmetroparks.com





-Original Message-
From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of René
Fournier
Sent: Monday, November 28, 2011 12:28 PM
To: PostGIS Users Discussion
Subject: [postgis-users] Good Mac app for editing Shape (.shp) files?

I've noticed some irregularities/mistakes in certain polygons describing
state borders in a shape file I downloaded. I would like to correct the
mistakes — basically remove some of the points along certain line segments,
and move the position of other lines — then re-import into Postgresql. Can
anyone recommend a good [free] app for Mac OS X that lets one edit shape
files visually?

Thanks.

…Rene

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] PostGIS OSX Lion

2011-11-23 Thread Stephen V. Mather
If memory serves me, it's always good practice to run fix permissions on
disks before and after upgrade for OS X.  This may resolve your issue.

 

Best,

Steve

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Illya
Santos
Sent: Wednesday, November 23, 2011 3:30 PM
To: PostGIS Users Discussion
Subject: [postgis-users] PostGIS OSX Lion

 

Hello List, 

I have recently upgraded to lion, installed the latest version of psql 9.1
and then when I ran the stackbuilder, selected postgis extension and
stackbuilder crashed. Now when I try to run stack builder I get the
following error -  can't open file '/etc/postgres-reg.ini' (error 13:
Permission denied). 

Can anyone help or advise me - I was so happy when psql 9.1 worked with
little fuss other than creating the postgres user manually, now this. 


Thank you very much in advance, 

Illya 

image001.png___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Hosting para postgis

2011-11-21 Thread Stephen V. Mather
I know GeoSolutions out of Italy has done some work in this arena.  Not sure
who else… .

 

Best,

Steve

 

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Javier
Pacha
Sent: Thursday, November 17, 2011 10:20 PM
To: postgis-users@postgis.refractions.net
Subject: [postgis-users] Hosting para postgis

 

Saludos.. conocen algún proveedor de hosting con postgis, geoserver y jboss
(o apache)

image001.png___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Announcement: PostGIS Raster now support map algebra on two rasters!

2011-11-08 Thread Stephen V. Mather
Holly schmolly!  This will be fun.

Stephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243
s...@clevelandmetroparks.com
clevelandmetroparks.com





-Original Message-
From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Pierre
Racine
Sent: Tuesday, November 08, 2011 12:14 PM
To: (postgis-users@postgis.refractions.net)
Subject: [postgis-users] Announcement: PostGIS Raster now support map
algebra on two rasters!

Hi all PostGIS Raster fans,

Thanks to Bborie Park form the Center for Vectorborne Diseases at the
University of California, PostGIS Raster now supports map algebra operations
on two rasters. The new function, along with its sister working on one
raster, grants PostGIS with one of the most flexible map algebra operator
available today in any GIS package.

ST_MapAlgebra(raster, raster, expression) - raster...

-compute a new raster from the expression of two input raster,
-the expression is evaluated by the PostgreSQL parser so that any valid SQL
expression can be used including conditional expressions. an upcoming
variant will allow you to refer to your own custom function instead of using
an expression,
-can compute the new raster over the extent of the first input raster, the
second inout raster, the intersection of the two rasters or their union,
-accept alternative expressions to deal with nodata value occurring in the
first, the second or both raster.

This major milestone which will be part of PostGIS 2.0 is the foundation for
many future cool developments:

-ST_Intersection(raster, raster) and all other overlay operation like
ST_Union(), ST_Difference(), ST_SymDifference()
-ST_Clip(raster, geometry) (which is essentially the same as
ST_Intersection(raster, ST_AsRaster(geometry)))
-ST_BurnToRaster(raster, geometry)

You can obviously build your own raster model from an expression of many
raster layers by imbricating many ST_Mapalgebra calls. e.g to implement r1 =
(r2 + r3) / r4 you can do 

SELECT ST_MapAlgebra(rasttemp.rast, r4.rast, rast1/rast2) AS r1
FROM (
 SELECT ST_MapAlgebra(r2.rast, r3.rast, rast1 + rast2) AS rast
 FROM r2, r3
 WHERE ST_Intersects(r2.rast, r3.rast)) rasttemp,
 r4
WHERE ST_Intersects(rasttemp.rast, r4.rast))

Feel free to be creative and suggest your own plpgsql or C code to get map
algebra to work!

Thanks,

Pierre
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] (no subject)

2011-11-01 Thread Stephen V. Mather
Hi All,

In over my head. .  Got PostGIS 2.0 compiled and installed
with 9.1 (after having some success with it with 8.4) and ran into the
following error when I try to apply postgis.sql to my database:

 

postgres@postgis:/usr/share/postgresql/contrib/postgis-2.0$  psql -d test -f
postgis.sql

SET

BEGIN

psql:postgis.sql:70: ERROR:  could not load library
/usr/lib/postgresql/postgis-2.0.so: /usr/lib/postgresql/postgis-2.0.so:
undefined symbol: GEOSHausdorffDistance

etc.

 

Is I do an ls on /usr/lib/postgresql/postgis-2.0.so, it exists.  Any guesses
as to what's going wrong?

 

(as postgres):

 

$ ls -l /usr/lib/postgresql/postgis-2.0.so 

-rwxr-xr-x 1 root root 1411872 2011-11-01 09:56
/usr/lib/postgresql/postgis-2.0.so

 

Thanks,

Steve

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

image001.png___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] PostGIS 2.0 compilation and install

2011-11-01 Thread Stephen V. Mather
Sorry for the lack of subject on the last one.

 

Steve

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

From: Stephen V. Mather [mailto:s...@clevelandmetroparks.com] 
Sent: Tuesday, November 01, 2011 10:21 AM
To: postgis-users@postgis.refractions.net
Subject: 

 

Hi All,

In over my head. .  Got PostGIS 2.0 compiled and installed
with 9.1 (after having some success with it with 8.4) and ran into the
following error when I try to apply postgis.sql to my database:

 

postgres@postgis:/usr/share/postgresql/contrib/postgis-2.0$  psql -d test -f
postgis.sql

SET

BEGIN

psql:postgis.sql:70: ERROR:  could not load library
/usr/lib/postgresql/postgis-2.0.so: /usr/lib/postgresql/postgis-2.0.so:
undefined symbol: GEOSHausdorffDistance

etc.

 

Is I do an ls on /usr/lib/postgresql/postgis-2.0.so, it exists.  Any guesses
as to what's going wrong?

 

(as postgres):

 

$ ls -l /usr/lib/postgresql/postgis-2.0.so 

-rwxr-xr-x 1 root root 1411872 2011-11-01 09:56
/usr/lib/postgresql/postgis-2.0.so

 

Thanks,

Steve

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

image002.png___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] PostGIS 2.0 compilation and install

2011-11-01 Thread Stephen V. Mather
Hi Mateusz,
GEOS 3.3.1 is compiled and installed, and I didn't throw any errors 
when running the configuration.

This is what I get when I run ldd against it:

$ ldd /usr/lib/postgresql/postgis-2.0.so 
linux-vdso.so.1 =  (0x7fff857ff000)
libgeos_c.so.1 = /usr/lib/libgeos_c.so.1 (0x7fad84e35000)
libproj.so.0 = /usr/lib/libproj.so.0 (0x7fad84bf4000)
libxml2.so.2 = /usr/lib/libxml2.so.2 (0x7fad84897000)
libc.so.6 = /lib/libc.so.6 (0x7fad8453)
libgeos-3.0.0.so = /usr/lib/libgeos-3.0.0.so (0x7fad841e2000)
libstdc++.so.6 = /usr/lib/libstdc++.so.6 (0x7fad83ed5000)
libm.so.6 = /lib/libm.so.6 (0x7fad83c52000)
libgcc_s.so.1 = /lib/libgcc_s.so.1 (0x7fad83a3b000)
libdl.so.2 = /lib/libdl.so.2 (0x7fad83836000)
libz.so.1 = /usr/lib/libz.so.1 (0x7fad8361f000)
/lib64/ld-linux-x86-64.so.2 (0x7fad852de000)

Oh-- it looks like the dependency is pointing to libgeos-3.0.0 which isn't 
right... .

Steve

Stephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243
s...@clevelandmetroparks.com
clevelandmetroparks.com



-Original Message-
From: Mateusz Loskot [mailto:mate...@loskot.net] 
Sent: Tuesday, November 01, 2011 10:30 AM
To: s...@clevelandmetroparks.com; PostGIS Users Discussion
Subject: Re: [postgis-users] PostGIS 2.0 compilation and install

On 1 November 2011 14:21, Stephen V. Mather s...@clevelandmetroparks.com 
wrote:
 psql:postgis.sql:70: ERROR: could not load library 
 /usr/lib/postgresql/postgis-2.0.so:
/usr/lib/postgresql/postgis-2.0.so: undefined symbol: GEOSHausdorffDistance

I suppose the complain is about GEOS library. Check if you have GEOS installed.
Also, run this command to see if all run-time dependencies/libraries
for postgis-2.0.so
can be found:

$ ldd /usr/lib/postgresql/postgis-2.0.so

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org
Member of ACCU, http://accu.org



___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Hausdorf

2011-11-01 Thread Stephen V. Mather
Yup, that seems to be it.  Just removed GEOS 3.0.0

 

Thanks!

Steve

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

From: pram...@cleverelephant.ca [mailto:pram...@cleverelephant.ca] On Behalf
Of Paul Ramsey
Sent: Tuesday, November 01, 2011 12:54 PM
To: s...@clevelandmetroparks.com; PostGIS Users Discussion
Subject: Re: [postgis-users] Hausdorf

 

The problem is that you have built against a higher GEOS than you have
installed on your system. Well, actually you probably have two versions
installed in your system, it's just that PostGIS is finding the lower one at
runtime. Run 'ldd' on postgis.so to see what libgeos is being picked up and
then get rid of it so that the newer one takes priority.

 

P.

On Tue, Nov 1, 2011 at 9:36 AM, Paul Ramsey pram...@opengeo.org wrote:

The latest PostGIS requires a later GEOS (actually, the build should be
avoiding this symbol for older versions of GEOS, what version of GEOS do you
have?) so get the latest GEOS too.

 

P.

On Tue, Nov 1, 2011 at 7:20 AM, Stephen V. Mather
s...@clevelandmetroparks.com wrote:

Hi All,

In over my head. .  Got PostGIS 2.0 compiled and installed
with 9.1 (after having some success with it with 8.4) and ran into the
following error when I try to apply postgis.sql to my database:

 

postgres@postgis:/usr/share/postgresql/contrib/postgis-2.0$  psql -d test -f
postgis.sql

SET

BEGIN

psql:postgis.sql:70: ERROR:  could not load library
/usr/lib/postgresql/postgis-2.0.so: /usr/lib/postgresql/postgis-2.0.so:
undefined symbol: GEOSHausdorffDistance

etc.

 

Is I do an ls on /usr/lib/postgresql/postgis-2.0.so, it exists.  Any guesses
as to what's going wrong?

 

(as postgres):

 

$ ls -l /usr/lib/postgresql/postgis-2.0.so 

-rwxr-xr-x 1 root root 1411872 2011-11-01 09:56
/usr/lib/postgresql/postgis-2.0.so

 

Thanks,

Steve

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243 tel:%28216%29%20635-3243 

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

 

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

 

 

image001.png___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] documentation in svn

2011-11-01 Thread Stephen V. Mather
Hi All,

Hope this is the right place to post this.  Just found a
minor typo in the following page:

 

http://www.postgis.org/documentation/manual-svn/using_postgis_dbmanagement.h
tml#geometry_columns

 

Also a problem here:

http://www.postgis.org/documentation/manual-1.5/ch04.html#geometry_columns

http://www.postgis.org/documentation/manual-1.4/ch04.html#id2759271

http://www.postgis.org/documentation/manual-1.3/ch04.html#id2571510

 

 

CREATE TABLE geometry_columns (

  f_table_catalogVARRCHAR(256) NOT NULL,

  f_table_schema VARCHAR(256) NOT NULL,

  f_table_nameVARCHAR(256) NOT NULL,

  f_geometry_column  VARCHAR(256) NOT NULL,

  coord_dimensionINTEGER NOT NULL,

  srid   INTEGER NOT NULL,

  type   VARCHAR(30) NOT NULL

)

 

The non-pirate version should be:

 

CREATE TABLE geometry_columns (
  f_table_catalogVARCHAR(256) NOT NULL,
  f_table_schema VARCHAR(256) NOT NULL,
  f_table_nameVARCHAR(256) NOT NULL,
  f_geometry_column  VARCHAR(256) NOT NULL,
  coord_dimensionINTEGER NOT NULL,
  srid   INTEGER NOT NULL,
  type   VARCHAR(30) NOT NULL
)

 

Now, who can guess which admin accidentally deleted his geometry_columns
table in order to discover this.  Maddening to fix in 1.3 too. .

 

Best,

Steve

 

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

image001.png___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] Using PostGIS 2.0

2011-10-28 Thread Stephen V. Mather
Hi All,

Recognizing we'll be living on the bleeding edge and there
are ramifications to that (like, well, bleeding), are there any real (known)
pitfalls to running 2.0 now?  Live?  With users?  Also, is KNN in the SVN?

 

Best,

Steve

 

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

image001.png___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Using PostGIS 2.0

2011-10-28 Thread Stephen V. Mather
Once more question-- does KNN support 3D?

Stephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243
s...@clevelandmetroparks.com
clevelandmetroparks.com





-Original Message-
From: Sandro Santilli [mailto:sandro.santi...@gmail.com] On Behalf Of Sandro
Santilli
Sent: Friday, October 28, 2011 9:57 AM
To: s...@clevelandmetroparks.com; PostGIS Users Discussion
Subject: Re: [postgis-users] Using PostGIS 2.0

On Fri, Oct 28, 2011 at 09:43:15AM -0400, Stephen V. Mather wrote:
 Hi All,
 
 Recognizing we'll be living on the bleeding edge and there
 are ramifications to that (like, well, bleeding), are there any real
(known)
 pitfalls to running 2.0 now?  Live?  With users?  Also, is KNN in the SVN?

All the known pitfalls are on the bug tracker:
http://trac.osgeo.org/postgis

This is a query for all open defect tickets with milestone 2.0:

http://trac.osgeo.org/postgis/query?status=assignedstatus=newstatus=reopen
edorder=prioritymilestone=PostGIS+2.0.0type=defect

KNN is in.

--strk; 

  ()   Free GIS  Flash consultant/developer
  /\   http://strk.keybit.net/services.html



___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] ST_DWithin-- unexpected behavior?

2011-10-25 Thread Stephen V. Mather
Hi All,

Running 1.3.5 still :).  Found some unexpected (to me), but
pleasant behavior with ST_DWithin.  What we're doing is creating a function
that we can use to randomize a point within a minimum and maximum bounds.
Our original approach was to generate the geometry of the difference of two
buffers (a donut, if you will) and then place a random point within that.
Better to test with ST_DWithin directly then buffer, so we rewrote:

 

BEGIN

 

xmin = ST_XMin(geom) - dough;

deltax = ST_XMax(geom) - xmin + dough;

ymin = ST_YMin(geom) - dough;

deltay = ST_YMax(geom) - ymin + dough;

 

WHILE i  itermax LOOP

i = i + 1;

pointx = xmin + deltax * random();

pointy = ymin + deltay * random();

returnpoint = ST_SetSRID( ST_MakePoint(
pointx, pointy ), ST_SRID(geom) );

EXIT WHEN

ST_DWithin( returnpoint,
geom, dough )

AND NOT

ST_DWithin( returnpoint,
geom, nut );

END LOOP;

 

IF i  itermax THEN

RAISE NOTICE 'Reached maximum iterations
without placing point inside donut.';

END IF;

 

RETURN returnpoint;

END;

 

The puzzling part is that even if the parameters are passed out of order,
i.e. the inner ring is passed for the outer ring and vice versa, we get a
fine result.  It's a nice unexpected behavior, but unexpected none-the-less.
Anyone have any thoughts on why this works?  Full function below:

 

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

CREATE OR REPLACE FUNCTION ST_Donut

( geom Geometry,

dough DOUBLE PRECISION,

nut DOUBLE PRECISION,

itermax INTEGER)

RETURNS Geometry

AS $$



DECLARE

xmin DOUBLE PRECISION;

ymin DOUBLE PRECISION;

 

deltax DOUBLE PRECISION;

deltay DOUBLE PRECISION;

 

pointx DOUBLE PRECISION;

pointy DOUBLE PRECISION;

 

returnpoint Geometry;

 

i INTEGER := 0;

 

nut1 DOUBLE PRECISION;

dough1 DOUBLE PRECISION;

 

BEGIN

 

xmin = ST_XMin(geom) - dough;

deltax = ST_XMax(geom) - xmin + dough;

ymin = ST_YMin(geom) - dough;

deltay = ST_YMax(geom) - ymin + dough;

 

WHILE i  itermax LOOP

i = i + 1;

pointx = xmin + deltax * random();

pointy = ymin + deltay * random();

returnpoint = ST_SetSRID( ST_MakePoint(
pointx, pointy ), ST_SRID(geom) );

EXIT WHEN

ST_DWithin( returnpoint,
geom, dough )

AND NOT

ST_DWithin( returnpoint,
geom, nut );

END LOOP;

 

IF i  itermax THEN

RAISE NOTICE 'Reached maximum iterations
without placing point inside donut.';

END IF;

 

RETURN returnpoint;

END;

 

$$ LANGUAGE plpgsql;

image001.png___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] ST_DWithin-- unexpected behavior?

2011-10-25 Thread Stephen V. Mather
Hi,

Sorry for the noise, but the function probably should be:

 

BEGIN

 

xmin = ST_X(geom) - dough;
-- establish lower left for buffer

ymin = ST_Y(geom) - dough;
--

delta = dough * 2;
--

 

 

WHILE i  itermax LOOP

i = i + 1;

pointx = xmin + delta * random();
-- generate random point value

pointy = ymin + delta * random();

returnpoint = ST_SetSRID( ST_MakePoint(
pointx, pointy ), ST_SRID(geom) );

EXIT WHEN

ST_DWithin( returnpoint,
geom, dough )  -- test to see if inside outer ring

AND NOT

ST_DWithin( returnpoint,
geom, nut );   --test to see if inside inner ring

END LOOP;

 

IF i  itermax THEN

RAISE NOTICE 'Reached maximum iterations
without placing point inside donut.';

END IF;

 

RETURN returnpoint;

END;

 

Even so, the question remains  :). 

 

Steve

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Stephen
V. Mather
Sent: Tuesday, October 25, 2011 11:04 AM
To: postgis-users@postgis.refractions.net
Subject: [postgis-users] ST_DWithin-- unexpected behavior?

 

Hi All,

Running 1.3.5 still :).  Found some unexpected (to me), but
pleasant behavior with ST_DWithin.  What we're doing is creating a function
that we can use to randomize a point within a minimum and maximum bounds.
Our original approach was to generate the geometry of the difference of two
buffers (a donut, if you will) and then place a random point within that.
Better to test with ST_DWithin directly then buffer, so we rewrote:

 

BEGIN

 

xmin = ST_XMin(geom) - dough;

deltax = ST_XMax(geom) - xmin + dough;

ymin = ST_YMin(geom) - dough;

deltay = ST_YMax(geom) - ymin + dough;

 

WHILE i  itermax LOOP

i = i + 1;

pointx = xmin + deltax * random();

pointy = ymin + deltay * random();

returnpoint = ST_SetSRID( ST_MakePoint(
pointx, pointy ), ST_SRID(geom) );

EXIT WHEN

ST_DWithin( returnpoint,
geom, dough )

AND NOT

ST_DWithin( returnpoint,
geom, nut );

END LOOP;

 

IF i  itermax THEN

RAISE NOTICE 'Reached maximum iterations
without placing point inside donut.';

END IF;

 

RETURN returnpoint;

END;

 

The puzzling part is that even if the parameters are passed out of order,
i.e. the inner ring is passed for the outer ring and vice versa, we get a
fine result.  It's a nice unexpected behavior, but unexpected none-the-less.
Anyone have any thoughts on why this works?  Full function below:

 

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

CREATE OR REPLACE FUNCTION ST_Donut

( geom Geometry,

dough DOUBLE PRECISION,

nut DOUBLE PRECISION,

itermax INTEGER)

RETURNS Geometry

AS $$



DECLARE

xmin DOUBLE PRECISION;

ymin DOUBLE PRECISION;

 

deltax DOUBLE PRECISION;

deltay DOUBLE PRECISION;

 

pointx DOUBLE PRECISION;

pointy DOUBLE PRECISION;

 

returnpoint Geometry;

 

i INTEGER := 0;

 

nut1 DOUBLE PRECISION;

dough1 DOUBLE PRECISION;

 

BEGIN

 

xmin = ST_XMin(geom) - dough;

deltax = ST_XMax(geom) - xmin + dough;

ymin = ST_YMin(geom) - dough;

deltay = ST_YMax(geom) - ymin + dough;

 

WHILE i  itermax LOOP

i = i + 1;

pointx = xmin + deltax * random();

pointy = ymin + deltay * random

[postgis-users] ST_SymDifference

2011-10-17 Thread Stephen V. Mather
Hi All,

True confession, I'm running PostGIS 1.3.5, so throw the
tomatoes gently if A) I'm doing a bad query, or B) I'm dredging up old news
on (in)efficiency, and I really should upgrade to 1.5.x, thank you very
much. .  Admittedly, it is time for that, but hopefully that's a separate
issue.

I'm trying to calculate the symmetrical difference on a pair
of geometries, and my query runs slowly:

 

 SELECT ST_SymDifference(

ST_Collect(neww.the_geom),

ST_Collect(oldd.the_geom) 

   ) AS the_geom

   FROM boundary neww, boundary_old oldd;

 

Now, if I were to be entirely honest, I'd confess that this was my cludge of
an original query:

 

 SELECT ST_SymDifference(

ST_Union(ST_Buffer(neww.the_geom, 0)),

ST_Union(ST_Buffer(oldd.the_geom, 0)) 

   ) AS the_geom

   FROM boundary neww, boundary_old oldd;

 

but who would admit to running a query like that, should they know better.
Not I.

 

So, why is my query so slow?  Is it A), B), or some yet to be known
to me C).  BTW, (now I'm just to being provocative,) when I run a
symmetrical difference in ArcGIS, it runs very quickly. :).

 

Best,

Thanks,

 

 

http://www.clemetparks.com/images/esig/cmp-ms-90x122.pngStephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243

s...@clevelandmetroparks.com
 http://www.clemetparks.com/ clevelandmetroparks.com

 

 

 

 

image001.png___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users