[postgis-users] Tools to change the encoding of the SHP/DBF files (from Latin1 to UTF-8)

2012-05-08 Thread Mac Wind
Hi.

Using PostGIS 1.5 on Windows, I get this error message when trying to
import a SHP:

Unable to convert data value to UTF-8 (iconv reports Invalid argument).
Current encoding is UTF-8. Try LATIN1 (Western European), or one of the
values described at
http://www.postgresql.org/docs/current/static/multibyte.html.


Really my data are in Latin1 encoding, but I don't want to change the
encoding of the DataBase into Latin1, but change the encoding of the SHP
(in fact, of the DBF) into UTF-8.

Which tool could I use to do this? Thank you very much.
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Tools to change the encoding of the SHP/DBF files (from Latin1 to UTF-8)

2012-05-08 Thread Sandro Santilli
On Tue, May 08, 2012 at 02:56:28PM +0200, Mac Wind wrote:
 Hi.
 
 Using PostGIS 1.5 on Windows, I get this error message when trying to
 import a SHP:
 
 Unable to convert data value to UTF-8 (iconv reports Invalid argument).
 Current encoding is UTF-8. Try LATIN1 (Western European), or one of the
 values described at
 http://www.postgresql.org/docs/current/static/multibyte.html.
 
 
 Really my data are in Latin1 encoding, but I don't want to change the
 encoding of the DataBase into Latin1, but change the encoding of the SHP
 (in fact, of the DBF) into UTF-8.
 
 Which tool could I use to do this? Thank you very much.

You don't have to change DB encoding, just tell the loader that your
data is in Latin1:

 $ shp2pgsql -W Latin1 ...

--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] Very large WHERE clause?

2012-05-08 Thread DrYSG
I have no joins. It is all in one large table with 20M records (and one field
is a geometry bounding box).

What I am considering now is not doing the Type=JPEG ... etc filter in the
stored procedure, but only the ST_INTERSECTS there.

The result should be about 3K-5k records, which then I can do the additional
set filtering (the rest of the WHERE clause) in LINQ or PLINQ.

Does this make sense? Does the DB have better architecture and performance
for doing set membership (IN test over 4 attributes) than does the C# LINQ?

I could also do what the other person suggested here, which is create a
bitmask (40 bits) and then do a AND test against it for membership in the
set. But I am not clear in LINQ, .NET does this already, and I am wasting my
time.



--
View this message in context: 
http://postgis.17.n6.nabble.com/Very-large-WHERE-clause-tp4952906p4960408.html
Sent from the PostGIS - User mailing list archive at Nabble.com.
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


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

2012-05-08 Thread Stephen Woodbridge

On 5/8/2012 10:26 AM, Gold, Jack L (US SSA) wrote:

I’m not even sure how to express this properly, but I’ll try. I’m trying
to build a query which will select positions within a specified polygon.
I have the query:

SELECT * FROM positions WHERE ST_Within(geometry(positions.location),
ST_GeomFromText(‘POLYGON((l b, r b, r t, l t, l b))’::text, 4326));

I want to be able to replace l, b, r, and t with variable values in a
plpgsql function like so:

$BODY$

DECLARE

l integer;

r integer;

b integer;

t integer;

BEGIN

SELECT pli_config.filter_left_longitude INTO l FROM pli_config;

SELECT pli_config.filter_right_longitude INTO r FROM pli_config;

SELECT pli_config.filter_bottom_latitude INTO b FROM pli_config;

SELECT pli_config.filter_top_latitude INTO t FROM pli_config;

SELECT * FROM positions

WHERE st_within(geometry(positions.location),
st_geomfromtext('POLYGON((l b,r b,r t,l t,l b))'::text, 4326));


'POLYGON(('||l||' '||b||','||r||' '||b||','


END;

$BODY$

The problem I have is I don’t know the proper syntax to replace the
variables in the single-quoted statement or even if it is possible. Any
ideas?

--Jack Gold



___
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] DE-9IM question

2012-05-08 Thread fork
Does anyone know of an exhaustive reference of DE-9IM matrices, with pictures?

Context:

I just finished classifying a bunch of polygons based on their relationship to
enveloping poly's in another layer (census blocks and census city boundaries,
respectively).  The regular old st_within() and friends weren't enough, so I
calculated all the DE-9IM's, counted them (yay for GROUP BY and real
databases!), and made sure I knew what was going on for each of the matrices
returned (7 total).  Then I classified my block polys based on the strings.

I found it CRAZY how many different types of DE-9IM's could be returned, even
with just polygons and very well aligned boundaries (credit to the US Census
Bureau's geography division).  Only a few of the matrices in my data were
actually described in the few docs I could find.  Besides the seven in my data,
there are at least four more that can be generated by various combinations of
overlapping polygons.

It would have been much easier to do this project if I had been able to
reference a list of possibilities along with pictures.  It would be even better
if I could be confident that such a list was exhaustive.

Does anyone have a reference?

If not, I could continue to work on an atlas of DE-9IM matrices, at least for
polygons, and submit it somewhere if it were helpful.  Any ideas for where that
might go? (I don't have a blog and don't want to start one).  Maybe just the
wikipedia entry?

For those who don't know, a DE-9IM matrix is the output of st_relate(geo1,
geo2), and there is an excellent intro in the docs.  Fascinating stuff really.

Tx

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


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

2012-05-08 Thread Sandro Santilli
On Tue, May 08, 2012 at 03:46:36PM +, fork wrote:
 Does anyone know of an exhaustive reference of DE-9IM matrices, with pictures?

http://en.wikipedia.org/wiki/DE-9IM
http://postgis.org/documentation/manual-svn/using_postgis_dbmanagement.html#DE-9IM

--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] DE-9IM question

2012-05-08 Thread fork
Sandro Santilli strk at keybit.net writes:

 http://en.wikipedia.org/wiki/DE-9IM
 http://postgis.org/documentation/manual-svn/using_postgis_dbmanagement.html#DE-9IM

Those either aren't exhaustive (postgis) or don't have pictures (wiki).  I would
like to be able to look up FF2F1F212 and see a picture of it. 

I think a difference is that I am not interested in using a matrix to implement
a function like st_within(), but rather I am querying a database looking for
relationships and how to deal with them.  In my case, also, the query will never
return a string with wildcards in it, because it will give me the exact
relationship. (Maybe the above links are exhaustive if you count wildcards,
though...)

Sorry -- I tried to make clear that I had already read the docs that are easily
available.  Thanks for the explicit links though.

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


[postgis-users] POSTGIS Security

2012-05-08 Thread Valerie Reinert
I've been told that POSTGIS has a new security package.  Someone said it
was called POSTGIS ES?  Can anyone point me to the information on line or
send me documentation.

Valerie Reinert
MITRE Corporation
vrein...@mitre.org
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] POSTGIS Security

2012-05-08 Thread Thomas Gratier
Hello,

I don't think there is something called POSTGIS ES but a new version of
PostGIS 1.5.x serie was released e.g
http://postgis.refractions.net/pipermail/postgis-users/2012-May/033992.html
I think it's what you're expecting.

Regards

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


Re: [postgis-users] PostGIS 1.5.4 Released

2012-05-08 Thread Stephen Woodbridge
I'm trying to install and upgrade a database with the new 1.5.4 version 
ad I'm getting an error.


I did the ./configure; make; sudo make install which all went well

psql -U postgres -h localhost testdb
testdb=# select * from postgis_full_version();

postgis_full_version
-
 POSTGIS=1.5.4 GEOS=3.2.0-CAPI-1.6.0 PROJ=Rel. 4.6.1, 21 August 
2008 LIBXML=2.6.32 USE_STATS (procs from 1.5 r7360 need upgrade)

(1 row)

testdb=# set search_path to public, pg_catalog;
SET
testdb=# \i postgis_upgrade_15_minor.sql
BEGIN
CREATE FUNCTION
   postgis_major_version_check
--
 Scripts versions checked for upgrade: ok
(1 row)

DROP FUNCTION
CREATE FUNCTION
CREATE FUNCTION
...
CREATE FUNCTION
psql:postgis_upgrade_15_minor.sql:220: NOTICE:  type box3d_extent is 
not yet defined

DETAIL:  Creating a shell type definition.
CREATE FUNCTION
psql:postgis_upgrade_15_minor.sql:224: NOTICE:  argument type 
box3d_extent is only a shell

CREATE FUNCTION
psql:postgis_upgrade_15_minor.sql:228: NOTICE:  argument type 
box3d_extent is only a shell

CREATE FUNCTION
psql:postgis_upgrade_15_minor.sql:232: NOTICE:  argument type 
box3d_extent is only a shell

CREATE FUNCTION
psql:postgis_upgrade_15_minor.sql:236: NOTICE:  argument type 
box3d_extent is only a shell

CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
...
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
psql:postgis_upgrade_15_minor.sql:1263: NOTICE:  argument type 
box3d_extent is only a shell
psql:postgis_upgrade_15_minor.sql:1263: NOTICE:  return type 
box3d_extent is only a shell

CREATE FUNCTION
psql:postgis_upgrade_15_minor.sql:1267: NOTICE:  argument type 
box3d_extent is only a shell
psql:postgis_upgrade_15_minor.sql:1267: NOTICE:  return type 
box3d_extent is only a shell

CREATE FUNCTION
psql:postgis_upgrade_15_minor.sql:1268: NOTICE:  aggregate 
extent(geometry) does not exist, skipping

DROP AGGREGATE
psql:postgis_upgrade_15_minor.sql:1273: ERROR:  type box3d_extent is 
only a shell
psql:postgis_upgrade_15_minor.sql:1274: ERROR:  current transaction is 
aborted, commands ignored until end of transaction block
psql:postgis_upgrade_15_minor.sql:1279: ERROR:  current transaction is 
aborted, commands ignored until end of transaction block
psql:postgis_upgrade_15_minor.sql:1283: ERROR:  current transaction is 
aborted, commands ignored until end of transaction block
psql:postgis_upgrade_15_minor.sql:1287: ERROR:  current transaction is 
aborted, commands ignored until end of transaction block
psql:postgis_upgrade_15_minor.sql:1288: ERROR:  current transaction is 
aborted, commands ignored until end of transaction block
psql:postgis_upgrade_15_minor.sql:1293: ERROR:  current transaction is 
aborted, commands ignored until end of transaction block
psql:postgis_upgrade_15_minor.sql:1294: ERROR:  current transaction is 
aborted, commands ignored until end of transaction block
psql:postgis_upgrade_15_minor.sql:1299: ERROR:  current transaction is 
aborted, commands ignored until end of transaction block
psql:postgis_upgrade_15_minor.sql:1302: ERROR:  current transaction is 
aborted, commands ignored until end of transaction block
psql:postgis_upgrade_15_minor.sql:1305: ERROR:  current transaction is 
aborted, commands ignored until end of transaction block

...
psql:postgis_upgrade_15_minor.sql:5161: ERROR:  current transaction is 
aborted, commands ignored until end of transaction block

ROLLBACK
testdb=# select postgis_full_version();
postgis_full_version 


-
 POSTGIS=1.3.3 GEOS=3.2.0-CAPI-1.6.0 PROJ=Rel. 4.6.1, 21 August 
2008 USE_STATS

(1 row)

Is the upgrade script broken? How can I fix this?

Thanks,
  -Steve


On 5/6/2012 6:41 AM, Paul Ramsey wrote:

Download from:

   http://postgis.org/download/postgis-1.5.4.tar.gz

The news:

  This is a bug fix release, addressing issues that have been
  filed since the 1.5.3 release.

  - Bug Fixes
- #547, ST_Contains memory problems (Sandro Santilli)
- #621, Problem finding intersections with geography (Paul Ramsey)
- #627, PostGIS/PostgreSQL process die on invalid geometry (Paul Ramsey)
- #810, Increase accuracy of area calculation (Paul Ramsey)
- #852, improve spatial predicates robustness (Sandro Santilli, Nicklas 
Avén)
- #877, ST_Estimated_Extent returns NULL on empty tables (Sandro Santilli)
- #1028, ST_AsSVG kills whole postgres server when fails (Paul Ramsey)
- #1056, Fix boxes of arcs and circle stroking code (Paul Ramsey)
- #1135, improve testsuite predictability (Andreas 'ads' Scherbaum)
- #1146, images generator crashes (bronaugh)
- #1170, North Pole intersection fails (Paul Ramsey)
- #1179, ST_AsText crash with bad value (kjurka)
- #1184, honour DESTDIR in 

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

2012-05-08 Thread fork
fork forkandwait at gmail.com writes:

 I found it CRAZY how many different types of DE-9IM's could be returned, even
 with just polygons and very well aligned boundaries (credit to the US Census
 Bureau's geography division).  Only a few of the matrices in my data were
 actually described in the few docs I could find.  

For a flavor, look at Table 3 here:

http://www.cise.ufl.edu/~mschneid/Research/papers/BS01ER.pdf

Note that these matrices are boolean for the intersection, and there are 32 of
them.  One can tweak them so that the max dimension on the boundaries is either
0 (a point) or 1 (a line) and create more matrices using the full definition of
DE-91M; see #33.

I am mostly just entertaining myself with mathematical patterns, but I think the
topological matrices might be useful in trying to figure out how to simplify
slivers and weird things.

I also think one's intuition about within might not stand up to closer
scrutiny via mathematical formalisms like this.  The only way I could figure out
my blocks-in-cities problem was to abandon st_within() etc and go for a list of
specific DE-9IM's based on the data.

If I feel bored/ ambitious I will try to create a useful atlas.  I don't think
one exists...

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


Re: [postgis-users] PostGIS 1.5.4 Released

2012-05-08 Thread Stephen Woodbridge
Never mind! the problem is because the upgrade scripts are not schema 
aware. I keep all my data in the data schema and have the database 
search_path set to data, public and when I last upgraded from 1.3.3 to 
1.5.3 it dumped all the functions into the data schema creating a 
mess. So now I probably just need to dump tables for about 50 databases 
and rebuild the databases from the dumps. sigh I think this probably 
need to be put off until I can upgrade to 9.x and 2.0 on a new server.


-Steve

On 5/8/2012 4:00 PM, Stephen Woodbridge wrote:

I'm trying to install and upgrade a database with the new 1.5.4 version
ad I'm getting an error.

I did the ./configure; make; sudo make install which all went well

psql -U postgres -h localhost testdb
testdb=# select * from postgis_full_version();

postgis_full_version
-

POSTGIS=1.5.4 GEOS=3.2.0-CAPI-1.6.0 PROJ=Rel. 4.6.1, 21 August
2008 LIBXML=2.6.32 USE_STATS (procs from 1.5 r7360 need upgrade)
(1 row)

testdb=# set search_path to public, pg_catalog;
SET
testdb=# \i postgis_upgrade_15_minor.sql
BEGIN
CREATE FUNCTION
postgis_major_version_check
--
Scripts versions checked for upgrade: ok
(1 row)

DROP FUNCTION
CREATE FUNCTION
CREATE FUNCTION
...
CREATE FUNCTION
psql:postgis_upgrade_15_minor.sql:220: NOTICE: type box3d_extent is
not yet defined
DETAIL: Creating a shell type definition.
CREATE FUNCTION
psql:postgis_upgrade_15_minor.sql:224: NOTICE: argument type
box3d_extent is only a shell
CREATE FUNCTION
psql:postgis_upgrade_15_minor.sql:228: NOTICE: argument type
box3d_extent is only a shell
CREATE FUNCTION
psql:postgis_upgrade_15_minor.sql:232: NOTICE: argument type
box3d_extent is only a shell
CREATE FUNCTION
psql:postgis_upgrade_15_minor.sql:236: NOTICE: argument type
box3d_extent is only a shell
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
...
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
psql:postgis_upgrade_15_minor.sql:1263: NOTICE: argument type
box3d_extent is only a shell
psql:postgis_upgrade_15_minor.sql:1263: NOTICE: return type box3d_extent
is only a shell
CREATE FUNCTION
psql:postgis_upgrade_15_minor.sql:1267: NOTICE: argument type
box3d_extent is only a shell
psql:postgis_upgrade_15_minor.sql:1267: NOTICE: return type box3d_extent
is only a shell
CREATE FUNCTION
psql:postgis_upgrade_15_minor.sql:1268: NOTICE: aggregate
extent(geometry) does not exist, skipping
DROP AGGREGATE
psql:postgis_upgrade_15_minor.sql:1273: ERROR: type box3d_extent is
only a shell
psql:postgis_upgrade_15_minor.sql:1274: ERROR: current transaction is
aborted, commands ignored until end of transaction block
psql:postgis_upgrade_15_minor.sql:1279: ERROR: current transaction is
aborted, commands ignored until end of transaction block
psql:postgis_upgrade_15_minor.sql:1283: ERROR: current transaction is
aborted, commands ignored until end of transaction block
psql:postgis_upgrade_15_minor.sql:1287: ERROR: current transaction is
aborted, commands ignored until end of transaction block
psql:postgis_upgrade_15_minor.sql:1288: ERROR: current transaction is
aborted, commands ignored until end of transaction block
psql:postgis_upgrade_15_minor.sql:1293: ERROR: current transaction is
aborted, commands ignored until end of transaction block
psql:postgis_upgrade_15_minor.sql:1294: ERROR: current transaction is
aborted, commands ignored until end of transaction block
psql:postgis_upgrade_15_minor.sql:1299: ERROR: current transaction is
aborted, commands ignored until end of transaction block
psql:postgis_upgrade_15_minor.sql:1302: ERROR: current transaction is
aborted, commands ignored until end of transaction block
psql:postgis_upgrade_15_minor.sql:1305: ERROR: current transaction is
aborted, commands ignored until end of transaction block
...
psql:postgis_upgrade_15_minor.sql:5161: ERROR: current transaction is
aborted, commands ignored until end of transaction block
ROLLBACK
testdb=# select postgis_full_version();
postgis_full_version
-

POSTGIS=1.3.3 GEOS=3.2.0-CAPI-1.6.0 PROJ=Rel. 4.6.1, 21 August
2008 USE_STATS
(1 row)

Is the upgrade script broken? How can I fix this?

Thanks,
-Steve


On 5/6/2012 6:41 AM, Paul Ramsey wrote:

Download from:

http://postgis.org/download/postgis-1.5.4.tar.gz

The news:

This is a bug fix release, addressing issues that have been
filed since the 1.5.3 release.

- Bug Fixes
- #547, ST_Contains memory problems (Sandro Santilli)
- #621, Problem finding intersections with geography (Paul Ramsey)
- #627, PostGIS/PostgreSQL process die on invalid geometry (Paul Ramsey)
- #810, Increase accuracy of area calculation (Paul Ramsey)
- #852, improve spatial predicates robustness (Sandro Santilli,
Nicklas Avén)
- #877, ST_Estimated_Extent returns NULL on empty tables (Sandro
Santilli)
- 

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

2012-05-08 Thread Mike Toews
On 9 May 2012 02:26, Gold, Jack L  (US SSA) jack.g...@baesystems.com wrote:
 I want to be able to replace l, b, r, and t with variable values in a
 plpgsql function like so:

It looks like you want to make a polygon from 'left', 'bottom',
'right' and 'top'. Rather than formatting WKT, you could use a
geometry constructor function:

SELECT ST_MakeEnvelope(l, b, r, t, 4326);

http://postgis.refractions.net/docs/ST_MakeEnvelope.html

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


Re: [postgis-users] POSTGIS Security

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

I think you heard about SE-PostgreSQL or Security-Enhanced PostgreSQL,
which uses Security-Enhanced Linux, originally developed by the US
NSA. Although I've never used it, I would think PostGIS would be
compatible with the framework.

Here is a good introduction to SE-PostgreSQL:
http://wiki.postgresql.org/wiki/SEPostgreSQL_Introduction

And and to SE-Linux:
http://www.nsa.gov/research/selinux/

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


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

2012-05-08 Thread Mike Toews
On 9 May 2012 03:46, fork forkandw...@gmail.com wrote:
 Does anyone know of an exhaustive reference of DE-9IM matrices, with pictures?

A really handy visual tool to work with DE-9IM is JTS TestBuilder. You
can interact with the geometries and the results, which makes it a
pretty good educational tool. You can copy/paste WKB directly into the
geometry inputs, which makes it work nice with PostGIS.

Take a look at http://gis.stackexchange.com/a/12119/1872

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


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

2012-05-08 Thread Stefan Keller
Hi fork

On 2012/5/8 fork forkandw...@gmail.com wrote:
 Does anyone know of an exhaustive reference of DE-9IM matrices, with pictures?

I don't think I would call it a reference but take a look
http://labs.geometa.info/postgisterminal/?xapi=node[tourism=zoo] :
There is a menu item Relate exemplified (bool) which displays
parameters as as list of pictures (disregarding of the current query).
Choose the two geometry types and the DE-9IM pattern, then click on
[+] and look at the prerendered pictures.
Pls. give feedback if you have any suggestions.

-S.


 Context:

 I just finished classifying a bunch of polygons based on their relationship to
 enveloping poly's in another layer (census blocks and census city boundaries,
 respectively).  The regular old st_within() and friends weren't enough, so I
 calculated all the DE-9IM's, counted them (yay for GROUP BY and real
 databases!), and made sure I knew what was going on for each of the matrices
 returned (7 total).  Then I classified my block polys based on the strings.

 I found it CRAZY how many different types of DE-9IM's could be returned, even
 with just polygons and very well aligned boundaries (credit to the US Census
 Bureau's geography division).  Only a few of the matrices in my data were
 actually described in the few docs I could find.  Besides the seven in my 
 data,
 there are at least four more that can be generated by various combinations of
 overlapping polygons.

 It would have been much easier to do this project if I had been able to
 reference a list of possibilities along with pictures.  It would be even 
 better
 if I could be confident that such a list was exhaustive.

 Does anyone have a reference?

 If not, I could continue to work on an atlas of DE-9IM matrices, at least for
 polygons, and submit it somewhere if it were helpful.  Any ideas for where 
 that
 might go? (I don't have a blog and don't want to start one).  Maybe just the
 wikipedia entry?

 For those who don't know, a DE-9IM matrix is the output of st_relate(geo1,
 geo2), and there is an excellent intro in the docs.  Fascinating stuff really.

 Tx

 ___
 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] topology performance improvement purpose

2012-05-08 Thread Ben Madin
Do you need to even change the search_path - surely you could have a function 
version with the 'topology' schema hard-coded for the performance improvement. 
Obviously that won't work if you have a different schema name, but if the 
performance enhancement is worth it, grepping out topology to whatever you need 
will also be worth the effort.

cheers

Ben


On 03/05/2012, at 5:58 AM, Jose Carlos Martinez Llario wrote:

 Hi,
 wanted to share a though about improving the topology performance in postgis.
 
 Many of the functions are using EXECUTE instead of running directly select 
 commands.
 In many cases this is need just because of the used of the schema name  of 
 the topology primitive tables.
 
 I found between 4 and 10 times improving performance some sentences. I 
 guessing it could be even better.
 
 My question is if an approach like the following makes sense:
 
 1.- With one command we can make the current topology schema the default 
 schema in search path,
 2.- then working with topology
 3.- Change search_path again when finishing the spatial analysis.
 
 (the parameter of the topology name in the functions should be ignored or 
 removed)
 I know it requires a lot of changes but currently the performance of the 
 persistent topology is too slow.
 
 if one do that many functions can be run without EXECUTE. Spatial analysis 
 between different topologies is not possible which fits the procedure.
 
 What do you think Sandro?
 
 Regards,
 Jose
 
 ___
 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] Size of a multipolygon

2012-05-08 Thread Ben Madin
Thanks Brent, Stephen,

Clearly the answer was much to straightforward for me to find!! I blame a 
poorly constructed question. Thank you.

On 02/05/2012, at 1:06 PM, pcr...@pcreso.com wrote:

  FYI, I was interested in this post, as a PL/R user it may interest you as 
 well?
 
 http://www.spatialdbadvisor.com/postgis_tips_tricks/290/r-based-delaunay-triangulation-function-for-postgis-using-the-deldir-package
  

Nice - I've used Regina's script before a couple of times, but I haven't had to 
worry about three dimensions.

Once to define approximate postcode boundaries for Australia - it's possible to 
obtain a list of postcode points, but Australia Post specifically declines to 
produce a map showing which areas are covered by which postcodes (mainly 
because they are not simply distributed by distance - some people get their 
mail by plane once a week, a live over 1000km from 'their' post-office. But 
they are outliers from an epidemiological perspective.

Also for mobile phone tower coverage - then truncating all the polygons at 35km 
from the centroid.

We now use PL/R almost exclusively for data output (except for interactive 
maps) on web sites - including tables.

cheers

Ben



 
 Cheers,
 
   Brent
 
 
 --- On Wed, 5/2/12, Ben Madin li...@remoteinformation.com.au wrote:
 
 From: Ben Madin li...@remoteinformation.com.au
 Subject: [postgis-users] Size of a multipolygon
 To: PostGIS Users Discussion postgis-users@postgis.refractions.net
 Date: Wednesday, May 2, 2012, 3:26 PM
 
 Hello all,
 
 I'm sure the answer is simple, but I'm lost on what to search on - I need to 
 quickly search through several thousand multi polygons for any which have 
 more than one part making them up. 
 
 What is the best way to do this…? (I've tried array_length(), but don't seem 
 to be able to feed it the right part. I can't believe I can't find a function 
 that does it… or am I looking at dumping the multi polygons into a new table 
 and counting the number of lines for each one...
 
 cheers
 
 Ben
 
 
 ___
 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] DE-9IM question

2012-05-08 Thread Martin Davis

Have a look at:

http://www.vividsolutions.com/jts/tests/index.html

This is a visual interface to the JTS Test Suite, which has a very 
complete collection of DE-9IM cases.  It is meant to be exhaustive - if 
you find something missing, send it in!  It would be interesting to see 
the 7 situations that you found.


The test suite is here:

http://jts-topo-suite.svn.sourceforge.net/viewvc/jts-topo-suite/trunk/jts/testxml/

The validate directory contains the DE-9IM tests.

As was mentioned, you can use the JTS TestBuilder to build and inspect 
test  cases.  You can drag-and-drop Test Suite XML files onto the 
TestBuilder, so it's easy to inspect the cases in the XML tests.


I'm not sure if Wikipedia would appreciate being flooded with DE-9IM 
test cases - it doesn't seem like quite the right place for it.  The 
Vivid site is a good reference as long as it stays up.


On 5/8/2012 8:46 AM, fork wrote:

Does anyone know of an exhaustive reference of DE-9IM matrices, with pictures?

Context:

I just finished classifying a bunch of polygons based on their relationship to
enveloping poly's in another layer (census blocks and census city boundaries,
respectively).  The regular old st_within() and friends weren't enough, so I
calculated all the DE-9IM's, counted them (yay for GROUP BY and real
databases!), and made sure I knew what was going on for each of the matrices
returned (7 total).  Then I classified my block polys based on the strings.

I found it CRAZY how many different types of DE-9IM's could be returned, even
with just polygons and very well aligned boundaries (credit to the US Census
Bureau's geography division).  Only a few of the matrices in my data were
actually described in the few docs I could find.  Besides the seven in my data,
there are at least four more that can be generated by various combinations of
overlapping polygons.

It would have been much easier to do this project if I had been able to
reference a list of possibilities along with pictures.  It would be even better
if I could be confident that such a list was exhaustive.

Does anyone have a reference?

If not, I could continue to work on an atlas of DE-9IM matrices, at least for
polygons, and submit it somewhere if it were helpful.  Any ideas for where that
might go? (I don't have a blog and don't want to start one).  Maybe just the
wikipedia entry?

For those who don't know, a DE-9IM matrix is the output of st_relate(geo1,
geo2), and there is an excellent intro in the docs.  Fascinating stuff really.

Tx

___
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: 2425/4985 - Release Date: 05/08/12



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