id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc 2742,Rounding bug using ST_GeomFromGeojson(),jakeorr,pramsey,"Let's say I have the following geographical point represented in GeoJSON: {{{{""type"":""Point"",""coordinates"":[-109.0,35.292506]}}}} When I run the following conversion, things work as expected: {{{ SELECT ST_AsText(ST_GeomFromGeojson('{""type"":""Point"",""coordinates"":[-109.0,35.292506]}')); st_astext ----------------------- POINT(-109 35.292506) (1 row) }}} The problem occurs if the string passed to {{{ST_GeomFromGeojson()}}} omits the trailing decimal on {{{-109.0}}}: {{{ SELECT ST_AsText(ST_GeomFromGeojson('{""type"":""Point"",""coordinates"":[-109,35.292506]}')); st_astext ---------------- POINT(-109 35) (1 row) }}} Notice how in this case rounding to an Integer value occurs on both latitude and longitude. The loss of precision on the latitude value in this case is very significant (32.53 km). '''Note:''' I left out the CRS field for clarify, the problem occurs either way. The same problem does not occur using the {{{ST_GeomFromText()}}} function. Both numbers are ''not'' rounded to Integers if the first looks like an integer. Here is my postGIS full version: POSTGIS=""2.1.0 r11822"" GEOS=""3.4.2-CAPI-1.8.2 r3921"" PROJ=""Rel. 4.8.0, 6 March 2012"" GDAL=""GDAL 1.10.1, released 2013/08/26"" LIBXML=""2.9.1"" LIBJSON=""UNKNOWN"" RASTER",task,closed,medium,PostGIS 2.1.4,postgis,2.1.x,worksforme,,