[postgis-users] [mtncl...@gmail.com: Fwd: Self-intersecting polygon gives ST_IsSimple=true]

2017-05-10 Thread Sandro Santilli
- Forwarded message from Martin Davis  -

Date: Wed, 10 May 2017 10:13:49 -0700
From: Martin Davis 
To: Sandro Santilli 
Subject: Fwd: [postgis-users] Self-intersecting polygon gives ST_IsSimple=true
In-Reply-To: 

Re: [postgis-users] Applying a formula to more than two Raster Layers

2017-05-10 Thread David Haynes
You can use the map algebra function combined with Common Table expressions.


On Tue, May 9, 2017 at 4:20 AM, David Westcott <
david.westc...@uk.rsagroup.com> wrote:

> Dear Post GIS Users
>
>
>
> Is there a way in PostGIS of applying a formula to more than two Raster
> layers?
>
>
>
> For example, I want to derive a new Raster Layer calculated as follows:
>
>
>
> Constant1 x Layer1 x (Layer2 ^ Constant2) + Constant3 x Layer3 x (Layer4 ^
> Constant4) + Constant5 x Layer5 x (Layer6 ^ Constant6)
>
>
>
> Where  Constant1, Constant2, Constant3, Constant4, Constant5 & Constant6
> are fixed constants.
>
> Layer1, Layer2, Layer3, Layer4, Layer5 & Layer6 are
> already derived Raster Layers.
>
> The ‘^’ sign represents raised to the power of. (i.e. 3^2
> = 9).
>
>
>
> How would I apply such a formula in PostGIS?
>
>
>
> Kind Regards
>
>
>
> David Westcott
>
>
>
> Please consider the environment before printing this email. RSA are proud
> to be a responsible business - www.rsagroup.com/corporate-responsibility
>
> 
> 
> *
> Royal & Sun Alliance Insurance plc (No. 93792). Registered in England &
> Wales at St. Mark's Court, Chart Way, Horsham, West Sussex, RH12 1XL.
>
> Authorised by the Prudential Regulation Authority and regulated by the
> Financial Conduct Authority and the Prudential Regulation Authority.
> For your protection, telephone calls may be recorded and monitored.
> The information in this e-mail is confidential and may be read, copied or
> used only by the intended recipients. If you have received it in error
> please contact the
> sender immediately by returning the e-mail. Please delete the e-mail and
> do not disclose any of its contents to anyone.
> No responsibility is accepted for loss or damage arising from viruses or
> changes made to this message after it was sent.
> 
> 
> *
>
> ___
> postgis-users mailing list
> postgis-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
>
___
postgis-users mailing list
postgis-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/postgis-users

Re: [postgis-users] PostGIS Rasters Overview Factor

2017-05-10 Thread David Haynes
You are correct overviews are powers based. Also it does not look like you
specified tile size in your raster2pgsql statement


raster2pgsql -s  -d -Y -e -I -C -F -M -t  x  -l
2,4,8,16,32

On Wed, May 10, 2017 at 11:04 AM, Osahon Oduware 
wrote:

> Hi All,
>
> I tried loading a raster with overviews using the raster2pgsql tool using
> the syntax below:
>
> raster2pgsql -s  -d -Y -e -I -C -F -M -l 2,4,8,16,32,64,128,256,512,
> 1024,2048,4096,8192,16384,32768,65536 /path/to/raster/file  |
> psql -h  -U postgres -p 5432 -d 
>
> but it gave an error message stating that the overview factor cannot be
> more than 1,000.
>
> I would like to know how the Overview-factor works. Must the value for the
> Overview-factor be in Powers of 2 (i.e. 2,4,8,16,...)?
>
> I would be glad if someone could help my understanding.
>
> ___
> postgis-users mailing list
> postgis-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
>
___
postgis-users mailing list
postgis-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/postgis-users

[postgis-users] PostGIS Rasters Overview Factor

2017-05-10 Thread Osahon Oduware
Hi All,

I tried loading a raster with overviews using the raster2pgsql tool using
the syntax below:

raster2pgsql -s  -d -Y -e -I -C -F -M -l
2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536
/path/to/raster/file  | psql -h  -U postgres -p
5432 -d 

but it gave an error message stating that the overview factor cannot be
more than 1,000.

I would like to know how the Overview-factor works. Must the value for the
Overview-factor be in Powers of 2 (i.e. 2,4,8,16,...)?

I would be glad if someone could help my understanding.
___
postgis-users mailing list
postgis-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/postgis-users

Re: [postgis-users] Self-intersecting polygon gives ST_IsSimple=true

2017-05-10 Thread Sandro Santilli
On Mon, May 08, 2017 at 08:49:24PM +0300, Jukka Rahkonen wrote:
> Jukka Rahkonen kirjoitti 2017-05-08 17:33:
> >Jukka Rahkonen kirjoitti 2017-05-08 15:48:
> 
> >I can still find the same comments about polygon validity in
> >https://github.com/locationtech/jts/blob/master/modules/core/src/main/java/org/locationtech/jts/operation/IsSimpleOp.java
> >beginning from line 205
> >
> > /**
> >   * Computes simplicity for polygonal geometries.
> >   * Polygonal geometries are simple if and only if
> >   * all of their component rings are simple.
> >   *
> >   * @param geom a Polygonal geometry
> >   * @return true if the geometry is simple
> >   */
> >
> 
> 
> I was remembering that JTS list is a bit slow with answers so I compiled JTS
> from master https://github.com/locationtech/jts.
> IsSimple with POLYGON ((320 620, 460 620, 460 500, 320 620, 320 500, 180
> 500, 180 620, 320 620)) gives false so JTS and GEOS have different behavior.
> 
> I am new with PostGIS project, do the developers consider this as a bug and
> do you want me to file an issue? If yes, would it be a GEOS bug
> https://trac.osgeo.org/geos/newticket?

Yes please, it'd be a GEOS bug but it's also useful to file it as a
PostGIS bug (in case there's any shortcircuit there).

--strk;
___
postgis-users mailing list
postgis-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/postgis-users

Re: [postgis-users] Self-intersecting polygon gives ST_IsSimple=true

2017-05-10 Thread Sandro Santilli
On Mon, May 08, 2017 at 03:48:01PM +0300, Jukka Rahkonen wrote:
> 
> Ok, it was defined in JTS 1.13 
> http://javadox.com/com.vividsolutions/jts/1.13/com/vividsolutions/jts/geom/Geometry.html#isSimple()
> 
> "Valid polygonal geometries are simple, since their rings must not
> self-intersect. isSimple tests for this condition and reports false if it is
> not met. (This is a looser test than checking for validity)."
> 
> And now in JTS 1.15 it is
> 
> "Polygonal geometries are simple by definition, so isSimple trivially
> returns true. (Note: this means that isSimple cannot be used to test for
> (invalid) self-intersections in Polygons. In order to check if a Polygonal
> geometry has self-intersections, use Geometry.isValid())."
> 
> I believe that there is some good reason for this change but doesn't it put
> too much responsibility for the user to know not to test polygons with
> IsSimple? Why does it accept polygon as input at all?

This is a good question, I'm adding Martin Davis to the recipients
list in case he has pointers to rationale for both the change and
the acceptance (JTS does have an IllegalArgumentException too..)

--strk;
___
postgis-users mailing list
postgis-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/postgis-users