I'm trying to convert line features from PostGIS to GeoJSON files, as follows:

from psycopg2 import *
from subprocess import call

conn = connect(dbname='gis')
cur=conn.cursor()

cur.execute("SELECT distinct osm_id,route_name from planet_osm_line where route_name like '%Rail Trail' and network='rcn';")

for record in cur:
  print "%s" % record[1]
  call (["ogr2ogr", "-f", "GeoJSON", record[1] + ".json",  'PG:dbname=\'gis\'', "-sql", 'SELECT route_name,osm_id,tags::hstore-&gt;\'state\' as state,way from planet_osm_line where osm_id=%d' % record[0]])


That is, ultimately ogr2ogr gets called like this:

ogr2ogr -f GeoJSON blah.json "PG:dbname='gis'" -sql 'SELECT route_name,osm_id,tags::hstore-&gt;\'state\' as state,way from planet_osm_line where osm_id=-12345'


The GeoJSON files that get created have coordinates that look like this [ 16153119.78, -4561568.23 ]:

{ "type": "Feature", "properties": { "route_name": "Waverley Rail Trail", "osm_id": -64660, "state": null }, "geometry": { "type": "LineString", "coordinates": [ [ 16153119.78, -4561568.23 ], [ 16153117.1, -4561567.48 ], [ 16153114.81, -4561565.86 ], [ 16153113.24, -4561563.55 ], [ 16153112.64, -4561561.63 ], [ 16153112.64, -4561558.82 ], [ 16153113.6, -4561556.2 ], [ 16153115.39, -4561554.05 ], [ 16153117.82, -4561552.66 ], [ 16153119.98, -4561552.2 ], [ 16153122.76, -4561552.48 ], [ 16153125.28, -4561553.69 ], [ 16153127.35, -4561555.88 ], [ 16153128.43, -4561558.46 ], [ 16153128.62, -4561560.38 ], [ 16153128.08, -4561563.13 ], [ 16153126.64, -4561565.51 ], [ 16153124.47, -4561567.26 ], [ 16153121.82, -4561568.17 ], [ 16153119.78, -4561568.23 ] ] } }


Please forgive my ignorance, but what am I doing wrong here? I assume what is being written is some kind of projected value rather than the raw lat/long - so how do I get those? 

I've tried using t_srs=ESPG:3857 but that didn't fix it.


Question: Litvaks/Yeshivish and Shulchan Aruch
Answer: First of all, there's no rule that all of the litvishe Ashkenazim have to follow the Mishna Berura. It was very well accepted, but deciding on each halacha is a very complicated matter, and on every page of the Dirshu or Oz VeHadar versions of the Mishna Berurah you can find places where later poskim have disagreed and where certain rulings of the Mishna Berurah have not been widely accepted. In fact, in the introrduction to the Oz VeHadar Aruch Hashulchan, it states that Rav Moshe Feinstein would often pasken like the Aruch Hashulchan over the Mihnah Berurah (though finding all of those places isn't so easy since he doesn't always quote them) and there's a teshuvah by Rav Yosef Eliyahu Henkin's grandson which says that he also thought the Aruch Hashulchan wins over the Mishna Berurah, (Shut Bnei Banim 2:8). But again, halacha is complicated and great poskim decide these things on a case by case basis. 

Having said all that, I think it should be clear the first source for an authoritative, litvish, late European commentary on Shulchan Aruch, the Aruch Hashulchan would be the answer, but the Chayei Adam and Kitzur Shulchan Aruch are used often as well, and are much easier to read. Of course, there are many issues, teshuvos, and poskim who have come afterwords, so seforim that are now popular include the Badei Hashulchan (and more recently Divrei Sofrim) on Y.D. and the Pischei Choshen (which isn't a commentary on Shulchan Aruch but still very thorough and widely accpeted as far as I've seen) on C.M. and dayanim studying Even Haezer often use the Otzar HaPoskim.

Also, I should point out that the Lubavitcher Rebbe's Shulchan Aruch on Y.D. and C.M. especially are far from comprehensive