I'm having a strange problem with geo2xy that I can't figure out. I have a set of coordinates and a shape file that are both in WGS1984. When I used SPMAP they look fine. I can see the x y locations on top of the polygon of Philadelphia block groups.
here is the basic code example:
use "C:~phillyblockgsdb.dta", clear
spmap using "C:~phillyblockgscoord.dta", id(id) ///
fcolor(eggshell) ocolor(black) osize(thin) ///
point(data("C:~cluster_locations.dta") x(longitude_x) y (latitude_y) ///
size(*0.5) fcolor(green blue black) ocolor(white) ///
by (arm) ///
osize(vvthin)) ///
title ("Vacant Lot Locations", size(*1.2)) ///
subtitle ("Citywide RCT", size (*1.0))
But when I use geo2xy and project to mercator they no longer overlap on the x-axis. The y-axis looks okay.
use "C~phillyblockgscoord.dta", clear
geo2xy _Y _X, replace proj(mercator)
save "C~phillyblockscoordmerc.dta"
use "C~buffercluster.dta", clear
*reproject to coordinates
geo2xy latitude_y longitude_x, replace project(mercator)
save "C~cluster_locations_prj.dta", replace
use "C~phillyblockgsdb.dta", clear
spmap using "C~phillyblockscoordmerc.dta", id(id) ///
fcolor(eggshell) ocolor(grey) osize(thin) ///
point(data("C~cluster_locations_prj.dta") x(longitude_x) y(latitude_y) ///
size(*0.5) fcolor(black blue green) ocolor(white) ///
by (arm) ///
osize(vvthin)) ///
title ("Vacant Lot Locations", size(*1.2)) ///
subtitle ("Citywide RCT", size (*1.0))
here is the basic code example:
use "C:~phillyblockgsdb.dta", clear
spmap using "C:~phillyblockgscoord.dta", id(id) ///
fcolor(eggshell) ocolor(black) osize(thin) ///
point(data("C:~cluster_locations.dta") x(longitude_x) y (latitude_y) ///
size(*0.5) fcolor(green blue black) ocolor(white) ///
by (arm) ///
osize(vvthin)) ///
title ("Vacant Lot Locations", size(*1.2)) ///
subtitle ("Citywide RCT", size (*1.0))
But when I use geo2xy and project to mercator they no longer overlap on the x-axis. The y-axis looks okay.
use "C~phillyblockgscoord.dta", clear
geo2xy _Y _X, replace proj(mercator)
save "C~phillyblockscoordmerc.dta"
use "C~buffercluster.dta", clear
*reproject to coordinates
geo2xy latitude_y longitude_x, replace project(mercator)
save "C~cluster_locations_prj.dta", replace
use "C~phillyblockgsdb.dta", clear
spmap using "C~phillyblockscoordmerc.dta", id(id) ///
fcolor(eggshell) ocolor(grey) osize(thin) ///
point(data("C~cluster_locations_prj.dta") x(longitude_x) y(latitude_y) ///
size(*0.5) fcolor(black blue green) ocolor(white) ///
by (arm) ///
osize(vvthin)) ///
title ("Vacant Lot Locations", size(*1.2)) ///
subtitle ("Citywide RCT", size (*1.0))
Comment