Nyclu is a project mainly written in ..., it's free.
#datadivenyc
brew install postgis brew install gdal
initdb /usr/local/var/postgres
cp /usr/local/Cellar/postgresql/9.0.4/org.postgresql.postgres.plist ~/Library/LaunchAgents launchctl load -w ~/Library/LaunchAgents/org.postgresql.postgres.plist
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
psql postgres -c "select 1;"
createdb template_postgis psql -d template_postgis -f /usr/local/Cellar/postgresql/9.0.4/share/postgresql/contrib/postgis-1.5/postgis.sql psql -d template_postgis -f /usr/local/Cellar/postgresql/9.0.4/share/postgresql/contrib/postgis-1.5/spatial_ref_sys.sql
createdb -T template_postgis nyclu psql -d nyclu
cat CREATE_TABLE.txt | pbcopy
ogr2ogr -f PGDump sqf_2010.sql 2010.csv
psql -d nyclu -f sqf_2010.sql
SELECT AddGeometryColumn ('public','sqf_2010','the_geom',4326,'POINT',2);
UPDATE "sqf_2010" SET the_geom = ST_Transform(ST_GeomFromText('POINT('|| xcoord ||' ' || ycoord || ')', 2263), 4326) WHERE coalesce(trim(xcoord),'') <> '' AND coalesce(trim(ycoord),'') <> '';
CREATE INDEX idx_2010_the_geom ON "2010" USING GIST ( the_geom );
create table state_plane_to_latlng as SELECT DISTINCT xcoord, ycoord , ST_x(the_geom) as longitude , ST_y(the_geom) as latitude from "sqf_2010" ORDER BY xcoord, ycoord;
COPY state_plane_to_latlng TO '/state_plane_to_latlng.csv' CSV HEADER;