我绘制了加利福尼亚的地图,并按县划分:
vector<line>::iterator iter = side.begin();
line closest = *iter;
double distance, sumOfDistances = 0.0;
cout << "Line coords" << endl << "distance | Sum of distances" << endl;
while (iter != side.end()) {
closest = *iter;
distance = closest.sqDistance();
sumOfDistances += distance;
cout << closest << endl << distance << " | " << sumOfDistances << endl; // step info output
iter++;
}
现在我正在尝试添加坐标。
每次我尝试添加坐标时,加利福尼亚地图都会消失,并且在X和Y轴图上会出现一个紫色的点。
CAL17 <- ca_base +
theme_nothing() +
geom_polygon(data = ca_county, fill = NA, color = "yellow") +
geom_polygon(color = "black", fill = NA)
我收到以下错误
labs17 <- data.frame(lon17, lat17, stringsAsFactors = FALSE) +
ggplot() +
geom_point(data = labs17, aes(x = lon17, y = lat17), color = "White", size = 5) +
geom_point(data = labs17, aes(x = lon17, y = lat17), color = "yellow", size = 4)
CAL17 +
geom_point(data = labs17, aes(x = lon17, y = lat17), color = "black", size = 5) +
geom_point(data = ca_df, aes(x = lon17, y = lat17), color = "purple", size = 2)