Re: [postgis-users] lat,lon or lon,lat in WGS84 WKT

2015-11-17 Thread Andy Anderson
This OGC document:

http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#41

says:

7.5.5Axis order

Axis is repeated in a sequence. The number of axes in the sequence is the same 
as the dimensions of the coordinate system.

 identifies the order in which the coordinates of a point in a 
dataset are given and therefore is significant. In this International Standard 
it is defined in the BNF as an optional attribute to allow backward 
compatibility with OGC 01-009, however it is recommended that it should be 
explicitly included in a CRS WKT string.

Requirement:The following constraints shall apply:
• For coordinate systems with more than one axis, either every axis description
 shall include an  or none of the axes descriptions shall include an 
.
 If  is included a sequence value shall not be repeated.
• When  is present in the WKT string the  descriptions shall 
be ordered
  according to the axis order sequence.
• If  is omitted from the WKT string the sequence of  
descriptions
  shall imply the order of the axes and of coordinates referenced to the CRS.

and gives these three examples of geographic coordinate systems, all of which 
place latitude before longitude:

   GEODCRS[“WGS 84”,
 DATUM[“World Geodetic System 1984”,
   ELLIPSOID[“WGS 84”,6378137,298.257223563,
 LENGTHUNIT[“metre”,1.0]]],
 CS[ellipsoidal,3],
   AXIS["(lat)“,north,ANGLEUNIT[”degree",0.0174532925199433]],
   AXIS["(lon)“,east,ANGLEUNIT[”degree",0.0174532925199433]],
   AXIS[“ellipsoidal height (h)”,up,LENGTHUNIT[“metre”,1.0]]]

GEODCRS[“NAD83”,
 DATUM[“North American Datum 1983”,
   ELLIPSOID[“GRS 1980”,6378137,298.257222101,LENGTHUNIT[“metre”,1.0]]],
 CS[ellipsoidal,2],
   AXIS[“latitude”,north],
   AXIS[“longitude”,east],
   ANGLEUNIT[“degree”,0.017453292519943],
 ID[“EPSG”,4269],
 REMARK[“1986 realisation”]]

GEODCRS[“NTF (Paris)”,
 DATUM[“Nouvelle Triangulation Francaise”,
   ELLIPSOID[“Clarke 1880 (IGN)”,6378249.2,293.4660213]],
 PRIMEM[“Paris”,2.5969213],
 CS[ellipsoidal,2],
   AXIS[“latitude”,north,ORDER[1]],
   AXIS[“longitude”,east,ORDER[2]],
   ANGLEUNIT[“grad”,0.015707963267949],
 REMARK[“Nouvelle Triangulation Française”]]

PostGIS should use this information to understand the data in your polygon 
representation. Is your polygon defined correctly given some particular GCS, or 
was it generated incorrectly and its too much trouble to regenerate it? In the 
latter case perhaps you could define your own GCS that simply reverses the 
order. In either case, apply ST_Transform?

http://postgis.net/docs/ST_Transform.html

— Andy

On Nov 17, 2015, at 10:09 AM, Willy-Bas Loos 
> wrote:

Hi,

I have a couple of questions about the order of lattitude and longitude in WKT 
representations of geometries:

  1.  Is there an objective reference that states in what order WGS84 
(geographic) coordinates should be represented in a WKT? Is it lon, lat 
(because of x,y) or lat,lon (because it's geodetic) ?
  2.  Does postgis use the correct representation?
  3.  Is there a way to switch lat and lon for a polygon when representing as 
WKT? All i think of is looping through all points, switching x and y and then 
returning astext(g)

Cheers,

--
Willy-Bas Loos
___
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/postgis-users

___
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/postgis-users

[postgis-users] lat,lon or lon,lat in WGS84 WKT

2015-11-17 Thread Willy-Bas Loos
Hi,

I have a couple of questions about the order of lattitude and longitude in
WKT representations of geometries:

   1. Is there an objective reference that states in what order WGS84
   (geographic) coordinates should be represented in a WKT? Is it lon, lat
   (because of x,y) or lat,lon (because it's geodetic) ?
   2. Does postgis use the correct representation?
   3. Is there a way to switch lat and lon for a polygon when representing
   as WKT? All i think of is looping through all points, switching x and y and
   then returning astext(g)

Cheers,

-- 
Willy-Bas Loos
___
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/postgis-users

[postgis-users] Raster calculation on 3d raster (stack)

2015-11-17 Thread David Haynes
Hello,

I have a mulibanded raster and I am wondering if I can apply any of the
raster processing functions (min, max, mean, stdev) to multibanded rasters.
Specifically, I am wondering if these functions will be able to applied to
the z-axis.

Here is an example, I have worked up in python starting with two 2d arrays.
x = [[1,4,5,6], [3,5,6,2]]
z = [[2,7,8,9], [8,3,5,9]]
convert to np.array
y = np.dstack((np.array(x), np.array(z)))
>>> y.sum(2)
array([[ 3, 11, 13, 15],
   [11,  8, 11, 11]])

I want to apply the raster processing functions to the z-axis and I am
wondering if I can do it in PostGIS? It seems like the mapalgebra call back
functions could do this, but I am having difficulty finding an example.
___
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/postgis-users

Re: [postgis-users] lat,lon or lon,lat in WGS84 WKT

2015-11-17 Thread Nicolas Ribot
Hi,

To reverse geometry coordinates, use ST_FlipCoordinates or ST_SwapOrdinates

Nicolas

On 17 November 2015 at 18:08, Paul Ramsey  wrote:

> We Leave It To You, in that the ordering in the WKT will be reflective
> of the ordering you've stored your data in.
> However.
> If you want to reproject or do any other Nice Things with your data,
> store it in X/Y order. Otherwise you'll need a special spatial_ref_sys
> entry for your data that indicates the axis ordering you've chosen,
> using the +axis proj4 argument.
>
> http://gis.stackexchange.com/questions/6221/how-can-i-specify-a-proj-4-projection-with-the-north-pointing-down
> By default we assume data in SRID 4326 (and other spherical systems)
> are X/Y ordered.
> P
>
>
> On Tue, Nov 17, 2015 at 7:09 AM, Willy-Bas Loos 
> wrote:
> > Hi,
> >
> > I have a couple of questions about the order of lattitude and longitude
> in
> > WKT representations of geometries:
> >
> > Is there an objective reference that states in what order WGS84
> (geographic)
> > coordinates should be represented in a WKT? Is it lon, lat (because of
> x,y)
> > or lat,lon (because it's geodetic) ?
> > Does postgis use the correct representation?
> > Is there a way to switch lat and lon for a polygon when representing as
> WKT?
> > All i think of is looping through all points, switching x and y and then
> > returning astext(g)
> >
> > Cheers,
> >
> > --
> > Willy-Bas Loos
> >
> > ___
> > postgis-users mailing list
> > postgis-users@lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/postgis-users
> ___
> postgis-users mailing list
> postgis-users@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/postgis-users
>
___
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/postgis-users

[postgis-users] compatible postgis-java tag for postgis-2.2.0 ?

2015-11-17 Thread Bandaru Muralikrishna
Hi,

I want to build postgis jdbc driver with postgis-2.2.0 sources. I
didn't see any postgis-java related files  with postgis-2.2.0 sources.
The statement from http://postgis.net/source/ link is saying "As of
June 2015, PostGIS JDBC development has been split from PostGIS core
and is now on github."  I can see four tags under postgis-java git hub
repository ( https://github.com/postgis/postgis-java/ ). So which one
is compatible tag for me to build  postgis jdbc driver with
postgis-2.2.0 sources.

---
Thanks & Regards
Murali Krishna
___
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/postgis-users

Re: [postgis-users] compatible postgis-java tag for postgis-2.2.0 ?

2015-11-17 Thread Phillip Ross
Hi Bandaru... since the split from core, the postgis jdbc extensions
are no longer versioned along with the PostGIS core.  The latest
release of the the jdbc extensions works fine with postgis-2.2.0.

Hope that helps!

- Phillip

On Tue, Nov 17, 2015 at 8:15 AM, Bandaru Muralikrishna
 wrote:
> Hi,
>
> I want to build postgis jdbc driver with postgis-2.2.0 sources. I
> didn't see any postgis-java related files  with postgis-2.2.0 sources.
> The statement from http://postgis.net/source/ link is saying "As of
> June 2015, PostGIS JDBC development has been split from PostGIS core
> and is now on github."  I can see four tags under postgis-java git hub
> repository ( https://github.com/postgis/postgis-java/ ). So which one
> is compatible tag for me to build  postgis jdbc driver with
> postgis-2.2.0 sources.
>
> ---
> Thanks & Regards
> Murali Krishna
> ___
> postgis-users mailing list
> postgis-users@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/postgis-users
___
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/postgis-users

Re: [postgis-users] lat,lon or lon,lat in WGS84 WKT

2015-11-17 Thread Willy-Bas Loos
Thanks a lot for your responses!

WBL
___
postgis-users mailing list
postgis-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/postgis-users