You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each projection has its own set of formats for representing a point. A way to parse a coordinate string into a point, or format a point into a string, is needed.
For example, UTM coordinate "17T 630084 4833438" or "17T 630084 4833438" should be parsed to:
So there are many strings for the same coordinate point, and choosing the right string is important in both directions.
Where should this be? The projection classes seem like the right place for the functionality at least. The Point\Projected class is a good place to access this, so we can create a point from a string something like this:
$point = Projected::fromString('17T 630084 4833438', new Projection(Params::projection('tmerc')))`
Some additional options may be needed to indicate just how the string should be parsed.
Similarly, $point->toString($format_id) should be able to give us '17T 630084 4833438', given the right format ID.
The text was updated successfully, but these errors were encountered:
At the moment in Proj4 (PHP and JS ports), the projection classes just handle the very core conversions between lat/lon and x/y. That does not entirely work, since many coordinate systems need more than x and y, e.g. zone. Parsing and formatting the points happens in a separate class, which does not have any knowledge about what type of projection is being used - it takes the x and the y and plugs them into a formatter or parser.
This new approach will be s stricter, by limiting each projection to being converted from and to only the string formats that is relevant to each.
Each projection has its own set of formats for representing a point. A way to parse a coordinate string into a point, or format a point into a string, is needed.
For example, UTM coordinate "17T 630084 4833438" or "17T 630084 4833438" should be parsed to:
or maybe:
So there are many strings for the same coordinate point, and choosing the right string is important in both directions.
Where should this be? The projection classes seem like the right place for the functionality at least. The
Point\Projected
class is a good place to access this, so we can create a point from a string something like this:Some additional options may be needed to indicate just how the string should be parsed.
Similarly,
$point->toString($format_id)
should be able to give us '17T 630084 4833438', given the right format ID.The text was updated successfully, but these errors were encountered: