proj4js and axis order

8 messages Options
Embed this post
Permalink
bartvde

proj4js and axis order

Reply Threaded More More options
Print post
Permalink
Hi list,

is there a way to get the axis order from a PROJ4JS projection object?

Best regards,
Bart

_______________________________________________
MetaCRS mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/metacrs
Christopher Schmidt-2

Re: proj4js and axis order

Reply Threaded More More options
Print post
Permalink
On Wed, Sep 30, 2009 at 02:27:01PM +0200, [hidden email] wrote:
> Hi list,
>
> is there a way to get the axis order from a PROJ4JS projection object?

proj.4 (and consequently, proj4js), does not have any idea on axis order,
so far as I'm aware.

Best Regards,
--
Christopher Schmidt
MetaCarta
_______________________________________________
MetaCRS mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/metacrs
Harley Powers Parks

RE: proj4js and axis order

Reply Threaded More More options
Print post
Permalink
In reply to this post by bartvde
Hi, just curious.

What is meant by "axis order"?

Axis orientation from the origin..0,0 on a 2D plane? X is horizontal,
increase from left to right, decreases from right to left; y is vertical
perpendicular to X axis, increase from low to high, decreases from high to
low.

Is that the answer?

Or is something like order of magnitude along the axis related to scale.




Harley Powers Parks
Geospatial Visualization Director
Hi-Tech Urban Solutions, Inc.
1003 Bishop Street
Pauahi Tower, Suite 704
Honolulu, Hawaii 96813
ph.: 808.537.2214
fax: 808.537.2215
 
[hidden email]
 
http://www.hitechurbansolutions.com
Notice: This communication and any attachments ("this message") may contain
confidential information for the sole use of the intended recipient(s). Any
unauthorized use, disclosure, viewing copying, alteration, dissemination or
distribution of, or reliance on this message is strictly prohibited. If you
have received this message in error, or you are not an authorized recipient,
please notify the sender immediately by replying to this message, delete
this message and all copies from your e-mail system and destroy any printed
copies.


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of [hidden email]
Sent: Wednesday, September 30, 2009 2:27 AM
To: [hidden email]
Subject: [MetaCRS] proj4js and axis order


Hi list,

is there a way to get the axis order from a PROJ4JS projection object?

Best regards,
Bart

_______________________________________________
MetaCRS mailing list
[hidden email] http://lists.osgeo.org/mailman/listinfo/metacrs

_______________________________________________
MetaCRS mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/metacrs
Christopher Schmidt-2

Re: proj4js and axis order

Reply Threaded More More options
Print post
Permalink
On Wed, Sep 30, 2009 at 09:11:01AM -1000, Harley Powers Parks wrote:
> Hi, just curious.
>
> What is meant by "axis order"?
>
> Axis orientation from the origin..0,0 on a 2D plane? X is horizontal,
> increase from left to right, decreases from right to left; y is vertical
> perpendicular to X axis, increase from low to high, decreases from high to
> low.

Axis order, as it relates to coordinate systems, is the definition of
which axis comes first in a series of coordinates. So, for example, if you
have Boston, is the point:
 
 * lon, lat -- -71, 42
 * lat, lon -- 42, -71
 * x, y,   y, x,  x, y, z, etc.

The EPSG database defines, for each projection, the order of the coordinates
within a set of coordinates. Generally, these coordinates are lat, lon
ordered in the case of geographic projections, and lon, lat ordered in the
case of projected coordinate systems.

However, there are exceptions to all of these cases.

More modern WMS specs require clients to know what the coordinate order
for a set of coordinates is, and request a bounding box (4-tuple defining
a 2d box) in that projection. So for Boston, you have to request in
 
  srs=EPSG:4326&bbox=41,-72,43,-70

The problem with this is, of course, the fact that in order to make this
request correctly, rather than assuming you can just do 'min_x, min_y,
max_x, max_y', you have to have a complete knowledge of the coordinate
systems that are possible to use in your application, or have some way
to communicate or obtain that data.

Best Regards,
--
Christopher Schmidt
MetaCarta
_______________________________________________
MetaCRS mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/metacrs
bartvde

Re: proj4js and axis order

Reply Threaded More More options
Print post
Permalink
Indeed, thanks for the detailed explanation Chris.

So there are no plans to extend the proj4js projection object with this
info? That will make it really hard to make a generic WMS 1.3 javascript
client ..... maybe I can take a shot at it with a few pointers.

Chris, can the axis order info be retrieved through
spatialreference.org, and if so, how? TIA.

Best regards,
Bart

Christopher Schmidt wrote:

> On Wed, Sep 30, 2009 at 09:11:01AM -1000, Harley Powers Parks wrote:
>  
>> Hi, just curious.
>>
>> What is meant by "axis order"?
>>
>> Axis orientation from the origin..0,0 on a 2D plane? X is horizontal,
>> increase from left to right, decreases from right to left; y is vertical
>> perpendicular to X axis, increase from low to high, decreases from high to
>> low.
>>    
>
> Axis order, as it relates to coordinate systems, is the definition of
> which axis comes first in a series of coordinates. So, for example, if you
> have Boston, is the point:
>  
>  * lon, lat -- -71, 42
>  * lat, lon -- 42, -71
>  * x, y,   y, x,  x, y, z, etc.
>
> The EPSG database defines, for each projection, the order of the coordinates
> within a set of coordinates. Generally, these coordinates are lat, lon
> ordered in the case of geographic projections, and lon, lat ordered in the
> case of projected coordinate systems.
>
> However, there are exceptions to all of these cases.
>
> More modern WMS specs require clients to know what the coordinate order
> for a set of coordinates is, and request a bounding box (4-tuple defining
> a 2d box) in that projection. So for Boston, you have to request in
>  
>   srs=EPSG:4326&bbox=41,-72,43,-70
>
> The problem with this is, of course, the fact that in order to make this
> request correctly, rather than assuming you can just do 'min_x, min_y,
> max_x, max_y', you have to have a complete knowledge of the coordinate
> systems that are possible to use in your application, or have some way
> to communicate or obtain that data.
>
> Best Regards,
>  


--
Bart van den Eijnden
OSGIS, Open Source GIS
[hidden email]
http://www.osgis.nl

_______________________________________________
MetaCRS mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/metacrs
Christopher Schmidt-2

Re: proj4js and axis order

Reply Threaded More More options
Print post
Permalink
On Thu, Oct 01, 2009 at 08:03:00PM +0200, Bart van den Eijnden (OSGIS) wrote:
> Indeed, thanks for the detailed explanation Chris.
>
> So there are no plans to extend the proj4js projection object with this  
> info? That will make it really hard to make a generic WMS 1.3 javascript  
> client ..... maybe I can take a shot at it with a few pointers.
>
> Chris, can the axis order info be retrieved through  
> spatialreference.org, and if so, how? TIA.

not that I'm aware of. Some projections (not supported by GDAL) may
have "AXIS" things in the WKT, but since the primary source for a lot
of them is GDAL/OGR/proj (which don't store this information), any that come
from that source will not have the information available.

-- Chris

> Best regards,
> Bart
>
> Christopher Schmidt wrote:
>> On Wed, Sep 30, 2009 at 09:11:01AM -1000, Harley Powers Parks wrote:
>>  
>>> Hi, just curious.
>>>
>>> What is meant by "axis order"?
>>>
>>> Axis orientation from the origin..0,0 on a 2D plane? X is horizontal,
>>> increase from left to right, decreases from right to left; y is vertical
>>> perpendicular to X axis, increase from low to high, decreases from high to
>>> low.
>>>    
>>
>> Axis order, as it relates to coordinate systems, is the definition of  
>> which axis comes first in a series of coordinates. So, for example, if
>> you
>> have Boston, is the point:
>>    * lon, lat -- -71, 42
>>  * lat, lon -- 42, -71
>>  * x, y,   y, x,  x, y, z, etc.
>>
>> The EPSG database defines, for each projection, the order of the coordinates
>> within a set of coordinates. Generally, these coordinates are lat, lon
>> ordered in the case of geographic projections, and lon, lat ordered in the
>> case of projected coordinate systems.
>>
>> However, there are exceptions to all of these cases.
>>
>> More modern WMS specs require clients to know what the coordinate order
>> for a set of coordinates is, and request a bounding box (4-tuple
>> defining
>> a 2d box) in that projection. So for Boston, you have to request in
>>     srs=EPSG:4326&bbox=41,-72,43,-70
>>
>> The problem with this is, of course, the fact that in order to make
>> this request correctly, rather than assuming you can just do 'min_x,
>> min_y, max_x, max_y', you have to have a complete knowledge of the
>> coordinate systems that are possible to use in your application, or
>> have some way
>> to communicate or obtain that data.
>>
>> Best Regards,
>>  
>
>
> --
> Bart van den Eijnden
> OSGIS, Open Source GIS
> [hidden email]
> http://www.osgis.nl
>

--
Christopher Schmidt
MetaCarta
_______________________________________________
MetaCRS mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/metacrs
Frank Warmerdam

Re: proj4js and axis order

Reply Threaded More More options
Print post
Permalink
Christopher Schmidt wrote:

> On Thu, Oct 01, 2009 at 08:03:00PM +0200, Bart van den Eijnden (OSGIS) wrote:
>> Indeed, thanks for the detailed explanation Chris.
>>
>> So there are no plans to extend the proj4js projection object with this  
>> info? That will make it really hard to make a generic WMS 1.3 javascript  
>> client ..... maybe I can take a shot at it with a few pointers.
>>
>> Chris, can the axis order info be retrieved through  
>> spatialreference.org, and if so, how? TIA.
>
> not that I'm aware of. Some projections (not supported by GDAL) may
> have "AXIS" things in the WKT, but since the primary source for a lot
> of them is GDAL/OGR/proj (which don't store this information), any that come
> from that source will not have the information available.

Folks,

Given sufficient interest, I'd like to see us make progress on better axis
orientation handle (xy vs. yx as well as mirroring such as coordinate
systems with westing, southing instead of easting, northing) in
OGRSpatialReference, PROJ.4 and spatialreference.org.

There is some limited knowledge about axis orientation now in
OGRSpatialReference, as noted, via the AXIS keywords and OGRSpatialReference
has some methods to get the true EPSG axis definitions as opposed to
the default action which is still long,lat for geographic coordinate systems
to match common gis practice.  I'd like to introduce axis orientation keywords
into PROJ.4 which would be applied as part of pj_transform() (but not affecting
the core code in PROJ.4).   Hopefully proj4js could incorporate support
for such a keyword once done in PROJ.4.

Some coordination with existing hacks for axis support in MapServer
may be needed.

The other area I'd love to make progress, specially in spatialreference.org,
is having it provide a full list of EPSG provided datum shift parameters
when inspecting a coordinate system.  This will need to be accomplished
by direct query of the EPSG database since these options cannot currently
be carried through OGRSpatialReference in the form of WKT.

I'm willing to do some hacking on this.  I'll try and look into how to setup
a private development instance of spatialreference.org once that is in svn.

Some work might also be appropriate in how the libgeotiff EPSG translation
code decides on a datum shift for a given datum.  Currently it provides
no datum shift values if there are more than one possible under the assumption
picking randomly is worse than not picking and hopefully forcing the user
to realize they need to find one appropriate to their circumstances.  This
approach (of mine) has been rightly a subject of much complaint.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, [hidden email]
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

_______________________________________________
MetaCRS mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/metacrs
Norm Olsen

RE: proj4js and axis order

Reply Threaded More More options
Print post
Permalink
Hello All . . .

With regard to AXIS implementations:

I view the AXIS business in the same way most folks think of the Vista User Access Control:  How do you turn the ?*%^~& thing off?  While it is nice to be technically correct, in practical reality, it is a pain.  Perhaps the CAD/GIS world I've been living in all these years is too limited; I can accept that.  It's just that rigorously adopting the AXIS specifications of all coordinate systems produces many more support and maintenance headaches than it can ever be worth.  When users import a data set into GIS, they expect to see what they normally see on a map.  If they don't, they call for help.  Being technically correct doesn't help pay the bills.  Just my humble opinion.
 
In any case, that's why the CS_MAP approach is very simple and is probably what has been referred to as the "MapServer hack".  Simply put, it's a simple enumeration of the various states:

        {   0, "X/Lng increases to the east, Y/Lat increases to the north" }, /* Default value */
        {   1, "X/Lng increases to the east, Y/Lat increases to the north" },
        {   2, "X/Lng increases to the west, Y/Lat increases to the north" },
        {   3, "X/Lng increases to the west, Y/Lat increases to the south" },
        {   4, "X/Lng increases to the east, Y/Lat increases to the south" },
        {  -1, "Y/Lat increases to the east, X/Lng increases to the north" },
        {  -2, "Y/Lat increases to the west, X/Lng increases to the north" },
        {  -3, "Y/Lat increases to the west, X/Lng increases to the south" },
        {  -4, "Y/Lat increases to the east, X/Lng increases to the south" }

This might be worth considering.

With regard to Datum parameters:

In the current CS-MAP you'll find a significant amount of code which deals with these issues.  It's incorporated into the EpsgStuff modules.  Using the EPSG database in csv form, it builds list of all the different ways to get from one datum to another.  It properly handles concatenated operations and supports filtering out stuff like longitude translation (i.e. prime meridian shifting) and null transformations.  CS-MAP uses it to decide what to compare against when seeking the verify if a CS-MAP definition jives with the EPSG version (most, but all, do).  It ain't perfect, but perhaps it's a useful base for more work in this regard.

Norm

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Frank Warmerdam
Sent: Thursday, October 01, 2009 1:06 PM
To: Christopher Schmidt
Cc: [hidden email]
Subject: Re: [MetaCRS] proj4js and axis order

Christopher Schmidt wrote:

> On Thu, Oct 01, 2009 at 08:03:00PM +0200, Bart van den Eijnden (OSGIS) wrote:
>> Indeed, thanks for the detailed explanation Chris.
>>
>> So there are no plans to extend the proj4js projection object with this  
>> info? That will make it really hard to make a generic WMS 1.3 javascript  
>> client ..... maybe I can take a shot at it with a few pointers.
>>
>> Chris, can the axis order info be retrieved through  
>> spatialreference.org, and if so, how? TIA.
>
> not that I'm aware of. Some projections (not supported by GDAL) may
> have "AXIS" things in the WKT, but since the primary source for a lot
> of them is GDAL/OGR/proj (which don't store this information), any that come
> from that source will not have the information available.

Folks,

Given sufficient interest, I'd like to see us make progress on better axis
orientation handle (xy vs. yx as well as mirroring such as coordinate
systems with westing, southing instead of easting, northing) in
OGRSpatialReference, PROJ.4 and spatialreference.org.

There is some limited knowledge about axis orientation now in
OGRSpatialReference, as noted, via the AXIS keywords and OGRSpatialReference
has some methods to get the true EPSG axis definitions as opposed to
the default action which is still long,lat for geographic coordinate systems
to match common gis practice.  I'd like to introduce axis orientation keywords
into PROJ.4 which would be applied as part of pj_transform() (but not affecting
the core code in PROJ.4).   Hopefully proj4js could incorporate support
for such a keyword once done in PROJ.4.

Some coordination with existing hacks for axis support in MapServer
may be needed.

The other area I'd love to make progress, specially in spatialreference.org,
is having it provide a full list of EPSG provided datum shift parameters
when inspecting a coordinate system.  This will need to be accomplished
by direct query of the EPSG database since these options cannot currently
be carried through OGRSpatialReference in the form of WKT.

I'm willing to do some hacking on this.  I'll try and look into how to setup
a private development instance of spatialreference.org once that is in svn.

Some work might also be appropriate in how the libgeotiff EPSG translation
code decides on a datum shift for a given datum.  Currently it provides
no datum shift values if there are more than one possible under the assumption
picking randomly is worse than not picking and hopefully forcing the user
to realize they need to find one appropriate to their circumstances.  This
approach (of mine) has been rightly a subject of much complaint.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, [hidden email]
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

_______________________________________________
MetaCRS mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/metacrs
_______________________________________________
MetaCRS mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/metacrs