72

Use ST_AsText to view the point object: SELECT ST_AsText(the_geom) FROM myTable; To view X, Y, and the geom object: SELECT ST_X(the_geom), ST_Y(the_geom), ST_AsText(the_geom) FROM myTable;


53

In addition to ST_AsText (which returns geometry as WKT / Well Known Text), there are several additional output formats, like ST_AsGeoJSON(). Take a look in http://postgis.net/docs/manual-2.0/reference.html#Geometry_Outputs and choose, what fits your needs best.


12

With a table in UTM SELECT ST_X(table.geometry) AS X1, --point x ST_Y(table.geometry) AS Y1, --point y ST_X(ST_TRANSFORM(table.geometry,4674)) AS LONG, -- longitude point x SIRGAS 2000 ST_Y(ST_TRANSFORM(table.geometry,4674)) AS LAT, --latitude point y SIRGAS 2000 ST_ASTEXT(table.geometry) AS XY, --wkt point xy ST_ASTEXT(ST_TRANSFORM(table.geometry,4674)) ...


8

Using your Example you can use the Attribute Rounder This example reads value from a field DP and takes the decimal out. Note there is an option in the Attribute Rounder to go to the nearest value or go down or up in rounding.


6

If you create a new field, make it "integer" instead of "real" if you don't want any values after the comma anyway. Alternatively, use the "toint" function in "conversions".


6

Should be fairly easy. My first thought is to treat it as a string and use a StringReplacer transformer. Set Mode to "Replace Regular Expression" and set Text to Replace to \..*$ ie remove content starting with the decimal (\.) and then any other characters (.*) at the end of the string ($). And that should remove the decimal and fraction.


3

Most likely, the coordinates are changing but you can't see them changing because you're zoomed in pretty far and the change is small enough that it doesn't register in the coordinate display. You can change that by setting your data view to show more decimal places in the coordinate display under Customize > ArcMap Options. Change this number to 6 or 8: If ...


3

Try the IEEE 754 Converter http://www.h-schmidt.net/FloatConverter/IEEE754.html. Read the note: Rounding errors: Not every decimal number can be expressed exactly as a floating point number. This can be seen when entering "0.1" and examining its binary representation which is either slightly smaller or larger, depending on the last bit. You can ...


3

Here is a user contributed PostGIS function called dms2dd. Your data however looks like Degree, decimal Minutes. You may need to modify the function to suite your needs. functions


3

Took ASPMapper's approach but instead of doing math on my own, used geodesic package from PROJ.4 (python binding pyproj, http://code.google.com/p/pyproj/). from pyproj import Geod minX = -74.002747535706 # in degrees minY = 40.722282672831 maxX = -73.98386478424 maxY = 40.733470232685 distance = 100 # in meters g = Geod(ellps='WGS84') coords = [] lon,...


2

SELECT * ST_AsText(the_geom) FROM table2; Source: Getting geometry from multiple tables using PostGIS?


2

You could try setting the "Precision" field to zero. It's set to 4 by default.


2

After you round the values, you could create a new field and make sure to set the scale to 3 and calculate the values over. Check out the ArcGIS 10.2 Online Help for Add Field: field_scale Sets the number of decimal places stored in a field. This parameter is only used in Float and Double data field types. If the input table is a personal or ...


2

Just for yet another method to accomplish this task in FME, I thought I'd throw in a Python method. By no means is this the way I would usually truncate an attribute, I'd probably use @Mapperz's method. However, the option is there and Python is super powerful for dealing with attributes. You can use a PythonCaller transformer to return the truncated ...


2

Obligatory XKCD reference: More detailed answer


1

You have specifically worded your question around how many digits are shown as opposed to how many digits are stored, which are two quite different things, so this answer addresses how to modify what is shown/displayed as opposed to what is stored. You can configure your layer, in ArcMap to display only a specified number of decimal places, even if a more ...


1

If you are referring to the LonLat object you could define your own method OpenLayers.LonLat.prototype.truncate = function(digits) { var pow = Math.pow(10, digits); return new OpenLayers.LonLat(Math.round(this.lon * pow)/pow, Math.round(this.lat * pow)/pow); }


1

The <coordinates> are in longitude,latitude order. See https://developers.google.com/kml/documentation/kmlreference#syntax_151. So you wanted: <coordinates>0.03888889,51.45</coordinates> This is a pretty common mixup. Much of this stuff is done on a Cartesian plane, so think X-Y coordinates, and it'll make more sense.


1

On ArcGISOnline you can find information on how to add data to the map. It sounds as though you have a spreadsheet with addresses. You can add that as a csv file to your map and it will create the points for you with the addresses. You can also add a file with xy coordinates in the same way. but you will not get address information created doing that. If it ...


1

I think transform() function was not available when the question was posted (Y2013). Now we can solve this CRS issue, just by the Field Calculator! For Longitude: ...... x(transform($geometry, 'EPSG:3365', 'EPSG:4326')) For Latitude: ......... y(transform($geometry, 'EPSG:3365', 'EPSG:4326')) I created three random points near Philadelphia, and the ...


1

May be the problem has already been solved. I was facing the same problem and today I fixed it in this way Customize--ArcMap options---Data view---round coordinates to (select from drop down).I put 6 and that worked.


Only top voted, non community-wiki answers of a minimum length are eligible