Spatial

Coding and Paper Letter(一)

随声附和 提交于 2019-12-02 06:13:15
最近发现需要在快速阅读背景下,对快餐式资源做整理与收集。以Coding(以Github)和Paper(自己看到的一些论文,论文一般主要看题目和摘要做些简单小结)的资源为主。 1 Coding: 1.QGIS上的变形地图插件,我后面会专门来介绍变形地图这个主题的内容。 qgis-cartogram源码 2.火星坐标与地球坐标转换开源代码。 命令行版 Python版 项目与说明 3.空间统计开源软件GeoDa资源。 GeoDa 源码 4.空间统计分析开源Python库——PySAL。 PySAL GitHub 5.GIS资源链接整理。 Awesome GIS 6.R语言包(rasterVIS)。一个专门针对栅格做可视化的包。十分强大。 rasterVis GitHub 7.基于CityEngine开发的地理设计工具箱。这个项目讨论了一系列工具,这些工具旨在使数据驱动设计能够支持大规模方案规划项目。这些工具旨在集成GIS和CityEngine,以支持创建大量3D内容,以支持城市规划/地理设计项目。创建的内容可用于创建图像作为剪切图纸的一部分(与数据驱动页面一起使用),或链接到Web地图中的Web内容(通过提供弹出窗口或Web场景链接到的内容)。这里提出的工作流程的重点是街道,但脚本也支持与建筑物/批次/分区可视化相关的项目。意图:这些工具的目的是通过结合使用GIS和CityEngine

Find nearest cities from the data frame to the specific location

谁说我不能喝 提交于 2019-12-02 02:25:31
Below dataframe contains the information about the lat, long , state and city. I want to find the three nearest cities for every city given in the dataframe. For example, from the below dataframe, Oklahoma city and Colarado SPringd nearest to Albuquerque, So three nearest city to Albuquerque should be saved in other dataframe named nearest_AL(I don't know how to get this result, that'y I tried to gave an idea by creating a data frame). dataframe<-data.frame(long=c("-106.61291","-81.97224","-84.42770","-72.68604","-97.60056","-104.70261"), lat=c("35.04333","33.37378","33.64073","41.93887","35

How to modify a polygon to be a hole (SpatialPolygons) changing its slots

喜欢而已 提交于 2019-12-02 02:23:21
Edit: As suggested by Edzer Pebesma in the comments, the recommended method to add a hole to a polygon is not to modify the slot but to rebuild the polygon, as illustrated in this related question . Original question Following the help of SpatialPolygons-class I tried to modify a polygon to be a hole of an other polygon but while the "hole polygon" is displayed as a border of the other polygon, its inside is colored as the rest. What am I doing wrong? Using defPunched and defHole defined here : library("sp") load(url("http://spatcontrol.net/CorentinMBarbu/misc/holeIssue.rda")) defHole@polygons

Create MySQL spatial column - Point Data type with lat long without using Alter table

我的未来我决定 提交于 2019-12-01 13:52:13
How can I create a MySQL spatial column with "Point" Data type using latitude & longitude using a CREATE statement. (Without using Alter) Do I need to store latitude and longitude as well or can I insert both values into the Point(x,y) field and get rid of the latitude/ longitude columns? The examples that I have read till now retain the lat long fields. Please share some examples. e4c5 The point field has both the latitude and longitude data stored inside it and they can be retrieved quite easily if required. Assuming your point field is name pt, the following query gives this information.

Calculate longitude/latitude for geographic centroid

陌路散爱 提交于 2019-12-01 13:47:32
问题 I want to do some spatial statistic analysis with the county-level crop yield data in Nebraska for the STAT class. For that I need the longitude and latitude of the geographic centroids of each county. Anybody know how to do it in R? I know it can be done in ArcGIS but I have no access to it now. 回答1: You didn't give any details where you got your shapefile from, but I got one from here and you can use gCentroid from rgeos thusly: library(rgdal) library(sp) library(rgeos) nebraska <- readOGR(

Using mat2listw function in R to create spatial weights matrix

拈花ヽ惹草 提交于 2019-12-01 11:43:42
问题 I am attempting to create a weights object in R with the mat2listw function. I have a very large spatial weights matrix (roughly 22,000x22,000) that was created in Excel and read into R, and I'm now trying to implement: library(spdep) SW=mat2listw(matrix) I am getting the following error: Error in if (any(x<0)) stop ("values in x cannot be negative"): missing value where TRUE/FALSE needed. What's going wrong here? My current matrix is all 0's and 1's, with no missing values and no negative

spatial interpolation error using idw

爱⌒轻易说出口 提交于 2019-12-01 09:43:04
I am trying to spatially interpolate a dataset of seawater pH by lat & long: sample<-read.csv(file="Station locations 2016.csv", header=TRUE, sep=",", strip.white=T) head(sample) Station lat long pH 1 B17 -23.49174 152.0718 8.222411 2 B23 -23.49179 152.0718 8.199310 3 B26 -23.49182 152.0717 8.140428 4 B28 -23.49183 152.0717 8.100752 5 B30 -23.49185 152.0717 8.068141 6 B31 -23.49187 152.0717 8.048852 I have created a grid based on the existing ranges in lat/long data and want to interpolate the pH values so that I can produce a color-coded map of pH. The following code works until the spatial

R Message: Error - replacement has x rows, data has y

假装没事ソ 提交于 2019-12-01 09:38:50
问题 I am trying to use the package ggmap to caculate the distance for a target address with a list of addresse. My data in a csv looks like below: Order ID Address 1652049 435 E 70TH ST,10021 1652123 1365 YORK AVE,10021 1652053 530 E 72ND ST,10021 so I try to get the distance from my input address to all those address for example: 400 Hudson St,10013, and I have following code in R: library(ggmap) mydata<-read.csv("address.csv") mydata$Address<-as.character(mydata$Address) mydata$Distance<-NA a<

Spatial query on large table with multiple self joins performing slow

心不动则不痛 提交于 2019-12-01 06:59:39
I am working on queries on a large table in Postgres 9.3.9. It is a spatial dataset and it is spatially indexed. Say, I have need to find 3 types of objects: A, B and C. The criteria is that B and C are both within certain distance of A, say 500 meters. My query is like this: select school.osm_id as school_osm_id, school.name as school_name, school.way as school_way, restaurant.osm_id as restaurant_osm_id, restaurant.name as restaurant_name, restaurant.way as restaurant_way, bar.osm_id as bar_osm_id, bar.name as bar_name, bar.way as bar_way from ( select osm_id, name, amenity, way, way_geo

Spatial query on large table with multiple self joins performing slow

喜欢而已 提交于 2019-12-01 04:45:53
问题 I am working on queries on a large table in Postgres 9.3.9. It is a spatial dataset and it is spatially indexed. Say, I have need to find 3 types of objects: A, B and C. The criteria is that B and C are both within certain distance of A, say 500 meters. My query is like this: select school.osm_id as school_osm_id, school.name as school_name, school.way as school_way, restaurant.osm_id as restaurant_osm_id, restaurant.name as restaurant_name, restaurant.way as restaurant_way, bar.osm_id as bar