Re: [postgis-users] error in online PostGIS docs?

2010-07-27 Thread Olivier Courtin


On Jul 27, 2010, at 7:33 PM, Rick wrote:

Hi Rick,


This refers to the documentation whose main page is : 
http://postgis.refractions.net/docs/index.html

I've been experimenting with getting geometry in different formats.

On this page: http://postgis.refractions.net/docs/ST_AsGeoJSON.html  
it is possible to get a dictionary like object that includes an  
object bounding box.  I like this.


However I am not getting the results set out in the doc.  Unless I'm  
missing something, either the function is wrong, or the docs are  
wrong.


We are discussing the fourth parameter in the call ST_AsGeoJSON()   
The documentation says that if 1 is set, a bbox is returned, it is  
not.  a bbox is included if 2 is set.  Other option values appear to  
have no effect.  (see docs)



The first ST_GeoJSON implementation came with 1.3.4

The four parameter option slightly changes since 1.4.0 (with bbox set  
to 1)

as you mention if.
Do you refer to the right doc version ?

SELECT postgis_full_version();
To get PosTGIS version...

ST_AsGeoJSON doc from 1.3 branch
http://postgis.refractions.net/documentation/manual-1.3/ch06.html#id2577428

ST_AsGeoJSON doc from 1.4 branch
http://postgis.refractions.net/documentation/manual-1.4/ST_AsGeoJSON.html


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


[postgis-users] error in online PostGIS docs?

2010-07-27 Thread Rick
This refers to the documentation whose main page is :
http://postgis.refractions.net/docs/index.html

I've been experimenting with getting geometry in different formats.

On this page: http://postgis.refractions.net/docs/ST_AsGeoJSON.html it is
possible to get a dictionary like object that includes an object bounding
box.  I like this.

However I am not getting the results set out in the doc.  Unless I'm missing
something, either the function is wrong, or the docs are wrong.

We are discussing the fourth parameter in the call ST_AsGeoJSON()  The
documentation says that if 1 is set, a bbox is returned, it is not.  a bbox
is included if 2 is set.  Other option values appear to have no effect.
(see docs)

---

case where options = 1

*euclid=# SELECT id, etype, ST_AsGeoJSON( 1, the_geom, 1, 1 ) FROM
gis_geometry WHERE id = 1571;
  id  |  etype
|
st_asgeojson

--+--+--
 1571 | polyline |
{"type":"MultiLineString","coordinates":[[[153.9,883.2],[246.6,812.8],[247.3,807.4],[243.5,801.7],[227.0,776.8],[225.9,771.4],[226.6,766.1],[238.1,711.7],[238.9,707.1],[241.2,702.1],[244.6,695.6],[246.9,692.2],[251.5,688.7],[546.5,472.7]]]}
*

case where options = 2

*euclid=# SELECT id, etype, ST_AsGeoJSON( 1, the_geom, 1, 2 ) FROM
gis_geometry WHERE id = 1571;

  id  |  etype
|
st_asgeojson

--+--+---
 1571 | polyline |
{"type":"MultiLineString","bbox":[153.9,472.7,546.5,883.2],"coordinates":[[[153.9,883.2],[246.6,812.8],[247.3,807.4],[243.5,801.7],[227.0,776.8],[225.9,771.4],[226.6,766.1],[238.1,711.7],[238.9,707.1],[241.2,702.1],[244.6,695.6],[246.9,692.2],[251.5,688.7],[546.5,472.7]]]}
(1 row)
*


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


[postgis-users] [WKT Raster] ST_SetValue

2010-07-27 Thread Paragon Corporation
Pierre,

We haven't had a chance to test ST_SetValue, but its on our todo.

By the way -- the latest windows builds with it are up on the experimental
for those who want to try it.

http://www.postgis.org/download/windows/experimental.php

Based on your naming, it sounds like the geometry value for the geometry
version, only takes a point.

We were thinking it would be really nice if it could take any kind of
geometry and color in any pixel that intersects the geometry.

That way you can do things like make statistical maps right in PostGIS like
a heatmap.  Not sure if that was along the lines of what George was thinking
as well.

I know it then doesn't quite follow the ST_Value pattern, but I think for
this case, its understandable to do it that way.

Just a thought and maybe you thought of it already.

Thanks,
Regina and Leo
http://www.postgis.us





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


Re: [postgis-users] WKTRaster : gdal2wktraster.py cannot read AIG/Arc/Info Binary Grid

2010-07-27 Thread Pierre Racine
BTW Peter,

in your site 
(http://kahlua.eecs.jacobs-university.de/trac/rasdaman/wiki/WhyRasdaman) you 
say: "First and foremost, it (PostGIS WKT Raster) does not support tiling 
(partitioning) of raster arrays." This statement is false since WKT Raster 
actually does support tiling of large rasters. You can partition any raster 
coverage by importing it as separate tiles or by using the -k option of 
gdal2wktraster.py. Each tile become a separate row in the table and the whole 
table is the coverage. The table is spatially indexed using the PostgreSQL GiST 
index.

I think it would be just fair if you could rectify this statement.

Thanks,

Pierre

From: Peter Baumann [mailto:p.baum...@jacobs-university.de]
Sent: 21 juillet 2010 17:28
To: Pierre Racine
Cc: PostGIS Users Discussion
Subject: Re: [postgis-users] WKTRaster : gdal2wktraster.py cannot read 
AIG/Arc/Info Binary Grid

Pierre-

rasdaman per se is domain agnostic - you can just as well maintain human brain 
images (as we did). The petascope layer, which is part of the distro, adds geo 
semantics by providing OGC interfaces.
PostgreSQL integration is not yet done, we are working on this; same for GDAL / 
MapServer.

-Peter


On 07/21/2010 08:29 PM, Pierre Racine wrote:
Peter,

Are rasters in rasdaman georeferenced? How do I convert my vectorial PostGIS 
points coordinates into rasdaman coordinates? Do I have to do all the math 
myself?

Pierre

From: Peter Baumann [mailto:p.baum...@jacobs-university.de]
Sent: 21 juillet 2010 04:41
To: Pierre Racine
Subject: Re: [postgis-users] WKTRaster : gdal2wktraster.py cannot read 
AIG/Arc/Info Binary Grid

Pierre-

let's see. First, I would not store 100k raster points in the relational table 
as its terribly inefficient. We do have input data formats, though, which are 
similar to what a PG dump of such a table would deliver. We import this into an 
array and then can query it. Import via rasql or through an import tool which 
internally generates rasql calls.

Then, for corner points (x0,y0) and (x1,y1) we retrieve as

select png( M[x0:y1,y0:y1] ) from MyMap as M

...in PNG format via the rasql cmd line utility or the C++ or Java API.

Alternatively, sending this this query over the API gets you the data into main 
memory ready for nested for loops = in the main memory format of your client:

select M[x0:y1,y0:y1] from MyMap as M

-Peter



On 07/20/2010 10:03 PM, Pierre Racine wrote:
So if I already have a table of,  say 100 000 points, uploaded in PostGIS, how 
do I use rasdaman to get the raster values of the pixels located under the 
points?

Pierre

From: Peter Baumann [mailto:p.baum...@jacobs-university.de]
Sent: 20 juillet 2010 12:08
To: PostGIS Users Discussion
Cc: Pierre Racine
Subject: Re: [postgis-users] WKTRaster : gdal2wktraster.py cannot read 
AIG/Arc/Info Binary Grid

On 07/20/2010 05:47 PM, Pierre Racine wrote:
Since we have this bug with big rasters,

proven, any-size, ... ;-)

Who is proven? Well, running a dozen-TB seamless mosaic on PostgreSQL for many 
years, having online-demos available since years, etc... you decide, in 
comparison.

-Peter





I would suggest you split your raster with something like GDAL gdal_retile.py 
and then import your tiles into a single WKT Raster table following the 
instruction provided in our tutorial. Each tile will be stored in a column cell 
of type RASTER similar to the PostGIS GEOMETRY type.

As I said previously you can then query the raster in SQL like this:

SELECT ST_Value(rast, ST_Geomfromtext('Point(-78.1 58.1)', 4326))
FROM srtm_tiled_100x100
WHERE ST_Intersects(rast::geometry, ST_Geomfromtext('Point(-78.1 58.1)', 4326)) 
AND whatever you want.

Basically WKT Raster is the first true SQL interface with which is is simple to 
do such things... It's proven, any-size, cloud-scalable, and open source :) 
Maybe not that prooven. But who is?

There is also rasdaman but I don't think you can use SQL. It would be nice if 
you could compare both... I can't find time for this. Jorge has started 
comparing PostGIS WKT Raster with Oracle Georaster though.

Pierre


From: 
postgis-users-boun...@postgis.refractions.net
 [mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Sebastian 
E. Ovide
Sent: 20 juillet 2010 10:46
To: PostGIS Users Discussion
Subject: Re: [postgis-users] WKTRaster : gdal2wktraster.py cannot read 
AIG/Arc/Info Binary Grid

yes... with png worked... but it was a different png (a smaller one)...

so I've converted the ESRI into a png and tried to import it... and it didn't 
work neither...

so this is the situation:
A have huge rusters (from 150kx150k).. In Oracle I would just load it (the huge 
raster) in a single row of a GeoRaster table and then Oracle GeoRaster would 
split it in small tiles and store one tile per line of another table (Raster 
Data Table)... then I can run a query similar to this one: SELECT 
getcellvalue(t.rastercolumn,x,y) from GeoRasterTab

Re: [postgis-users] Union fails on 2389 linestrings.

2010-07-27 Thread Jeff Adams
The challenge is I don't know the exact point it is unhappy about.  If
I check the one in the error message, none of my linestrings intersect
it, which means it is probably being printed with insufficient
precision.  I have 19 linestrings that have a point that could be
printed as -118.296 34.1185 due to rounding.

Also, the two linestrings printed in the error aren't real inputs,
they must be something created internally by ST_Union as it is
processing.

I tried adding a ST_SnapToGrid(..., 0.1)  (0.1 is very roughly
a meter in lat/lon) and it has been running for almost 40 minutes, so
it is either slower than before or it has made it further than before
:-).

Jeff

On Tue, Jul 27, 2010 at 10:27 AM, Nicolas Ribot  wrote:
>> ST_IsValid returns true for all of them.  I'll try reducing the
>> precision slightly, though I'm later going to do point-in-poly checks
>> against some other original input data and the reduced precision will
>> increase the chances of inaccurate results.
>>
>
> Ok,
> I'm wondering if using the notice message could be used in conjunction
> with linear referencing functions to add the missing point to the
> failing linestring(s):
>
> 1- identify failing linestrings (or offending coordinates, then
> finding the closest linestring to this point)
> 2- complete these linestrings with new points built from coordinates
> 3- relaunch the union procedure.
>
> Though I've never done this.
>
> Nicolas
> ___
> 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] Union fails on 2389 linestrings.

2010-07-27 Thread Nicolas Ribot
> ST_IsValid returns true for all of them.  I'll try reducing the
> precision slightly, though I'm later going to do point-in-poly checks
> against some other original input data and the reduced precision will
> increase the chances of inaccurate results.
>

Ok,
I'm wondering if using the notice message could be used in conjunction
with linear referencing functions to add the missing point to the
failing linestring(s):

1- identify failing linestrings (or offending coordinates, then
finding the closest linestring to this point)
2- complete these linestrings with new points built from coordinates
3- relaunch the union procedure.

Though I've never done this.

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


Re: [postgis-users] Union fails on 2389 linestrings.

2010-07-27 Thread Jeff Adams
ST_IsValid returns true for all of them.  I'll try reducing the
precision slightly, though I'm later going to do point-in-poly checks
against some other original input data and the reduced precision will
increase the chances of inaccurate results.

Thanks,
Jeff

On Tue, Jul 27, 2010 at 10:13 AM, Nicolas Ribot  wrote:
>> I have a layer with 2389 linestrings which intersect a lot.  I'm
>> trying to create a polygon overlay, so I want to union the linestrings
>> together so I can then call polygonize.
>>
>> However, when I try to union them, it runs for about 25 minutes then
>> fails claiming it found a non-noded intersection between two lines
>> that appear identical and 0-length (though it may be the precision is
>> lost when printing the WKT in the error message).
>>
>>        create table noded_lines as
>>        select ST_Union(boundary) as noded_boundary from boundary_lines;
>>
>> NOTICE:  TopologyException: found non-noded intersection between
>> LINESTRING (-118.296 34.1185, -118.296 34.1185) and LINESTRING
>> (-118.296 34.1185, -118.296 34.1185) at -118.296 34.1185
>>
>>
>> ERROR:  GEOS union() threw an error!
>>
>> Anyone know how I could get around this?
>>
>
> Hi,
> Are all your linestrings valid ?
> Could you reduce coordinate precision with st_snapToGrid ?
>
> Nicolas
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>



-- 
Jeff Adams
Azavea (formerly Avencia)  |  T: 215.701.7717  |  F: 215.925.2663
www.azavea.com
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Union fails on 2389 linestrings.

2010-07-27 Thread Nicolas Ribot
> I have a layer with 2389 linestrings which intersect a lot.  I'm
> trying to create a polygon overlay, so I want to union the linestrings
> together so I can then call polygonize.
>
> However, when I try to union them, it runs for about 25 minutes then
> fails claiming it found a non-noded intersection between two lines
> that appear identical and 0-length (though it may be the precision is
> lost when printing the WKT in the error message).
>
>        create table noded_lines as
>        select ST_Union(boundary) as noded_boundary from boundary_lines;
>
> NOTICE:  TopologyException: found non-noded intersection between
> LINESTRING (-118.296 34.1185, -118.296 34.1185) and LINESTRING
> (-118.296 34.1185, -118.296 34.1185) at -118.296 34.1185
>
>
> ERROR:  GEOS union() threw an error!
>
> Anyone know how I could get around this?
>

Hi,
Are all your linestrings valid ?
Could you reduce coordinate precision with st_snapToGrid ?

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


[postgis-users] Union fails on 2389 linestrings.

2010-07-27 Thread Jeff Adams
I have a layer with 2389 linestrings which intersect a lot.  I'm
trying to create a polygon overlay, so I want to union the linestrings
together so I can then call polygonize.

However, when I try to union them, it runs for about 25 minutes then
fails claiming it found a non-noded intersection between two lines
that appear identical and 0-length (though it may be the precision is
lost when printing the WKT in the error message).

create table noded_lines as
select ST_Union(boundary) as noded_boundary from boundary_lines;

NOTICE:  TopologyException: found non-noded intersection between
LINESTRING (-118.296 34.1185, -118.296 34.1185) and LINESTRING
(-118.296 34.1185, -118.296 34.1185) at -118.296 34.1185


ERROR:  GEOS union() threw an error!

Anyone know how I could get around this?

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


Re: [postgis-users] Fwd: constraint violation : enforce_geotype_the_geom

2010-07-27 Thread Guillaume LONGUETAUD
Thank you folks,

I realized my bati.the_geom is indeed a multipolygon, whereas
buffer.the_geom is a polygon type.

So I just set MULTIPOLYGON in my AddGeometryColumn subrequest, and it worked
fine !

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


Re: [postgis-users] Fwd: constraint violation : enforce_geotype_the_geom

2010-07-27 Thread Nicolas Ribot
>
> Hello, there
>
> I'm quite new to postgis requests and I've got a constraint violation
> problem with one of my requests:
>
> create table bati_buff (id serial primary key);
>
> select addgeometrycolumn ('bati_buff', 'the_geom', 27572, 'POLYGON', 2 ) ;
>
> insert into bati_buff (the_geom)
>
> (select bati.the_geom from bati, buffer where intersects (bati.the_geom,
> buffer.the_geom) =true ) ;
>
> I have a constraint violation with the relation enforce_geotype_the_geom.
>
> How can I solve it ?
>
> Thanks
> --
> Guillaume Longuetaud
>

Hi,

This indicates the return of the subselect is not a POLYGON.
What is the geometric type of the bati.the_geom table ? (could it be
MULTIPOLYGON, maybe coming from a shp2pgsql command ?)

Having constraints is good in the sense it guarantees a unique
geometric type to be stored in the table, thus avoiding later errors
when calling functions that support only one type.

If the subselect geometry type is a multipolygon with one object, you
can extract the polygon from the collection with st_geometryN(geom,
1).

If you want to store multiple types into the column, you can also drop
the constraint on the table.

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


Re: [postgis-users] Fwd: constraint violation : enforce_geotype_the_geom

2010-07-27 Thread Agustin Ignacio Genoves
You must check if the geometry is not null and the type is POLYGON

2010/7/27 Guillaume LONGUETAUD :
>
> Hello, there
>
> I'm quite new to postgis requests and I've got a constraint violation
> problem with one of my requests:
>
> create table bati_buff (id serial primary key);
>
> select addgeometrycolumn ('bati_buff', 'the_geom', 27572, 'POLYGON', 2 ) ;
>
> insert into bati_buff (the_geom)
>
> (select bati.the_geom from bati, buffer where intersects (bati.the_geom,
> buffer.the_geom) =true ) ;
>
> I have a constraint violation with the relation enforce_geotype_the_geom.
>
> How can I solve it ?
>
> Thanks
> --
> Guillaume Longuetaud
>
> ___
> 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] Fwd: constraint violation : enforce_geotype_the_geom

2010-07-27 Thread Guillaume LONGUETAUD
Hello, there

I'm quite new to postgis requests and I've got a constraint violation
problem with one of my requests:

create table bati_buff (id serial primary key);

select addgeometrycolumn ('bati_buff', 'the_geom', 27572, 'POLYGON', 2 ) ;

insert into bati_buff (the_geom)

(select bati.the_geom from bati, buffer where intersects (bati.the_geom,
buffer.the_geom) =true ) ;


I have a constraint violation with the relation enforce_geotype_the_geom.

How can I solve it ?

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


Re: [postgis-users] FME and Postgis-SVN problems

2010-07-27 Thread Andreas Neumann
Hi Marc,

This is very useful info.

Yes, I am using PostgreSQL 9.0 and yes, setting bytea_output = escape
fixed the connection problems with FME.

I'll pass this information on to Safe software if they aren't yet aware
about the problem.

Thanks a lot for the immediate and very useful answer!
Andreas


On Tue, July 27, 2010 1:14 pm, Mark Cave-Ayland wrote:
> Andreas Neumann wrote:
>
>> Hi all,
>>
>> I recently installed Postgis-SVN (1.5.2SVN) together with PostgreSQL 9.0
>> beta 3 and noticed that FME (from Safe software) cannot read the
>> geometries anymore. It used to work fine with older versions.
>>
>> The error message I get reads as follows:
>>
>> "Error in the OGR while importing well known binary geometry
>> Invalid WKB encountered"
>>
>> I wonder if other users of Postgis SVN and FME are getting similar
>> problems?
>
> Hi Andreas,
>
> If you're using PostgreSQL 9.0, you're probably getting affected by
> this: http://trac.osgeo.org/postgis/ticket/538.
>
> In short, it seems that various applications don't use the official
> PostgreSQL libpq unescape functions but instead implement their own -
> and since the default representation has changed, the parsing code needs
> to be updated. Note that you can change the default using the
> bytea_output GUC in postgresql.conf if updating the software proves to
> be impossible.
>
>
> HTH,
>
> Mark.
>
> --
> Mark Cave-Ayland - Senior Technical Architect
> PostgreSQL - PostGIS
> Sirius Corporation plc - control through freedom
> http://www.siriusit.co.uk
> t: +44 870 608 0063
>
> Sirius Labs: http://www.siriusit.co.uk/labs
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>


-- 
Andreas Neumann
http://www.carto.net/neumann/
http://www.svgopen.org/

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


Re: [postgis-users] FME and Postgis-SVN problems

2010-07-27 Thread Mark Cave-Ayland

Andreas Neumann wrote:


Hi all,

I recently installed Postgis-SVN (1.5.2SVN) together with PostgreSQL 9.0
beta 3 and noticed that FME (from Safe software) cannot read the
geometries anymore. It used to work fine with older versions.

The error message I get reads as follows:

"Error in the OGR while importing well known binary geometry
Invalid WKB encountered"

I wonder if other users of Postgis SVN and FME are getting similar problems?


Hi Andreas,

If you're using PostgreSQL 9.0, you're probably getting affected by 
this: http://trac.osgeo.org/postgis/ticket/538.


In short, it seems that various applications don't use the official 
PostgreSQL libpq unescape functions but instead implement their own - 
and since the default representation has changed, the parsing code needs 
to be updated. Note that you can change the default using the 
bytea_output GUC in postgresql.conf if updating the software proves to 
be impossible.



HTH,

Mark.

--
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] FME and Postgis-SVN problems

2010-07-27 Thread Andreas Neumann
Hi all,

I recently installed Postgis-SVN (1.5.2SVN) together with PostgreSQL 9.0
beta 3 and noticed that FME (from Safe software) cannot read the
geometries anymore. It used to work fine with older versions.

The error message I get reads as follows:

"Error in the OGR while importing well known binary geometry
Invalid WKB encountered"

I wonder if other users of Postgis SVN and FME are getting similar problems?

Thanks,
Andreas

-- 
Andreas Neumann
http://www.carto.net/neumann/
http://www.svgopen.org/

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


Re: [postgis-users] Snapped polygon

2010-07-27 Thread nguyen liem
Hi Fabio,

I had a small test with your data. I split your data to 2 tables: blocks(big
polygon) and building(small polygon) table.
Please see the attached file for more details.

The environment is:
"PostgreSQL 8.3.5 on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC)
4.1.2 20070115 (prerelease) (SUSE Linux)"

I have some green comments bellow:

Cheers.

On Tue, Jul 20, 2010 at 9:59 PM, Fabio Renzo Panettieri <
fpanetti...@xoomcode.com> wrote:

> Hi.
> I'm, having a problem with some geometries.
> I have buildings and blocks represented by polygons, and I have to check
> if buildings are contained in blocks.
>
> The problem is that buildings that are snapped to blocks sides, aren't
> considered inside the block.
>
> These are the validations that I've used so far.
>
> ST_Covers(block, building) => false

ST_Covers(geometry geomA, geometry geomB); Returns 1 (TRUE) if no point
in Geometry B is outside Geometry A


> ST_Contains(block, building) => false
>
ST_Contains(geometry geomA, geometry geomB); Returns true if and only if
no points of B lie in the exterior of A, and at least one point of the
interior of B lies in the interior of A.


> ST_Coveredby(building, block) => false
>
ST_CoveredBy(geometry geomA, geometry geomB); Returns 1 (TRUE) if no
point in Geometry/Geography A is outside Geometry/Geography B


> ST_Within(building, block) => false
>
ST_Within(geometry A, geometry B); Returns true if the geometry A is
completely inside geometry B

>
>
> The following validations are the ones that confuses me.
>
> ST_Covers(ST_intersection(block, building), building) => true
>
=> false - plz see the explanation in the attached file

> ST_Intersection(block, building) = building => true
>
=>  true: because "=" operator is a little more naive, it only tests
whether the bounding boxes of two geometries are the same

> ST_isEmpty(ST_Difference(building, block)) => true
> => false - plz see the explanation in the attached file



> For what I've read, here
>
> http://lin-ear-th-inking.blogspot.com/2007/06/subtleties-of-ogc-covers-spatial.html
> "Geometry A covers Geometry B if no points of B lie in the exterior of
> A"
> Covers should return true.
>
> The environment is:
> SELECT version(); => "PostgreSQL 8.4.4 on x86_64-pc-linux-gnu, compiled
> by GCC gcc-4.3.real (Debian 4.3.2-1.1) 4.3.2, 64-bit"
>
> SELECT postgis_version(); => "1.5 USE_GEOS=1 USE_PROJ=1 USE_STATS=1"
>
> I've attached two geometries that you can use to check if I'm doing
> something wrong.
>
> Thanks for your time.
> --
> Fabio R. Panettieri
> Software Architect
> http://www.xoomcode.com
>
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>


-- 
*Liem Nguyen (DBA)

AXON ACTIVE VIETNAM*
*www.axonactive.vn***

10th Floor, Hai Au Building, 39B Truong Son, Ward 4, Tan Binh District, Ho
Chi Minh City, Vietnam
T +84 8 629 738 59, F +84 8 381 134 89, M +84 168 994 8897
*8897 +10° 48' 32.72", +106° 39' 51.58"*


snapped_polygon.sql
Description: Binary data
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users