|
What seems to be going on is that your original table, or at least the geom field you used, had data in a projection that was not latitude/longitude projection. A geom field in Manifold stores X, Y, and Z coordinate numbers, three numbers, all within a single field. If you want to fetch just one of those numbers you use one of the GeomCoord... SQL functions. You could use GeomCoordXY (which gives you a two-number vector and then you pull a single number out using VectorValue) as you did or, as some people find easier, use the GeomCoordX, GeomCoordY, and GeomCoordZ functions, which provide a single number directly. But the only thing those functions do is pull the desired coordinate number out of the set of three coordinate numbers stored in the geom. They don't reproject that number for you if you want that coordinate number to be in some coordinate system that is different than the coordinate system used in the geom. In your case, if you used a GeomCoord function to pull an X or Y coordinate number out of the geom triplet, and that number looked weird, like 18038489.0300 instead of something that looks like a lat (+- 90) or lon (+- 180), then the geom from which you pulled that coordinate wasn't in a latitude/longitude projection. It used a different coordinate system. If you have a geom that uses a different coordinate system and you want to get the coordinates as if you were using a latitude/longitude coordinate system, you have two choices: 1) convert the geom field to latitude and longitude. In the simple case where a table has only one drawing associated with it (and thus only one geom field) you just reproject the drawing into lat/lon and you're done. Now, when you get the coordinates using a GeomCoord... function, the numbers are lat/lon numbers. 2) use an SQL expression to compute the lat/lon equivalent on the fly. That's what the SQL snippets in the computed fields topic do. They don't assume your geom is in lat/lon but instead add some SQL (the CoordConvert... parts) that does a conversion on the fly just in case your coordinate system is not lat/lon. Note also two important concepts: - A latitude/longitude projection is just a coordinate system like all the others. It's not some unique basis for truth. It's just a different projection. - There is no single, authoritative latitude/longitude coordinate system, no more than there is a single variety of potatoes. The lat/lon system which uses a WGS84 datum is very popular, so popular that speaking casually people (and Manifold documentation) often assumes that's what you mean when you say "lat/lon projection." But in reality there are hundreds, if not thousands, of different lat/lon coordinate systems that are differentiated by the datum used. The datum, speaking casually, is the choice of Earth ellipsoid and the position (where the coordinate system is centered within the ellipsoid) of the ellipsoid. Experienced operators never take it for granted that the lat/lon system being used is the one using the WGS84 datum. They always check, especially for older data. See the Latitude and Longitude are Not Enough essay.
|